/* ==========================================================================
   Radiology: templates, technologist input, reporting, cancel verify, reports
   ========================================================================== */

/* -- two-column screen shell --------------------------------------------- */

.rad-body { flex: 1; display: flex; gap: 10px; align-items: stretch; min-height: 0; }

.rad-left {
    flex: 1.15;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.rad-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 340px;
    overflow-y: auto;
}

/* -- filter strip --------------------------------------------------------- */

.rad-filter { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }

.rad-filter-field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; }
.rad-filter-field label { font-weight: 700; }
.rad-filter-field .entry-select { width: 130px; }

.rad-indoor-legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    margin-left: auto;
    padding-bottom: 3px;
}

.rad-dicom-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 14px;
    background: linear-gradient(#ffffff, #dfe9f1);
    border: 1px solid #7f9ab1;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    color: #14507f;
}

.rad-dicom-btn svg { width: 16px; height: 16px; }
.rad-dicom-icon { font-size: 15px; }

/* -- study grid ----------------------------------------------------------- */

.rad-grid { flex: 1; }
.rad-grid-body { max-height: none; min-height: 220px; flex: 1; }

.rs-col { padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid #e4ebf1; }
.rs-col-order { width: 66px; flex-shrink: 0; }
.rs-col-mr { width: 68px; flex-shrink: 0; }
.rs-col-name { width: 150px; flex-shrink: 0; }
.rs-col-desc { flex: 1; min-width: 150px; }
.rs-col-date { width: 88px; flex-shrink: 0; }
.rs-col-time { width: 52px; flex-shrink: 0; border-right: none; }

/* -- right-hand detail panels --------------------------------------------- */

.rad-detail-grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr 0.9fr;
    gap: 5px 14px;
    font-size: 12px;
}

.rad-detail-span2 { grid-column: span 2; }
.rad-detail-span3 { grid-column: span 3; }

.rad-textarea {
    width: 100%;
    border: 1px solid var(--input-border);
    border-radius: 2px;
    font-size: 12px;
    font-family: inherit;
    padding: 4px 6px;
    resize: vertical;
    background: #fff;
}

