/* Treatment modals — shell sizing matches patient modals (#viewPatientModalBody) */

#viewTreatmentModal,
#editTreatmentModal,
#addTreatmentModal,
#viewTreatmentModal .modal-dialog,
#editTreatmentModal .modal-dialog,
#addTreatmentModal .modal-dialog,
#viewTreatmentModalShell,
#editTreatmentModalShell,
#addTreatmentModalShell {
    overflow-x: hidden !important;
}

#viewTreatmentModalShell,
#editTreatmentModalShell,
#addTreatmentModalShell {
    overflow: hidden !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    margin-top: 0;
    padding: 0;
    background: transparent;
    border: none;
}

#viewTreatmentModalShell .view-patient-container,
#editTreatmentModalShell .view-patient-container,
#addTreatmentModalShell .view-patient-container {
    height: 100%;
    max-height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#viewTreatmentModalShell .view-patient-container > .modal-header,
#editTreatmentModalShell .view-patient-container > .modal-header,
#addTreatmentModalShell .view-patient-container > .modal-header {
    flex: 0 0 auto;
    background: #08151d !important;
    border-bottom: 1px solid #2a3f5f;
    padding: 1.5rem 2rem;
    align-items: center;
}

[data-bs-theme="light"] #viewTreatmentModalShell .view-patient-container > .modal-header,
[data-bs-theme="light"] #editTreatmentModalShell .view-patient-container > .modal-header,
[data-bs-theme="light"] #addTreatmentModalShell .view-patient-container > .modal-header {
    background: #f0f0f0 !important;
    border-bottom: 1px solid rgba(13, 110, 253, 0.1);
}

#viewTreatmentModalShell .view-patient-container > .modal-body-custom,
#editTreatmentModalShell .view-patient-container > .modal-body-custom,
#addTreatmentModalShell .view-patient-container > .modal-body-custom {
    flex: 1 1 auto;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    background: #08151d;
    color: #ffffff;
    padding: 1.25rem 2rem 1.5rem !important;
}

[data-bs-theme="light"] #viewTreatmentModalShell .view-patient-container > .modal-body-custom,
[data-bs-theme="light"] #editTreatmentModalShell .view-patient-container > .modal-body-custom,
[data-bs-theme="light"] #addTreatmentModalShell .view-patient-container > .modal-body-custom {
    background: #f0f0f0;
    color: #212529;
}

#viewTreatmentModalShell .view-patient-container > .modal-footer-custom,
#editTreatmentModalShell .view-patient-container > .modal-footer-custom,
#addTreatmentModalShell .view-patient-container > .modal-footer-custom {
    flex: 0 0 auto;
    background: #08151d !important;
}

[data-bs-theme="light"] #viewTreatmentModalShell .view-patient-container > .modal-footer-custom,
[data-bs-theme="light"] #editTreatmentModalShell .view-patient-container > .modal-footer-custom,
[data-bs-theme="light"] #addTreatmentModalShell .view-patient-container > .modal-footer-custom {
    background: #f0f0f0 !important;
}

/* Top-level treatment accordions — match patient modal collapse animation */
#viewTreatmentModal .crm-treatment-view > .collapsible-section,
#editTreatmentModal .crm-treatment-view > .collapsible-section,
#addTreatmentModal .crm-treatment-view > .collapsible-section,
#viewTreatmentModal .modal-body-custom > .collapsible-section,
#editTreatmentModal .modal-body-custom > .collapsible-section,
#addTreatmentModal .modal-body-custom > .collapsible-section,
#editTreatmentModal .crm-treatment-form > .collapsible-section,
#addTreatmentModal .crm-treatment-form > .collapsible-section {
    overflow: hidden;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

#viewTreatmentModal .crm-treatment-view > .collapsible-section > .section-content,
#editTreatmentModal .crm-treatment-view > .collapsible-section > .section-content,
#addTreatmentModal .crm-treatment-view > .collapsible-section > .section-content,
#viewTreatmentModal .modal-body-custom > .collapsible-section > .section-content,
#editTreatmentModal .modal-body-custom > .collapsible-section > .section-content,
#addTreatmentModal .modal-body-custom > .collapsible-section > .section-content,
#editTreatmentModal .crm-treatment-form > .collapsible-section > .section-content,
#addTreatmentModal .crm-treatment-form > .collapsible-section > .section-content {
    display: block !important;
    max-height: 0 !important;
    overflow: hidden !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    opacity: 0;
    box-sizing: border-box;
    transition: max-height 0.26s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.22s ease,
                padding 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

#viewTreatmentModal .crm-treatment-view > .collapsible-section.active > .section-content,
#editTreatmentModal .crm-treatment-view > .collapsible-section.active > .section-content,
#addTreatmentModal .crm-treatment-view > .collapsible-section.active > .section-content,
#viewTreatmentModal .modal-body-custom > .collapsible-section.active > .section-content,
#editTreatmentModal .modal-body-custom > .collapsible-section.active > .section-content,
#addTreatmentModal .modal-body-custom > .collapsible-section.active > .section-content,
#editTreatmentModal .crm-treatment-form > .collapsible-section.active > .section-content,
#addTreatmentModal .crm-treatment-form > .collapsible-section.active > .section-content {
    max-height: 5000px !important;
    opacity: 1 !important;
    padding: 0.75rem 1.25rem 1.25rem !important;
}

#addTreatmentModalBody > .crm-treatment-context,
#addTreatmentModal .modal-body-custom > .crm-treatment-context {
    display: block;
    visibility: visible;
    opacity: 1;
}

#addTreatmentModal .crm-treatment-form > .collapsible-section > .section-header {
    background: #0f1e26 !important;
    border: 1px solid rgba(0, 186, 255, 0.28);
    border-radius: 8px 8px 0 0;
}

[data-bs-theme="light"] #addTreatmentModal .crm-treatment-form > .collapsible-section > .section-header {
    background: #e9ecef !important;
    border-color: rgba(13, 110, 253, 0.22);
}

#addTreatmentModal .crm-treatment-form > .collapsible-section:not(.active) > .section-header {
    border-radius: 8px;
    margin-bottom: 0.35rem;
}

#viewTreatmentModal .crm-treatment-view > .collapsible-section:not(.active) > .section-header,
#editTreatmentModal .crm-treatment-view > .collapsible-section:not(.active) > .section-header,
#addTreatmentModal .crm-treatment-view > .collapsible-section:not(.active) > .section-header,
#viewTreatmentModal .modal-body-custom > .collapsible-section:not(.active) > .section-header,
#editTreatmentModal .modal-body-custom > .collapsible-section:not(.active) > .section-header,
#addTreatmentModal .modal-body-custom > .collapsible-section:not(.active) > .section-header,
#editTreatmentModal .crm-treatment-form > .collapsible-section:not(.active) > .section-header,
#addTreatmentModal .crm-treatment-form > .collapsible-section:not(.active) > .section-header {
    border-bottom: none !important;
}

/* Expanded headers — no bright separator line above content */
#viewTreatmentModal .collapsible-section.active > .section-header,
#editTreatmentModal .collapsible-section.active > .section-header,
#addTreatmentModal .collapsible-section.active > .section-header,
#viewTreatmentModal .crm-treatment-view > .collapsible-section.active > .section-header,
#editTreatmentModal .crm-treatment-view > .collapsible-section.active > .section-header,
#addTreatmentModal .crm-treatment-view > .collapsible-section.active > .section-header,
#viewTreatmentModal .modal-body-custom > .collapsible-section.active > .section-header,
#editTreatmentModal .modal-body-custom > .collapsible-section.active > .section-header,
#addTreatmentModal .modal-body-custom > .collapsible-section.active > .section-header,
#editTreatmentModal .crm-treatment-form > .collapsible-section.active > .section-header,
#addTreatmentModal .crm-treatment-form > .collapsible-section.active > .section-header {
    border-bottom: none !important;
    box-shadow: none !important;
}

#viewTreatmentModal .collapsible-section.active > .section-content,
#editTreatmentModal .collapsible-section.active > .section-content,
#addTreatmentModal .collapsible-section.active > .section-content,
#viewTreatmentModal .crm-treatment-view > .collapsible-section.active > .section-content,
#editTreatmentModal .crm-treatment-view > .collapsible-section.active > .section-content,
#addTreatmentModal .crm-treatment-view > .collapsible-section.active > .section-content,
#editTreatmentModal .crm-treatment-form > .collapsible-section.active > .section-content,
#addTreatmentModal .crm-treatment-form > .collapsible-section.active > .section-content {
    border-top: none !important;
}

.crm-treatment-modal .modal-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
}

[data-bs-theme="light"] .crm-treatment-modal .modal-title {
    color: #000000b9;
}

.crm-treatment-modal .btn-close {
    filter: invert(1);
    opacity: 0.7;
}

[data-bs-theme="light"] .crm-treatment-modal .btn-close {
    filter: none;
    opacity: 1;
}

.crm-treatment-modal .btn-close:hover {
    opacity: 1;
}

.crm-treatment-modal .btn-close:focus,
.crm-treatment-modal .btn-close:focus-visible,
.crm-treatment-modal .btn-close:active {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
}

/* Context bar — patient / treatment meta (add, edit, view) */
.crm-treatment-context {
    background: rgba(0, 186, 255, 0.06);
    border: 1px solid rgba(0, 186, 255, 0.22);
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
}

.crm-treatment-modal .crm-treatment-context {
    margin-top: 0.75rem;
}

[data-bs-theme="light"] .crm-treatment-context {
    background: rgba(13, 110, 253, 0.05);
    border-color: rgba(13, 110, 253, 0.18);
}

.crm-treatment-context__grid {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.65rem 1.25rem;
}

.crm-treatment-context__item {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: flex-start;
    gap: 0.2rem;
    min-width: 0;
    flex: 1 1 9rem;
}

.crm-treatment-context__item--primary {
    flex: 2 1 14rem;
}

.crm-treatment-context__label {
    display: block;
    flex: 0 0 auto;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(0, 186, 255, 0.85);
    line-height: 1.2;
}

[data-bs-theme="light"] .crm-treatment-context__label {
    color: rgba(13, 110, 253, 0.75);
}

.crm-treatment-context__value {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 2rem;
    font-size: 1rem;
    font-weight: 600;
    color: #f1f5f9;
    line-height: 1.35;
    word-break: break-word;
}

[data-bs-theme="light"] .crm-treatment-context__value {
    color: #1e293b;
}

.crm-treatment-context__item--primary .crm-treatment-context__value {
    min-width: 0;
}