.rad-textarea:disabled, .rad-textarea[readonly] { background: #f6f9fb; color: #3d4b57; }
.rad-textarea-short { height: 52px; }
.rad-textarea-report { height: 240px; font-family: 'Times New Roman', serif; font-size: 14px; }
.rad-textarea-template { height: 380px; font-family: 'Times New Roman', serif; font-size: 14px; }

.rad-template-row { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.rad-template-row:last-child { margin-bottom: 0; margin-top: 6px; }

.rad-fmt-btns { display: flex; gap: 2px; }

.rad-fmt-btn {
    width: 24px;
    height: 22px;
    background: linear-gradient(#ffffff, #e9eff5);
    border: 1px solid #b9c6d2;
    border-radius: 2px;
    font-size: 12px;
    font-weight: 700;
    color: #14507f;
}

.rad-verify-row { align-items: center; }

.rad-verify-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    height: 26px;
    padding: 0 12px;
    background: linear-gradient(#eaf7e9, #c9e8c6);
    border: 1px solid #7fae7c;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    color: #1f7a3c;
}

.rad-verify-btn:disabled { opacity: 0.45; }

.rad-verify-dot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3e9e44;
    color: #fff;
    font-size: 10px;
}

.rad-signed-note {
    padding: 6px 10px;
    background: #eaf7e9;
    border: 1px solid #9ed49a;
    color: #24632a;
    font-size: 12px;
    font-weight: 700;
}

/* -- report preview modal -------------------------------------------------- */

.rad-preview-modal { width: min(920px, 94vw); }
.rad-preview-body { max-height: 78vh; overflow: auto; display: flex; }
.rad-preview-body .report-viewer { flex: 1; }

/* -- patient study review -------------------------------------------------- */

.rad-review-filter { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; }
.rad-review-input { width: 170px; }
.rad-review-dates { display: flex; align-items: center; gap: 6px; font-size: 12px; }
.rad-review-buttons { display: flex; gap: 8px; margin-left: auto; }

/* -- templates manager ----------------------------------------------------- */

.rad-template-grid { flex: 1; }
.rt-col { padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid #e4ebf1; }
.rt-col-name { flex: 1; min-width: 180px; }
.rt-col-mod { width: 70px; flex-shrink: 0; border-right: none; }

/* -- cancel verification --------------------------------------------------- */

.rc-col { padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid #eef2f6; }
.rc-col-order { width: 66px; flex-shrink: 0; }
.rc-col-mr { width: 66px; flex-shrink: 0; }
.rc-col-name { width: 148px; flex-shrink: 0; }
.rc-col-ref { width: 150px; flex-shrink: 0; }
.rc-col-code { width: 56px; flex-shrink: 0; }
.rc-col-desc { flex: 1; min-width: 140px; }
.rc-col-type { width: 44px; flex-shrink: 0; }
.rc-col-amount { width: 62px; flex-shrink: 0; text-align: right; }
.rc-col-entry { width: 122px; flex-shrink: 0; }
.rc-col-status { width: 86px; flex-shrink: 0; border-right: none; padding: 1px 3px; }

.rad-cancel-status-pending { background: #f4837d; color: #5c0f0a; }
.rad-cancel-status-inprocess { background: #f9c8c5; color: #7a2a20; }
.rad-cancel-status-verified { background: #a5eb9b; color: #1b4d13; }

.rad-remarks-label { color: #7a1420; font-weight: 700; }

/* -- departmental reports --------------------------------------------------- */

.rad-criteria-note { margin: 0 0 2px 22px; font-size: 11px; color: #96271b; }

/* -- radiology CPT view ----------------------------------------------------- */

.rad-cptview-grid { flex: 1; }
.rad-cptview-body { max-height: none; min-height: 320px; flex: 1; }

.rv-col { padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid #e4ebf1; }
.rv-col-code { width: 110px; flex-shrink: 0; }
.rv-col-name { flex: 1; min-width: 220px; }
.rv-col-type { width: 110px; flex-shrink: 0; }
.rv-col-amount { width: 110px; flex-shrink: 0; text-align: right; border-right: none; }

/* -- patient notes viewer ---------------------------------------------------- */

.notes-info { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.notes-mr-label { font-size: 15px; font-weight: 700; color: #96271b; padding-top: 2px; }
.notes-mr-input { width: 150px; }

.notes-info-block { display: flex; flex-direction: column; gap: 5px; font-size: 12px; margin-left: 26px; }

.notes-body { flex: 1; display: flex; gap: 10px; align-items: stretch; min-height: 0; }

.notes-left { flex: 1; display: flex; flex-direction: column; gap: 0; min-width: 0; }
.notes-grid { flex: 1; }
.notes-grid-body { max-height: none; min-height: 220px; flex: 1; }

.nt-col { padding: 3px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-right: 1px solid #e4ebf1; }
.nt-col-type { flex: 1.2; min-width: 130px; }
.nt-col-by { flex: 1; min-width: 120px; }
.nt-col-loc { width: 44px; flex-shrink: 0; }
.nt-col-date { width: 90px; flex-shrink: 0; }
.nt-col-time { width: 52px; flex-shrink: 0; border-right: none; }

.notes-invest-bar {
    margin-top: 8px;
    padding: 3px 8px;
    background: linear-gradient(#5b9bd5, #3a7cba);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.notes-invest-body {
    min-height: 56px;
    padding: 6px 8px;
    border: 1px solid var(--panel-border);
    border-top: none;
    background: var(--surface);
    font-size: 12px;
}

.notes-right { flex: 1.1; display: flex; flex-direction: column; min-width: 320px; }
.notes-selected-title { font-size: 12px; font-weight: 700; color: #14507f; padding: 2px 0 4px; }
.notes-selected-text { flex: 1; min-height: 320px; font-family: 'Times New Roman', serif; font-size: 14px; }