@media (min-width: 768px) {
    .crm-treatment-context__grid {
        flex-wrap: nowrap;
        gap: 0.75rem 1.5rem;
    }

    .crm-treatment-context__item:not(:last-child) {
        padding-right: 1.5rem;
        border-right: 1px solid rgba(255, 255, 255, 0.1);
    }

    [data-bs-theme="light"] .crm-treatment-context__item:not(:last-child) {
        border-right-color: rgba(0, 0, 0, 0.08);
    }

    .crm-treatment-context__item--primary {
        flex: 1.25 1 0;
    }

    .crm-treatment-context__item--priority {
        flex: 0 0 auto;
        min-width: 0;
        width: max-content;
        max-width: 6.75rem;
    }

    .crm-treatment-context__item--priority:has(.crm-treatment-context__priority-badges) {
        max-width: none;
        min-width: 15.5rem;
    }

    .crm-treatment-context__item--id-req {
        flex: 0 0 auto;
        width: max-content;
    }

    .crm-treatment-context__item--expense-coverage {
        flex: 1.5 1 0;
        min-width: 0;
    }

    /* View treatment — only patient name grows; meta columns fit content */
    .crm-treatment-context__grid--view {
        display: grid;
        grid-template-columns: minmax(0, 1fr) max-content max-content;
        column-gap: 1rem;
        row-gap: 0;
        align-items: stretch;
    }

    .crm-treatment-context__grid--view-id {
        grid-template-columns: minmax(0, 1fr) max-content max-content max-content;
    }

    .crm-treatment-context__grid--view .crm-treatment-context__item {
        flex: unset;
        min-width: 0;
        max-width: none;
        width: auto;
    }

    .crm-treatment-context__grid--view .crm-treatment-context__item:not(:last-child) {
        padding-right: 1rem;
    }

    .crm-treatment-context__grid--view .crm-treatment-context__item--primary .crm-treatment-context__value {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

    .crm-treatment-context__grid--view .crm-treatment-context__item--id-req,
    .crm-treatment-context__grid--view .crm-treatment-context__item--priority {
        min-width: max-content;
    }

    .crm-treatment-context__grid--view .crm-treatment-context__item--expense-coverage .crm-treatment-context__value {
        justify-content: flex-start;
    }
}

.crm-coverage-flow {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.35rem;
    white-space: nowrap;
    line-height: 1.35;
}

.crm-treatment-context__item--expense-coverage .crm-treatment-context__value {
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
}

.crm-coverage-flow__category,
.crm-coverage-flow__rate,
.crm-coverage-flow__amount,
.crm-coverage-flow__sep {
    line-height: 1.35;
}

.crm-coverage-flow__category {
    font-weight: 600;
    color: #7dd3fc;
}

.crm-coverage-flow__rate,
.crm-coverage-flow__amount {
    font-weight: 600;
    color: #f1f5f9;
}

.crm-coverage-flow__sep {
    color: rgba(125, 211, 252, 0.55);
    font-weight: 700;
}

[data-bs-theme="light"] .crm-coverage-flow__category {
    color: #0369a1;
}

[data-bs-theme="light"] .crm-coverage-flow__rate,
[data-bs-theme="light"] .crm-coverage-flow__amount {
    color: #1e293b;
}

[data-bs-theme="light"] .crm-coverage-flow__sep {
    color: #7dd3fc;
}

/* Priority in context bar */
.crm-treatment-modal .crm-treatment-context__item--priority {
    gap: 0.5rem;
}

.crm-treatment-modal .crm-treatment-context__priority-badges {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.crm-treatment-modal .crm-treatment-context__priority-badges .priority-badge-option,
.crm-treatment-modal .crm-treatment-context__item--priority .badge-pill {
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
    cursor: pointer;
    padding: 0.45rem 0.85rem;
    min-height: 2rem;
    font-size: 0.75rem;
    line-height: 1.25;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.crm-treatment-modal .crm-treatment-context__item--priority .crm-treatment-context__value {
    font-weight: 400;
    overflow: visible;
}

.crm-treatment-modal .crm-treatment-context__priority-badges .priority-radio:checked + .priority-badge-option {
    transform: none;
}

.crm-treatment-modal .crm-treatment-context__priority-badges .priority-badge-option:hover {
    transform: none;
}

/* Form fields — match conversation modal inputs */
.crm-treatment-modal .form-control,
.crm-treatment-modal .form-select,
.crm-treatment-modal textarea.form-control {
    background: #172635 !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    color: #e2e8f0 !important;
    border-radius: 6px;
    font-size: 0.9375rem;
}

.crm-treatment-modal input.form-control:not([type="checkbox"]):not([type="radio"]):not(.form-control-sm),
.crm-treatment-modal select.form-control:not(.form-control-sm),
.crm-treatment-modal select.form-select:not(.form-select-sm) {
    padding: 0.65rem 0.9rem;
    min-height: 2.75rem;
    line-height: 1.4;
}

[data-bs-theme="light"] .crm-treatment-modal .form-control,
[data-bs-theme="light"] .crm-treatment-modal .form-select,
[data-bs-theme="light"] .crm-treatment-modal textarea.form-control {
    background: #fbfbfb !important;
    border-color: #c8c8c8 !important;
    color: #1f2937 !important;
}

.crm-treatment-modal .form-control:focus,
.crm-treatment-modal .form-select:focus,
.crm-treatment-modal textarea.form-control:focus {
    border-color: #00baff !important;
    box-shadow: 0 0 0 0.15rem rgba(0, 186, 255, 0.2) !important;
    color: #fff !important;
}

[data-bs-theme="light"] .crm-treatment-modal .form-control:focus,
[data-bs-theme="light"] .crm-treatment-modal .form-select:focus,
[data-bs-theme="light"] .crm-treatment-modal textarea.form-control:focus {
    color: #1f2937 !important;
}

/* Disease section — coverage row + complaints */
.crm-treatment-modal .crm-treatment-disease-coverage__value {
    min-height: 2.375rem;
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: #e2e8f0;
    word-break: break-word;
    background: #172635;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
}

[data-bs-theme="light"] .crm-treatment-modal .crm-treatment-disease-coverage__value {
    color: #1f2937;
    background: #fbfbfb;
    border-color: #c8c8c8;
}

.crm-treatment-modal .crm-treatment-disease-coverage__field.ec-field-disabled .form-label {
    opacity: 0.55;
}

.crm-treatment-modal .crm-treatment-disease-coverage__field.ec-field-disabled .form-control:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-bs-theme="light"] .crm-treatment-modal .crm-treatment-disease-coverage__field.ec-field-disabled .form-control:disabled {
    background: #e9ecef;
    border-color: #dee2e6;
}

.crm-treatment-modal .crm-treatment-disease__complaints-value {
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: #172635;
    color: #e2e8f0;
    font-size: 0.9375rem;
    line-height: 1.55;
    min-height: 5.5rem;
    white-space: pre-wrap;
    word-break: break-word;
}

[data-bs-theme="light"] .crm-treatment-modal .crm-treatment-disease__complaints-value {
    background: #fbfbfb;
    border-color: #c8c8c8;
    color: #1f2937;
}

.crm-treatment-modal .crm-treatment-disease__complaints-input {
    min-height: 5.5rem;
    resize: vertical;
}

/* Add treatment — complaints + medical reports (parity with email accordion row) */
@media (min-width: 768px) {
    .crm-treatment-modal .crm-treatment-disease-add-pair {
        align-items: stretch;
    }

    .crm-treatment-modal .crm-treatment-disease-add-complaints,
    .crm-treatment-modal .crm-treatment-disease-add-docs {
        display: flex;
        flex-direction: column;
        min-height: 12.5rem;
        min-width: 0;
    }

    .crm-treatment-modal .crm-treatment-disease-add-complaints__label {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        flex: 0 0 auto;
        min-height: 2.45rem;
        margin-bottom: 0;
        font-weight: 600;
        font-size: 0.8125rem;
    }

    .crm-treatment-modal .crm-treatment-disease-add-complaints__field {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .crm-treatment-modal .crm-treatment-disease-add-docs .crm-treatment-doc-field {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .crm-treatment-modal .crm-treatment-disease-add-docs .crm-treatment-doc-card {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
    }

    .crm-treatment-modal .crm-treatment-disease-add-complaints .crm-treatment-disease__complaints-input {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
    }
}

.crm-treatment-modal .crm-treatment-disease-add-complaints .crm-treatment-disease__complaints-input {
    min-height: 9rem;
}

.crm-treatment-modal .modal-footer.custom-modal-footer {
    background: #08151d !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #e2e8f0 !important;
    padding: 1rem 2rem;
    gap: 0.6rem;
    justify-content: flex-end;
    min-height: 3.25rem;
    flex: 0 0 auto;
}

.crm-treatment-modal .modal-footer.custom-modal-footer.crm-modal-footer-pending {
    visibility: hidden;
    pointer-events: none;
}

[data-bs-theme="light"] .crm-treatment-modal .modal-footer.custom-modal-footer {
    background: #f0f0f0 !important;
    color: #212529 !important;
    border-top: 1px solid #e9ecef !important;
}

.crm-treatment-modal .modal-footer .crm-modal-footer-edit-btn,
.crm-treatment-modal .modal-footer .btn-update-treatment,
.crm-treatment-modal .modal-footer .btn-save-treatment {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    width: auto !important;
    min-width: 0 !important;
    flex: 0 0 auto;
    background: linear-gradient(145deg, #00baff, #0077cc) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 500;
    border-radius: 5px;
    padding: 0.5rem 1.25rem;
    box-shadow: 0 0 10px rgba(0, 186, 255, 0.4);
}

.crm-treatment-modal .modal-footer .crm-modal-footer-edit-btn > i,
.crm-treatment-modal .modal-footer .btn-update-treatment > i,
.crm-treatment-modal .modal-footer .btn-save-treatment > i {
    margin: 0 !important;
    flex-shrink: 0;
}

.crm-treatment-modal .modal-footer .crm-modal-footer-edit-btn:hover,
.crm-treatment-modal .modal-footer .btn-update-treatment:hover,
.crm-treatment-modal .modal-footer .btn-save-treatment:hover {
    transform: scale(1.03);
    color: #fff !important;
    box-shadow: 0 0 20px rgba(0, 186, 255, 0.6);
}

.crm-treatment-modal .modal-footer .btn-delete {
    color: #dc3545 !important;
    border: 1px solid #dc3545 !important;
    background: rgba(220, 53, 69, 0.05) !important;
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.15);
    font-weight: 500;
    border-radius: 5px;
    padding: 0.5rem 1.25rem;
}

.crm-treatment-modal .modal-footer .btn-delete:hover {
    background-color: #dc3545 !important;
    color: #fff !important;
}

.crm-treatment-modal .view-treatment-modal-email-actions .btn {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
    white-space: nowrap;
    width: auto;
    color: #00baff;
    background: rgba(0, 186, 255, 0.05);
    box-shadow: 0 0 10px rgba(0, 186, 255, 0.25);
    font-weight: 500;
    border-color: #00baff !important;
    border-radius: 6px;
    transition: all 0.18s cubic-bezier(.4, 2, .6, 1);
}

.crm-treatment-modal .view-treatment-modal-email-actions .btn > i {
    color: #00baff;
}

.crm-treatment-modal .view-treatment-modal-email-actions .btn:hover {
    transform: scale(1.05) !important;
    color: white !important;
    background-color: #00baff !important;
    text-decoration: none !important;
    box-shadow: 0 0 20px rgba(0, 186, 255, 0.6), 0 0 40px rgba(0, 186, 255, 0.3) !important;
}

@media (min-width: 576px) {
    .crm-treatment-modal .view-treatment-modal-email-actions {
        flex-direction: row !important;
        justify-content: flex-end !important;
    }

    .crm-treatment-modal .view-treatment-modal-email-actions .btn {
        width: auto;
        margin-bottom: 0;
    }
}

.crm-treatment-modal .view-treatment-modal-email-actions {
    width: 100%;
    justify-content: flex-end;
}

/* Email section — description label above field; doc card keeps its own header */
@media (min-width: 768px) {
    .crm-treatment-modal .crm-treatment-email {
        align-items: stretch;
    }

    .crm-treatment-modal .crm-treatment-email__desc,
    .crm-treatment-modal .crm-treatment-email__docs {
        display: flex;
        flex-direction: column;
        min-height: 12.5rem;
    }

    .crm-treatment-modal .crm-treatment-email__label {
        display: flex;
        align-items: center;
        gap: 0.35rem;
        flex: 0 0 auto;
        min-height: 2.45rem;
        margin-bottom: 0;
        font-weight: 600;
        font-size: 0.8125rem;
    }

    .crm-treatment-modal .crm-treatment-email__field {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .crm-treatment-modal .crm-treatment-email__docs .crm-treatment-doc-field {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }

    .crm-treatment-modal .crm-treatment-email__docs .crm-treatment-doc-card {
        flex: 1 1 auto;
        height: 100%;
        min-height: 12.5rem;
    }
}

.crm-treatment-modal .crm-treatment-email__description-value {
    padding: 0.65rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 6px;
    background: #172635;
    color: #e2e8f0;
    font-size: 0.9375rem;
    line-height: 1.55;
    min-height: 9rem;
    white-space: pre-wrap;
    word-break: break-word;
}

/* View modal — blue tile-style readonly values (layout unchanged) */
.crm-treatment-view-value {
    display: flex;
    align-items: center;
    min-height: calc(1.5em + 1rem + 2px);
    padding: 0.5rem 0.85rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 186, 255, 0.08) 0%, rgba(15, 23, 42, 0.55) 70%);
    border: 1px solid rgba(0, 186, 255, 0.28);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    color: #f1f5f9;
    word-break: break-word;
}

[data-bs-theme="light"] .crm-treatment-view-value {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.06) 0%, #f8fafc 85%);
    border-color: rgba(13, 110, 253, 0.22);
    color: #1e293b;
}

.crm-treatment-view-prose {
    flex: 1 1 auto;
    min-height: 9rem;
    margin-bottom: 0;
}

.crm-treatment-view-currency-group {
    width: 100%;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
}

.crm-treatment-view-currency-group > .crm-treatment-view-value,
.crm-treatment-view-currency-group > .crm-treatment-view-value--fill,
#viewTreatmentModal .crm-treatment-view-currency-group > .crm-treatment-view-value,
#viewTreatmentModal .crm-treatment-view-currency-group > .crm-treatment-view-value--fill {
    flex: 1 1 auto;
    min-width: 0;
    margin-top: 0 !important;
    align-self: stretch;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}

.crm-treatment-view-currency-group > .input-group-text,
#viewTreatmentModal .crm-treatment-view-currency-group > .input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    height: auto !important;
    min-height: calc(1.5em + 1rem + 2px);
    margin: 0;
    padding: 0.5rem 0.85rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.35;
    box-sizing: border-box;
    border-radius: 0 14px 14px 0;
    border: 1px solid rgba(0, 186, 255, 0.28);
    background: linear-gradient(135deg, rgba(0, 186, 255, 0.12) 0%, rgba(15, 23, 42, 0.65) 85%);
    color: #f1f5f9;
}

[data-bs-theme="light"] .crm-treatment-view-currency-group > .input-group-text,
[data-bs-theme="light"] #viewTreatmentModal .crm-treatment-view-currency-group > .input-group-text {
    border-color: rgba(13, 110, 253, 0.22);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.08) 0%, #f1f5f9 90%);
    color: #1e293b;
}

/* Edit/Add — currency addon matches adjacent form-controls, not view tiles */
.crm-treatment-modal .crm-treatment-currency-group:not(.crm-treatment-view-currency-group) {
    width: 100%;
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: stretch !important;
}

.crm-treatment-modal .crm-treatment-currency-group:not(.crm-treatment-view-currency-group) > .form-control {
    flex: 1 1 auto;
    min-width: 0;
    border-top-right-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

.crm-treatment-modal .crm-treatment-currency-group:not(.crm-treatment-view-currency-group) > .input-group-text,
#editTreatmentModal .crm-treatment-currency-group:not(.crm-treatment-view-currency-group) > .input-group-text,
#addTreatmentModal .crm-treatment-currency-group:not(.crm-treatment-view-currency-group) > .input-group-text {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    height: auto !important;
    min-height: 2.75rem;
    margin: 0;
    padding: 0.65rem 0.9rem;
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.4;
    box-sizing: border-box;
    border-radius: 0 6px 6px 0;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: #172635 !important;
    color: #e2e8f0;
}

.crm-treatment-modal .crm-treatment-currency-group:not(.crm-treatment-view-currency-group):focus-within > .form-control,
.crm-treatment-modal .crm-treatment-currency-group:not(.crm-treatment-view-currency-group):focus-within > .input-group-text {
    border-color: #00baff !important;
}

[data-bs-theme="light"] .crm-treatment-modal .crm-treatment-currency-group:not(.crm-treatment-view-currency-group) > .input-group-text,
[data-bs-theme="light"] #editTreatmentModal .crm-treatment-currency-group:not(.crm-treatment-view-currency-group) > .input-group-text,
[data-bs-theme="light"] #addTreatmentModal .crm-treatment-currency-group:not(.crm-treatment-view-currency-group) > .input-group-text {
    border-color: #c8c8c8;
    background: #fbfbfb !important;
    color: #1e293b;
}

[data-bs-theme="light"] .crm-treatment-modal .crm-treatment-currency-group:not(.crm-treatment-view-currency-group):focus-within > .form-control,
[data-bs-theme="light"] .crm-treatment-modal .crm-treatment-currency-group:not(.crm-treatment-view-currency-group):focus-within > .input-group-text {
    border-color: #0d6efd !important;
}

[data-bs-theme="light"] .crm-treatment-modal .crm-treatment-email__description-value {
    background: #fbfbfb;
    border-color: #c8c8c8;
    color: #1f2937;
}

@media (min-width: 768px) {
    .crm-treatment-modal .crm-treatment-email__description-value,
    .crm-treatment-modal .crm-treatment-email__description-input,
    .crm-treatment-modal .crm-treatment-view-prose {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
    }
}

.crm-treatment-modal .crm-treatment-email__description-input {
    min-height: 9rem;
    resize: vertical;
}

.crm-treatment-modal .spinner-border {
    width: 2.5rem;
    height: 2.5rem;
}

.crm-treatment-modal .crm-request-transfer-btn,
.crm-treatment-modal .crm-request-transfer-btn:disabled {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    width: auto;
    min-height: 0;
    padding: 0.4rem 0.85rem;
    font-size: 0.875rem;
    line-height: 1.2;
    color: #00baff;
    background: rgba(0, 186, 255, 0.08);
    border: 1px solid #00baff;
    border-radius: 6px;
    box-shadow: none;
    opacity: 1;
}

.crm-treatment-modal .crm-request-transfer-btn:disabled {
    opacity: 0.85;
}

.crm-treatment-modal .crm-request-transfer-btn .crm-request-transfer-spinner {
    width: 0.85rem;
    height: 0.85rem;
    border: 2px solid rgba(0, 186, 255, 0.35);
    border-top-color: #00baff;
    border-radius: 50%;
    display: inline-block;
    flex: 0 0 auto;
    animation: crm-request-transfer-spin 0.7s linear infinite;
}

@keyframes crm-request-transfer-spin {
    to { transform: rotate(360deg); }
}

.crm-treatment-modal .btn-remove,
.crm-treatment-form .btn-remove {
    color: #dc3545;
    border: 1px solid #dc3545;
    background: rgba(220, 53, 69, 0.05);
    box-shadow: 0 0 10px rgba(220, 53, 69, 0.15);
}

/* Document cards — shared stretch + drop zone fill (disease grid, email, travel, patient docs) */
.crm-treatment-modal .crm-treatment-docs-grid,
.crm-treatment-modal .crm-treatment-email,
.patient-info-grid.add-patient-documents-row {
    align-items: stretch;
}

.crm-treatment-modal .crm-treatment-docs-grid {
    grid-column: 1 / -1;
    width: 100%;
}

.crm-treatment-modal .crm-treatment-docs-grid .crm-treatment-doc-field,
.crm-treatment-modal .crm-treatment-email__docs .crm-treatment-doc-field,
.crm-treatment-modal .crm-treatment-travel-block .crm-treatment-doc-field,
.add-patient-documents-row .crm-doc-card-ui .crm-treatment-doc-field {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.crm-treatment-modal .crm-treatment-docs-grid .crm-treatment-doc-card,
.crm-treatment-modal .crm-treatment-email__docs .crm-treatment-doc-card,
.crm-treatment-modal .crm-treatment-travel-block .crm-treatment-doc-card,
.add-patient-documents-row .crm-doc-card-ui .crm-treatment-doc-card {
    flex: 1 1 auto;
    height: 100%;
    min-height: 12.5rem;
}

.crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__body--editable {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 9rem;
}

.crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop] {
    flex: 1 1 auto;
    min-height: 6.5rem;
    height: 100%;
    padding: 0.45rem;
    border: 1px dashed rgba(0, 186, 255, 0.35);
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.crm-doc-card-ui .crm-treatment-doc-card--editable:not(.crm-treatment-doc-card--has-files) .crm-treatment-doc-card__files-area[data-add-patient-file-drop] {
    padding: 0;
    gap: 0;
}

.crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop]:hover,
.crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop].is-dragover {
    border-color: #00baff;
    background: rgba(0, 186, 255, 0.06);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop] {
    border-color: rgba(13, 110, 253, 0.32);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop]:hover,
[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop].is-dragover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.06);
}

.crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area .crm-treatment-doc-card__empty-slot {
    flex: 1 1 auto;
    min-height: 6.5rem;
    width: 100%;
    align-self: stretch;
    margin: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    padding: 0.75rem;
    box-sizing: border-box;
}

.crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area:hover .crm-treatment-doc-card__empty-slot,
.crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area.is-dragover .crm-treatment-doc-card__empty-slot {
    border: none;
    background: transparent;
}

.crm-doc-card-ui .crm-treatment-doc-card--has-files .crm-treatment-doc-card__empty-slot {
    display: none !important;
}

/* With files: dashed border hugs thumbnails; empty cards still stretch to row height */
.crm-doc-card-ui .crm-treatment-doc-card--has-files.crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop] {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    align-self: flex-start;
    width: 100%;
}

/* After last file is removed, restore full drop zone even if JS class lags */
.crm-doc-card-ui .crm-treatment-doc-card--has-files.crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop]:not(:has(.file-item)) {
    flex: 1 1 auto;
    height: 100%;
    min-height: 6.5rem;
    align-self: stretch;
}

.crm-doc-card-ui .crm-treatment-doc-card--has-files .crm-treatment-doc-card__files-area[data-add-patient-file-drop]:not(:has(.file-item)) .crm-treatment-doc-card__empty-slot {
    display: flex !important;
}

.crm-doc-card-ui .crm-treatment-doc-card--has-files .crm-treatment-doc-card__grid {
    flex: 0 0 auto;
}

.crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop].is-dragover {
    outline: none;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-remove {
    z-index: 3;
    pointer-events: auto;
}

.crm-doc-card-ui .crm-treatment-doc-field {
    min-width: 0;
}

.crm-doc-card-ui .crm-treatment-existing-docs {
    margin-top: 0;
}

/* Document cards — view + edit */
.crm-doc-card-ui .crm-treatment-doc-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 12.5rem;
    border: 1px solid rgba(0, 186, 255, 0.28);
    border-radius: 10px;
    background: linear-gradient(160deg, rgba(0, 186, 255, 0.07) 0%, rgba(0, 0, 0, 0.12) 100%);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card {
    border-color: rgba(13, 110, 253, 0.22);
    background: linear-gradient(160deg, rgba(13, 110, 253, 0.06) 0%, #fff 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.crm-doc-card-ui .crm-treatment-doc-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem;
    min-height: 2.45rem;
    box-sizing: border-box;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.18);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__header {
    border-bottom-color: rgba(0, 0, 0, 0.06);
    background: rgba(13, 110, 253, 0.05);
}

.crm-doc-card-ui .crm-treatment-doc-card__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    min-width: 0;
    font-weight: 700;
    font-size: 0.8125rem;
    color: #f8fafc;
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__title {
    color: #1e293b;
}

.crm-doc-card-ui .crm-treatment-doc-card__title > i {
    color: #00baff;
    font-size: 0.95rem;
    flex-shrink: 0;
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__title > i {
    color: #0d6efd;
}

.crm-doc-card-ui .crm-treatment-doc-card__name {
    line-height: 1.25;
}

.crm-doc-card-ui .crm-treatment-doc-card__count {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    background: rgba(0, 186, 255, 0.14);
    color: #7dd3fc;
    white-space: nowrap;
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__count {
    background: rgba(13, 110, 253, 0.12);
    color: #2563eb;
}

.crm-doc-card-ui .crm-treatment-doc-card__actions {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-shrink: 0;
}

.crm-doc-card-ui .patient-field .crm-treatment-doc-card__upload {
    margin-bottom: 0;
}

.crm-doc-card-ui .crm-treatment-doc-card__upload {
    position: relative;
    box-sizing: border-box;
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    height: 2rem;
    min-height: 2rem;
    max-height: 2rem;
    padding: 0 0.6rem;
    margin: 0;
    border-radius: 6px;
    border: 1px dashed rgba(0, 186, 255, 0.4);
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    text-align: left;
    font-weight: 600;
    transition: border-color 0.15s ease, background 0.15s ease;
    appearance: none;
    -webkit-appearance: none;
}

.crm-doc-card-ui .crm-treatment-doc-card__upload:hover,
.crm-doc-card-ui .crm-treatment-doc-card__upload.is-dragover {
    border-color: #00baff;
    background: rgba(0, 186, 255, 0.06);
}

.crm-doc-card-ui .crm-treatment-doc-card__upload .add-patient-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.crm-doc-card-ui .crm-treatment-doc-card__upload-inner {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    pointer-events: none;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    color: rgba(255, 255, 255, 0.85);
}

.crm-doc-card-ui .crm-treatment-doc-card__upload-inner i {
    font-size: 0.8rem;
    color: #00baff;
}

.crm-doc-card-ui .crm-treatment-doc-card__upload:hover .crm-treatment-doc-card__upload-inner,
.crm-doc-card-ui .crm-treatment-doc-card__upload.is-dragover .crm-treatment-doc-card__upload-inner {
    color: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__upload {
    border-color: rgba(13, 110, 253, 0.4);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__upload:hover,
[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__upload.is-dragover {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.06);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__upload-inner {
    color: #475569;
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__upload-inner i {
    color: #0d6efd;
}

.crm-doc-card-ui .crm-treatment-doc-card__download {
    box-sizing: border-box;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0;
    width: auto;
    max-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(0, 186, 255, 0.35);
    background: rgba(0, 186, 255, 0.08);
    color: #00baff;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    line-height: 1;
    overflow: hidden;
    white-space: nowrap;
    transition:
        max-width 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        padding 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        gap 0.45s cubic-bezier(0.4, 0, 0.2, 1),
        background 0.25s ease,
        color 0.25s ease,
        border-color 0.25s ease;
}

.crm-doc-card-ui .crm-treatment-doc-card__download:hover,
.crm-doc-card-ui .crm-treatment-doc-card__download:focus-visible {
    max-width: 13rem;
    padding: 0.35rem 0.65rem;
    gap: 0.4rem;
    background: #00baff;
    border-color: #00baff;
    color: #fff;
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__download {
    color: #0d6efd;
    border-color: rgba(13, 110, 253, 0.35);
    background: rgba(13, 110, 253, 0.06);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__download:hover,
[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__download:focus-visible {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.crm-doc-card-ui .crm-treatment-doc-card__download-text {
    display: inline-block;
    opacity: 0;
    font-size: 0.75rem;
    transition: opacity 0.3s ease 0.08s;
}

.crm-doc-card-ui .crm-treatment-doc-card__download:hover .crm-treatment-doc-card__download-text,
.crm-doc-card-ui .crm-treatment-doc-card__download:focus-visible .crm-treatment-doc-card__download-text {
    opacity: 1;
    transition-delay: 0.12s;
}

.crm-doc-card-ui .crm-treatment-doc-card__body {
    padding: 0.75rem;
    flex: 1 1 auto;
    min-height: 9rem;
    display: flex;
    flex-direction: column;
}

.crm-doc-card-ui .crm-treatment-doc-card__body--editable {
    gap: 0;
}

.crm-doc-card-ui .crm-treatment-doc-card__files-area {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    min-height: 6.5rem;
    position: relative;
}

.crm-doc-card-ui .crm-treatment-doc-card__files-area[data-add-patient-file-drop] {
    cursor: pointer;
}

.crm-doc-card-ui .crm-treatment-doc-card__files-area[data-add-patient-file-drop] .add-patient-file-input {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.crm-doc-card-ui .crm-treatment-doc-card__files-area[data-add-patient-file-drop].is-dragover {
    outline: 2px dashed rgba(0, 186, 255, 0.65);
    outline-offset: -3px;
    background: rgba(0, 186, 255, 0.05);
    border-radius: 6px;
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__files-area[data-add-patient-file-drop].is-dragover {
    outline-color: rgba(13, 110, 253, 0.55);
    background: rgba(13, 110, 253, 0.05);
}

.crm-doc-card-ui .crm-treatment-doc-card__files-area .crm-treatment-doc-card__grid + .crm-treatment-doc-card__grid {
    margin-top: 0;
}

.crm-doc-card-ui .crm-treatment-doc-card__empty-slot {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    min-height: 6.5rem;
    padding: 0.75rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.8rem;
    border: 1px dashed rgba(0, 186, 255, 0.35);
    border-radius: 8px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.crm-doc-card-ui .crm-treatment-doc-card__drop-icon {
    font-size: 1.5rem;
    color: #00baff;
    opacity: 0.9;
}

.crm-doc-card-ui .crm-treatment-doc-card__drop-title {
    font-weight: 600;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.82);
}

.crm-doc-card-ui .crm-treatment-doc-card__drop-hint {
    font-size: 0.72rem;
    line-height: 1.35;
    max-width: 14rem;
}

.crm-doc-card-ui .crm-treatment-doc-card__files-area[data-add-patient-file-drop]:hover .crm-treatment-doc-card__empty-slot,
.crm-doc-card-ui .crm-treatment-doc-card__files-area[data-add-patient-file-drop].is-dragover .crm-treatment-doc-card__empty-slot {
    border-color: #00baff;
    background: rgba(0, 186, 255, 0.06);
    color: rgba(255, 255, 255, 0.65);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__empty-slot {
    color: #64748b;
    border-color: rgba(13, 110, 253, 0.32);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__drop-icon {
    color: #0d6efd;
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__drop-title {
    color: #334155;
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__files-area[data-add-patient-file-drop]:hover .crm-treatment-doc-card__empty-slot,
[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__files-area[data-add-patient-file-drop].is-dragover .crm-treatment-doc-card__empty-slot {
    border-color: #0d6efd;
    background: rgba(13, 110, 253, 0.06);
}

.crm-doc-card-ui .crm-treatment-doc-card__files-area:has(.file-item) .crm-treatment-doc-card__empty-slot,
.crm-doc-card-ui .crm-treatment-doc-card__files-area:has(.edit-patient-existing-docs) .crm-treatment-doc-card__empty-slot {
    display: none;
}

/* Empty file grid must not steal flex height from the drop hint */
.crm-doc-card-ui .crm-treatment-doc-card__grid:not(:has(.file-item)) {
    display: none;
    flex: 0 0 0;
    min-height: 0;
    margin: 0;
    padding: 0;
}

/* Editable cards: hover highlight on outer outline only, not a shorter inner box */
.crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop]:hover .crm-treatment-doc-card__empty-slot,
.crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop].is-dragover .crm-treatment-doc-card__empty-slot {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.65);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop]:hover .crm-treatment-doc-card__empty-slot,
[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card--editable .crm-treatment-doc-card__files-area[data-add-patient-file-drop].is-dragover .crm-treatment-doc-card__empty-slot {
    border: none;
    background: transparent;
    color: #64748b;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.55rem;
    width: 100%;
    flex: 1 1 auto;
    align-content: start;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-thumb {
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    border-radius: 6px;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-thumb-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Travel tickets — full-width card: 6 cols = same thumb cells as disease half-width 3 cols */
.crm-treatment-travel-block .crm-treatment-doc-card__grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 767.98px) {
    .crm-treatment-travel-block .crm-treatment-doc-card__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.crm-treatment-travel-block .crm-treatment-doc-card {
    min-height: 0;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-file {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    padding: 0.4rem 0.35rem;
    border-radius: 6px;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-file-link {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    text-align: center;
    font-size: 0.68rem;
    line-height: 1.15;
    width: 100%;
    min-height: 0;
    min-width: 0;
    padding: 0.15rem 0.2rem 0.25rem;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-file-link i {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
    opacity: 0.92;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-file-link .fa-file-pdf {
    color: #e74c3c;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-file-link .fa-file-word {
    color: #2b579a;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-file-link .fa-file-excel {
    color: #217346;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-file-link .fa-file-powerpoint {
    color: #d24726;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-file-link .fa-file-archive {
    color: #c9a227;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-file-link span {
    width: 100%;
    white-space: normal;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-remove {
    width: 1.25rem;
    height: 1.25rem;
    font-size: 0.85rem;
}

.crm-doc-card-ui .crm-treatment-doc-card__grid .edit-patient-doc-file .edit-patient-doc-remove--inline {
    position: absolute;
    top: 4px;
    right: 4px;
}

.crm-doc-card-ui .crm-treatment-doc-card__empty-slot--readonly {
    cursor: default;
    pointer-events: none;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.08);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__empty-slot--readonly {
    border-color: rgba(0, 0, 0, 0.08);
    background: rgba(0, 0, 0, 0.02);
}

.crm-doc-card-ui .crm-treatment-doc-card__empty-slot--readonly .crm-treatment-doc-card__drop-title {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.5);
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card__empty-slot--readonly .crm-treatment-doc-card__drop-title {
    color: #94a3b8;
}

/* Patient modal — personal documents card matches comments column height */
#editPatientModalBody .add-patient-documents-row .crm-doc-card-ui .crm-treatment-doc-field,
#addPatientModal .add-patient-documents-row .crm-doc-card-ui .crm-treatment-doc-field,
#addPatientModalIndex .add-patient-documents-row .crm-doc-card-ui .crm-treatment-doc-field,
.view-patient-container .add-patient-documents-row .crm-doc-card-ui .crm-treatment-doc-field,
#viewPatientModalBody .add-patient-documents-row .crm-doc-card-ui .crm-treatment-doc-field {
    min-height: 12.5rem;
}

#editPatientModalBody .add-patient-documents-row .crm-doc-card-ui .crm-treatment-doc-card,
#addPatientModal .add-patient-documents-row .crm-doc-card-ui .crm-treatment-doc-card,
#addPatientModalIndex .add-patient-documents-row .crm-doc-card-ui .crm-treatment-doc-card,
.view-patient-container .add-patient-documents-row .crm-doc-card-ui .crm-treatment-doc-card,
#viewPatientModalBody .add-patient-documents-row .crm-doc-card-ui .crm-treatment-doc-card {
    min-height: 12.5rem;
}

.crm-treatment-modal .btn-remove:hover,
.crm-treatment-form .btn-remove:hover {
    background-color: #dc3545 !important;
    box-shadow: 0 0 20px #dc3545, 0 0 40px rgba(220, 53, 69, 0.3) !important;
    color: white;
}

/* Follow Up — left column fields, impressions textarea matches stack height */
.crm-followup-layout {
    align-items: stretch;
}

.crm-followup-fields-column {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.crm-followup-field {
    min-width: 0;
}

.crm-followup-impressions-column {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.crm-followup-impressions-input {
    flex: 1 1 auto;
    min-height: 11.5rem;
    resize: vertical;
}

@media (min-width: 992px) {
    .crm-followup-impressions-input {
        min-height: 0;
        height: 100%;
    }
}

/* Hospital Evaluation — grouped sub-sections (Option A) */
.crm-hospital-eval {
    gap: 0.85rem;
}

.crm-hospital-eval__row {
    display: grid;
    gap: 1rem;
    align-items: stretch;
    min-width: 0;
}

.crm-hospital-eval__row--quad {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-hospital-eval__row--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.crm-hospital-eval__row--single {
    grid-template-columns: minmax(0, 1fr);
}

.crm-eval-picker.is-locked .crm-eval-picker__input:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.crm-hospital-eval__form-grid {
    margin-bottom: 0.15rem;
}

/* Searchable option pickers replacing the native selects */
.crm-eval-picker {
    position: relative;
    z-index: 1;
}

.crm-eval-picker__select {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: 0;
    border: 0;
    opacity: 0;
    pointer-events: none;
}

.crm-eval-picker__input {
    padding-right: 2.25rem;
    /* iOS zooms inputs under 16px and that breaks fixed dropdown positioning */
    font-size: 16px;
}

.crm-eval-picker__caret {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, color 0.15s ease;
}

.crm-eval-picker__caret:hover {
    color: rgba(255, 255, 255, 0.9);
}

.crm-eval-picker.is-open .crm-eval-picker__caret {
    color: #00baff;
    transform: rotate(180deg);
}

[data-bs-theme="light"] .crm-eval-picker__caret {
    color: #6c757d;
}

[data-bs-theme="light"] .crm-eval-picker.is-open .crm-eval-picker__caret {
    color: #0d6efd;
}

/* Baseline panel look for pages that do not load the patients list stylesheet */
.crm-eval-picker__panel {
    max-height: 220px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #1e2631;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 0.375rem;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
}

.crm-eval-picker__panel .suggestion {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    text-align: left;
    font: inherit;
    line-height: 1.3;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0, 186, 255, 0.2);
}

.crm-eval-picker--touch .crm-eval-picker__input {
    cursor: pointer;
    caret-color: transparent;
}

.crm-eval-picker__panel .suggestion.active,
.crm-eval-picker__panel .suggestion:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.crm-eval-picker__panel .suggestion.selected {
    font-weight: 600;
}

[data-bs-theme="light"] .crm-eval-picker__panel {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

[data-bs-theme="light"] .crm-eval-picker__panel .suggestion {
    color: #333;
}

[data-bs-theme="light"] .crm-eval-picker__panel .suggestion.active,
[data-bs-theme="light"] .crm-eval-picker__panel .suggestion:hover {
    background-color: rgba(13, 110, 253, 0.12);
}

.crm-hospital-eval__field-label {
    margin: 0.65rem 0 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f8fafc;
}

[data-bs-theme="light"] .crm-hospital-eval__field-label {
    color: #1e293b;
}

.crm-hospital-eval__prose {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 186, 255, 0.08) 0%, rgba(15, 23, 42, 0.55) 70%);
    border: 1px solid rgba(0, 186, 255, 0.28);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
    color: #f1f5f9;
    word-break: break-word;
    min-height: 3.25rem;
}

.crm-hospital-eval__prose--hospital {
    margin-bottom: 0.35rem;
}

[data-bs-theme="light"] .crm-hospital-eval__prose {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.06) 0%, #f8fafc 85%);
    border-color: rgba(13, 110, 253, 0.22);
    color: #1e293b;
}

.crm-hospital-eval__notes-input {
    margin-bottom: 0.15rem;
}

.crm-hospital-eval__empty {
    padding: 0.85rem 1rem;
    border-radius: 14px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.25);
}

[data-bs-theme="light"] .crm-hospital-eval__empty {
    background: #f8fafc;
    border-color: rgba(100, 116, 139, 0.35);
}

.crm-hospital-eval__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.6rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid transparent;
    vertical-align: middle;
}

.crm-hospital-eval__badge--hospital {
    background: rgba(148, 163, 184, 0.18);
    border-color: rgba(148, 163, 184, 0.45);
    color: #cbd5e1;
}

.crm-hospital-eval__badge--crm {
    background: rgba(56, 189, 248, 0.16);
    border-color: rgba(56, 189, 248, 0.5);
    color: #7dd3fc;
}

[data-bs-theme="light"] .crm-hospital-eval__badge--hospital {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #475569;
}

[data-bs-theme="light"] .crm-hospital-eval__badge--crm {
    background: #e0f2fe;
    border-color: #0ea5e9;
    color: #0369a1;
}

@media (max-width: 767px) {
    .crm-hospital-eval__row--quad,
    .crm-hospital-eval__row--pair {
        grid-template-columns: 1fr;
    }
}

.crm-treatment-modal .crm-lead-view__group,
.crm-treatment-view .crm-lead-view__group {
    color: #f8fafc;
    font-weight: 700;
}

.crm-treatment-modal .crm-lead-view__group > i,
.crm-treatment-view .crm-lead-view__group > i {
    color: #00baff;
}

/* Special Precautions yellow design: crm_special_precautions.css */

[data-bs-theme="light"] .crm-treatment-modal .crm-lead-view__group,
[data-bs-theme="light"] .crm-treatment-view .crm-lead-view__group {
    color: #1e293b;
}

[data-bs-theme="light"] .crm-treatment-modal .crm-lead-view__group > i,
[data-bs-theme="light"] .crm-treatment-view .crm-lead-view__group > i {
    color: #0284c7;
}

/* Disease Information — view modal tile layout */
.crm-disease-view {
    gap: 0.85rem;
}

.crm-disease-view__coverage .crm-lead-view__group:first-child {
    margin-top: 0;
}

.crm-disease-view__row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.crm-disease-view__row--single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 34rem;
}

.crm-disease-view__complaints {
    min-height: 4.5rem;
    margin-bottom: 0.15rem;
}

.crm-disease-view__docs {
    margin-bottom: 0.15rem;
}

.crm-disease-view__docs .crm-treatment-docs-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.crm-disease-view__docs .crm-treatment-doc-card {
    border-radius: 14px;
    border: 1px solid rgba(0, 186, 255, 0.28);
    background: linear-gradient(135deg, rgba(0, 186, 255, 0.06) 0%, rgba(15, 23, 42, 0.5) 75%);
}

[data-bs-theme="light"] .crm-disease-view__docs .crm-treatment-doc-card {
    border-color: rgba(13, 110, 253, 0.22);
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, #f8fafc 90%);
}

.crm-disease-view__docs .crm-treatment-doc-card__header {
    border-bottom: 1px solid rgba(0, 186, 255, 0.15);
}

@media (max-width: 991px) {
    .crm-disease-view__row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .crm-disease-view__row--single {
        max-width: none;
    }
}

@media (max-width: 575px) {
    .crm-disease-view__row {
        grid-template-columns: 1fr;
    }

    .crm-disease-view__docs .crm-treatment-docs-grid {
        grid-template-columns: 1fr;
    }
}

/* View treatment modal — field labels, section icons, and vertical spacing */
#viewTreatmentModal .crm-treatment-view .crm-treatment-email__label {
    margin-bottom: 0.5rem;
}

#viewTreatmentModal .crm-treatment-view .section-content > .row.g-3,
#viewTreatmentModal .crm-treatment-view .section-content > .row.g-3.mt-2 {
    row-gap: 1.25rem;
}

#viewTreatmentModal .crm-treatment-email.row {
    row-gap: 1rem;
}

#viewTreatmentModal .crm-followup-fields-column {
    gap: 1.25rem;
}

#viewTreatmentModal .crm-followup-impressions-column {
    gap: 0.5rem;
}

#viewTreatmentModal .crm-treatment-travel-block [data-travel-panel="companion"] .row {
    --bs-gutter-y: 1.25rem;
}

#viewTreatmentModal .crm-treatment-view-value,
#viewTreatmentModal .crm-treatment-view-currency-group,
#viewTreatmentModal .crm-treatment-view-prose {
    margin-top: 0.15rem;
}

#viewTreatmentModal .crm-conv-treatment-group__header {
    font-weight: 700;
    color: #f8fafc;
}

#viewTreatmentModal .crm-conv-treatment-group__header > i {
    color: #00baff;
}

[data-bs-theme="light"] #viewTreatmentModal .crm-conv-treatment-group__header {
    color: #1e293b;
}

[data-bs-theme="light"] #viewTreatmentModal .crm-conv-treatment-group__header > i {
    color: #0284c7;
}

/* All treatment modals — field labels and subsection titles */
.crm-treatment-modal .crm-treatment-email__label {
    margin-bottom: 0.5rem;
}

.crm-treatment-modal .crm-hospital-eval__field-label > i {
    color: #00baff;
}

[data-bs-theme="light"] .crm-treatment-modal .crm-hospital-eval__field-label > i {
    color: #0284c7;
}

#viewTreatmentModal .view-treatment-modal-email-actions .btn > i {
    color: #00baff;
}

#viewTreatmentModal .view-treatment-modal-email-actions .btn:hover > i {
    color: #fff;
}

/* Hospital deleted their copy — CRM keeps file with yellow outline */
.crm-doc-card-ui .crm-doc-file--hospital-deleted,
.crm-doc-card-ui .edit-patient-doc-thumb.crm-doc-file--hospital-deleted,
.crm-doc-card-ui .edit-patient-doc-file.crm-doc-file--hospital-deleted {
    outline: 2px solid #f59e0b;
    outline-offset: 2px;
    border-radius: 6px;
}

.crm-doc-card-ui .crm-treatment-doc-card--hospital-notice .crm-treatment-doc-card__notice-icon {
    color: #f59e0b;
    font-size: 0.95rem;
    margin-left: 0.35rem;
    cursor: pointer;
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-doc-file--hospital-deleted,
[data-bs-theme="light"] .crm-doc-card-ui .edit-patient-doc-thumb.crm-doc-file--hospital-deleted,
[data-bs-theme="light"] .crm-doc-card-ui .edit-patient-doc-file.crm-doc-file--hospital-deleted {
    outline-color: #d97706;
}

[data-bs-theme="light"] .crm-doc-card-ui .crm-treatment-doc-card--hospital-notice .crm-treatment-doc-card__notice-icon {
    color: #d97706;
}

/* Hospital deletion notice — Bootstrap HTML tooltips (above .modal.show 20000) */
.tooltip.crm-hospital-doc-notice-tooltip {
    --bs-tooltip-opacity: 1;
    z-index: 100060 !important;
    opacity: 1 !important;
}

.tooltip.crm-hospital-doc-notice-tooltip.show {
    opacity: 1 !important;
}

.tooltip.crm-hospital-doc-notice-tooltip .tooltip-inner {
    text-align: left;
    max-width: min(320px, 90vw);
    padding: 0.65rem 0.75rem;
    border-left: 3px solid #d97706;
    background-color: #292524 !important;
    color: #fafaf9 !important;
    opacity: 1 !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
}

.crm-hospital-doc-notice-tip__title {
    font-weight: 600;
    color: #fbbf24;
    margin-bottom: 0.35rem;
}

.crm-hospital-doc-notice-tip__file {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.8rem;
    word-break: break-word;
    margin-bottom: 0.35rem;
    color: #e7e5e4;
}

.crm-hospital-doc-notice-tip__body {
    font-size: 0.85rem;
    line-height: 1.35;
    color: #d6d3d1;
}

.crm-doc-card-ui .crm-hospital-doc-notice-trigger.crm-doc-file--hospital-deleted,
.crm-doc-card-ui .crm-hospital-doc-notice-trigger.edit-patient-doc-thumb.crm-doc-file--hospital-deleted,
.crm-doc-card-ui .crm-hospital-doc-notice-trigger.edit-patient-doc-file.crm-doc-file--hospital-deleted {
    cursor: help;
}

.crm-doc-card-ui .crm-treatment-doc-card--hospital-notice .crm-treatment-doc-card__notice-icon {
    cursor: pointer;
}

[data-bs-theme="light"] .tooltip.crm-hospital-doc-notice-tooltip .tooltip-inner {
    background-color: #fffbeb !important;
    color: #44403c !important;
    border: 1px solid #fde68a;
    border-left: 3px solid #d97706;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

[data-bs-theme="light"] .crm-hospital-doc-notice-tip__title {
    color: #b45309;
}

[data-bs-theme="light"] .crm-hospital-doc-notice-tip__file {
    color: #57534e;
}

[data-bs-theme="light"] .crm-hospital-doc-notice-tip__body {
    color: #78716c;
}

.crm-treatment-modal .crm-billing-line-file-view {
    max-width: 9.5rem;
}

.crm-treatment-modal .crm-billing-line-file-view-btn {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    padding: 0.2rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1.2;
    vertical-align: middle;
}

.crm-treatment-modal .crm-billing-line-file-view-btn__label {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.crm-billing-doc-uploads__row > .col-md-6 {
    display: flex;
    flex-direction: column;
}

.crm-billing-doc-uploads__row .crm-treatment-doc-field {
    flex: 1 1 auto;
    height: 100%;
    min-width: 0;
}

.crm-billing-doc-uploads__row .crm-treatment-doc-card {
    flex: 1 1 auto;
    height: 100%;
    min-height: 12.5rem;
}

/* Confirm patient email send */
#emailSendConfirmOverlay.crm-email-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 200000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.65);
    color-scheme: dark;
}

.crm-email-confirm-dialog {
    width: 100%;
    max-width: 500px;
    background: #08151d;
    color: #e0e6ed;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    /* visible so the custom hospital menu is not clipped (Safari) */
    overflow: visible;
}

.crm-email-confirm-header {
    padding: 1.75rem 1.85rem 1.3rem;
    border-bottom: 1px solid #2a3f5f;
}

.crm-email-confirm-title {
    margin: 0 0 0.55rem;
    font-size: 1.35rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.3;
}

.crm-email-confirm-message {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: #9CA3AF;
}

.crm-email-confirm-body {
    padding: 1.4rem 1.75rem 1.1rem;
}

.crm-email-confirm-label {
    display: block;
    margin: 0 0 0.45rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #9CA3AF;
}

.crm-email-confirm-select,
.crm-email-hospital-trigger {
    width: 100%;
    min-height: 44px;
    margin: 0;
    padding: 0.55rem 2.35rem 0.55rem 0.85rem;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    cursor: pointer !important;
    color-scheme: dark;
    background-color: #172635;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.3;
    text-align: left;
    box-shadow: none;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.crm-email-hospital-picker {
    position: relative;
    z-index: 2;
    margin: 0 0 1.15rem;
}

.crm-email-hospital-picker.is-open .crm-email-hospital-trigger {
    border-color: rgba(0, 186, 255, 0.55);
    background-color: #1a2930;
}

.crm-email-hospital-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 5;
    max-height: min(240px, 45vh);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #0f1c27;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
}

.crm-email-hospital-option,
.crm-email-hospital-empty {
    display: block;
    width: 100%;
    margin: 0;
    padding: 12px 14px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 16px;
    line-height: 1.35;
    text-align: left;
    cursor: pointer;
    touch-action: manipulation;
}

.crm-email-hospital-option.is-selected,
.crm-email-hospital-option:hover,
.crm-email-hospital-option:active {
    background: rgba(0, 186, 255, 0.16);
}

.crm-email-hospital-empty {
    color: #9CA3AF;
    cursor: default;
}

.crm-email-confirm-select::-ms-expand {
    display: none;
}

.crm-email-confirm-select option {
    background: #172635;
    color: #fff;
}

.crm-email-confirm-select:focus,
.crm-email-hospital-trigger:focus {
    outline: none;
    border-color: rgba(0, 186, 255, 0.55);
    background-color: #1a2930;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23cbd5e1' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
}

.crm-email-confirm-select:disabled,
.crm-email-hospital-trigger:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.crm-email-confirm-preview {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.85rem 1rem;
    margin: 0 0 0.35rem;
    background: rgba(23, 38, 53, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
}

.crm-email-confirm-preview-row {
    display: grid;
    grid-template-columns: 36px 1fr;
    gap: 0.75rem;
    align-items: start;
    font-size: 0.875rem;
    line-height: 1.4;
}

.crm-email-confirm-preview-label {
    color: #8b95a5;
    font-weight: 600;
}

.crm-email-confirm-preview-value {
    color: #e0e6ed;
    word-break: break-word;
}

.crm-email-confirm-hint {
    min-height: 1.1rem;
    margin: 0.55rem 0 0;
    font-size: 0.8125rem;
    color: #fbbf24;
}

.crm-email-confirm-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.1rem 1.75rem 1.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.crm-email-confirm-send,
.crm-email-confirm-cancel {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 2.25rem;
    height: auto;
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    box-sizing: border-box;
    cursor: pointer;
    white-space: nowrap;
}

.crm-email-confirm-send {
    border: none;
    background: linear-gradient(145deg, #00baff, #0077cc);
    color: #fff;
    box-shadow: 0 0 10px rgba(0, 186, 255, 0.4);
}

.crm-email-confirm-send:hover:not(:disabled) {
    box-shadow: 0 0 20px rgba(0, 186, 255, 0.55);
}

.crm-email-confirm-send:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}

.crm-email-confirm-cancel {
    border: 1px solid #f24747;
    background: rgba(242, 71, 71, 0.05);
    color: #f24747;
    box-shadow: 0 0 10px rgba(242, 71, 71, 0.2);
}

.crm-email-confirm-cancel:hover:not(:disabled) {
    background: #db4040;
    color: #fff;
}

[data-bs-theme="light"] #emailSendConfirmOverlay.crm-email-confirm-overlay {
    background: rgba(0, 0, 0, 0.45);
    color-scheme: light;
}

[data-bs-theme="light"] .crm-email-confirm-dialog {
    background: #f0f0f0;
    color: #1f2937;
    border: 1px solid #c8c8c8;
}

[data-bs-theme="light"] .crm-email-confirm-header {
    border-bottom-color: rgba(13, 110, 253, 0.1);
}

[data-bs-theme="light"] .crm-email-confirm-title {
    color: #000000c7;
}

[data-bs-theme="light"] .crm-email-confirm-message,
[data-bs-theme="light"] .crm-email-confirm-label,
[data-bs-theme="light"] .crm-email-confirm-preview-label {
    color: #6b7280;
}

[data-bs-theme="light"] .crm-email-confirm-select,
[data-bs-theme="light"] .crm-email-hospital-trigger {
    color-scheme: light;
    cursor: pointer;
    background-color: #fbfbfb;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23334155' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    color: #1f2937;
    border-color: #c8c8c8;
}

[data-bs-theme="light"] .crm-email-confirm-select:focus,
[data-bs-theme="light"] .crm-email-hospital-trigger:focus,
[data-bs-theme="light"] .crm-email-hospital-picker.is-open .crm-email-hospital-trigger {
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23334155' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border-color: #2563eb;
}

[data-bs-theme="light"] .crm-email-confirm-select option {
    background: #fff;
    color: #1f2937;
}

[data-bs-theme="light"] .crm-email-hospital-menu {
    background: #fff;
    border-color: #d7dee8;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
}

[data-bs-theme="light"] .crm-email-hospital-option {
    color: #1f2937;
}

[data-bs-theme="light"] .crm-email-hospital-option.is-selected,
[data-bs-theme="light"] .crm-email-hospital-option:hover,
[data-bs-theme="light"] .crm-email-hospital-option:active {
    background: rgba(37, 99, 235, 0.12);
}

[data-bs-theme="light"] .crm-email-hospital-empty {
    color: #64748b;
}

[data-bs-theme="light"] .crm-email-confirm-preview {
    background: #fff;
    border-color: #e5eaf0;
}

[data-bs-theme="light"] .crm-email-confirm-preview-value {
    color: #1f2937;
}

[data-bs-theme="light"] .crm-email-confirm-footer {
    border-top-color: rgba(13, 110, 253, 0.1);
}
