/* ── REPORT PAGE LAYOUT (lrd-* classes) ── */
/* This file is the single source of truth for all report page styles.
   Both LabReport.razor and PublicReportView.razor use these rules via _ReportPageLayout.
   Keep in sync with LabReport.razor <style> block .lrd-* rules. */

.lr-hidden{visibility:hidden !important;pointer-events:none !important;user-select:none !important}
.lrd-template-footer-wrap.lr-hidden{display:none !important;height:0 !important;min-height:0 !important;max-height:0 !important;overflow:hidden !important}

/* PAGE */
.lrd-page{width:210mm;max-width:210mm;min-height:296mm;background:white;box-shadow:0 4px 20px rgba(0,0,0,0.1);padding:0;font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;font-size:13px;color:#1a1a1a;display:flex;flex-direction:column;border:2px solid #2B2A8E;box-sizing:border-box;margin:0 auto 12px auto;overflow:hidden;height:296mm}
.lrd-page.lrd-page-full{padding:2mm 0 2mm 0 !important;border:1px solid #2B2A8E !important;position:relative !important}
.lrd-inner-border{border:1px solid #d1d5db;display:flex;flex-direction:column;flex:1 1 0;min-height:0;box-sizing:border-box;margin:0 3mm}
.lrd-inner-border-full{border:none !important}
.lrd-main-content{padding:4px 12px 42mm 12px;flex:1 1 0;min-height:0;display:flex;flex-direction:column;overflow:hidden;position:relative}
.lrd-main-content > .lrd-footer-section{flex-shrink:0;margin-top:auto}

/* FULL-WIDTH CONTENT */
.lrd-main-content-full{padding:22px 0 0 0 !important}
.lrd-main-content-full .lrd-patient-qr-wrapper{margin-left:0 !important}
.lrd-main-content-full .lrd-patient-info{padding:4px 10px}
.lrd-main-content-full .lrd-patient-grid{gap:2px 12px}
.lrd-main-content-full .lrd-patient-row{padding:1px 0}
.lrd-main-content-full .lrd-patient-label{font-size:12px;font-weight:800;min-width:120px;text-transform:uppercase}
.lrd-main-content-full .lrd-patient-value{font-size:15px;font-weight:700;text-transform:uppercase}
.lrd-main-content-full .lrd-bottom-strip{margin-left:0 !important;margin-right:0 !important;border-radius:0 !important}
.lrd-main-content-full .lrd-footer-disclaimer{margin-left:0 !important;margin-right:0 !important}

/* HEADER */
.lrd-header{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:0px;padding:6px 12px;height:2cm;background:linear-gradient(to right,#86D2F2,#7CCBF0);border-radius:0;margin-bottom:0;border-bottom:1px solid rgba(0,0,0,0.05);width:100%;box-sizing:border-box;overflow:hidden;flex-shrink:0}
.lrd-header-hidden{visibility:hidden !important;pointer-events:none !important;user-select:none !important;height:0 !important;overflow:hidden !important;padding:0 !important;margin:0 !important;border:none !important}
.lrd-footer-hidden{visibility:hidden !important;pointer-events:none !important;user-select:none !important;height:0 !important;overflow:hidden !important;padding:0 !important;margin:0 !important;border:none !important}
.lrd-logo-wrap{flex-shrink:0;display:flex;align-items:center;margin-right:8px}
.lrd-logo{width:80px;height:80px;object-fit:contain}
.lrd-lab-name{font-family:"Monotype Corsiva","Palatino Linotype","Apple Chancery",cursive;font-size:26px;font-weight:700;font-style:italic;color:#2B2A8E;letter-spacing:-0.5px;line-height:1;white-space:nowrap;flex-shrink:0;margin-left:-5px}
.lrd-header-divider{width:1.5px;align-self:stretch;background:#2B2A8E;margin:0 12px;flex-shrink:0}
.lrd-subtitle{font-family:"Times New Roman",Times,serif;font-size:13px;font-style:italic;font-weight:700;color:#3A3A8F;opacity:1;white-space:nowrap;flex-shrink:0;margin-left:-5px}

/* TITLE BAR */
.lrd-title-bar{background:#2B2A8E;padding:4px 14px;text-align:center;border-radius:0;margin:0 auto 8px auto;width:auto;max-width:100%;flex-shrink:0}
.lrd-title-text{font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;font-size:13px;font-weight:700;color:white;letter-spacing:1px;text-transform:uppercase;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:2px}

/* PATIENT INFO + QR */
.lrd-patient-qr-wrapper{display:flex;gap:6px;margin-bottom:4px;margin-top:0px;margin-left:0px;align-items:flex-start;flex-shrink:0}
.lrd-patient-info{flex:1;border:none;border-radius:3px;padding:4px 6px;background:linear-gradient(135deg,#f8fafc 0%,#ffffff 100%);box-shadow:none}
.lrd-patient-grid{display:grid;grid-template-columns:auto 1fr auto auto 1fr;gap:2px 8px;align-items:baseline}
.lrd-patient-row{display:flex;align-items:baseline;gap:5px;padding:2px 0}
.lrd-patient-label{font-weight:700;color:#64748b;font-size:9px;text-transform:uppercase;letter-spacing:0.4px;white-space:nowrap;font-family:'Geist','Inter',-apple-system,sans-serif;display:inline-block;min-width:100px}
.lrd-patient-label::after{content:':'}
.lrd-patient-value{color:#0f172a;font-weight:600;font-size:11px;letter-spacing:0px;line-height:1.2;font-family:'Geist','Inter',-apple-system,sans-serif}
.lrd-patient-name{font-size:12px;font-weight:700;color:#0b1e33;letter-spacing:-0.1px}
.lrd-collected-value{line-height:1.5}
.lrd-qr-wrap{display:flex;flex-direction:column;align-items:center;gap:3px}
.lrd-qr-code{width:48px;height:48px;border:1.5px solid #e2e8f0;border-radius:4px;background:white;box-sizing:border-box;display:flex;align-items:center;justify-content:center;overflow:hidden}
.lrd-qr-code img,.lrd-qr-code canvas{width:100% !important;height:100% !important;display:block}
.lrd-qr-label{font-size:11px;font-weight:600;color:#64748b;text-align:center}

/* RESULTS BODY */
.lrd-body{flex:1 1 0;min-height:0;overflow:hidden}
.lrd-test-section{margin-bottom:12px;border:1px solid #e2e8f0;border-radius:6px;overflow:hidden}
.lrd-test-header{font-size:15px;font-weight:700;color:#1a56db;padding:8px 0}
.lrd-test-meta{display:flex;gap:12px;padding:4px 8px;font-size:12px;color:#1e293b;font-weight:700;border-bottom:1px dashed #cbd5e1}
.lrd-test-meta span::before{content:none}
.lrd-result-header{display:grid;grid-template-columns:1.5fr 65px 55px 1fr;align-items:center;column-gap:57px;padding:4px 6px;background:#f1f5f9;border-bottom:2px solid #cbd5e1;font-size:11px;font-weight:900;color:#1e293b;text-transform:uppercase;letter-spacing:0.5px}
.lrd-result-header .lrd-param,.lrd-result-header .lrd-value,.lrd-result-header .lrd-unit,.lrd-result-header .lrd-ref-range{font-size:11px;font-weight:900;color:#1e293b;text-align:left}
.lrd-result-row{display:grid;grid-template-columns:1.5fr 65px 55px 1fr;align-items:start;column-gap:57px;padding:2px 6px;border-bottom:1px solid #e2e8f0;background:none}
.lrd-result-row > *{min-width:0}
.lrd-result-row:last-child{border-radius:0 0 4px 4px}
.lrd-result-critical{background:none;border-left:4px solid #dc2626}
.lrd-result-descriptive{grid-template-columns:1fr 3fr;padding:4px 8px;background:#fafbff;border-left:2px solid #2B2A8E;margin:1px 0;border-radius:4px}
.lrd-result-descriptive .lrd-flag,.lrd-result-descriptive .lrd-unit,.lrd-result-descriptive .lrd-ref-range{display:none}
.lrd-result-descriptive .lrd-value{text-align:left;font-weight:600;line-height:1.4;font-size:11.5px}
.lrd-result-descriptive .lrd-param{align-self:start;padding-top:1px;font-size:11.5px}
.lrd-param{font-weight:600;color:#334155;font-size:16px}
.lrd-value{font-weight:700;color:#0f172a;text-align:center;overflow-wrap:break-word;word-break:break-word;max-width:100%;font-size:16px}
.lrd-flag{padding:2px 6px;border-radius:4px;font-size:13px;font-weight:700;text-align:center}
.lrd-flag-high{color:#991b1b}
.lrd-value.lrd-flag-high{color:#dc2626}
.lrd-flag-low{color:#1e3a8a}
.lrd-value.lrd-flag-low{color:#2563eb}
.lrd-flag-abnormal{color:#92400e}
.lrd-value.lrd-flag-abnormal{color:#d97706}
.lrd-unit{color:#64748b;font-size:14px;text-align:center}
.lrd-ref-range{font-size:10px;color:#64748b;text-align:left;line-height:1.2;overflow:hidden}

/* FOOTER SECTION */
.lrd-footer-section{margin-top:auto;flex-shrink:0}
.lrd-footer-disclaimer{text-align:left;font-size:10px;color:#475569;padding:2px 14px;page-break-inside:avoid;margin-left:0;margin-right:0;font-weight:700}

/* FOOTER SIGNATURES */
.lrd-sig-spacer{height:2cm;width:100%;flex-shrink:0}
.lrd-sig-row{display:flex;gap:4px;margin-bottom:0;margin-top:0;padding-top:0;padding-bottom:1px;border-top:1px solid #e2e8f0;flex-shrink:0;page-break-inside:avoid;page-break-before:avoid}
.lrd-sig-block{flex:1;text-align:center;padding:2px 4px}
.lrd-sig-line{height:1px;background:#94a3b8;margin-bottom:1px}
.lrd-sig-title{font-size:11px;font-weight:700;color:#1a237e;text-transform:uppercase;letter-spacing:0.5px;margin-bottom:0}
.lrd-sig-name{font-size:12px;font-weight:900;color:#1a237e;margin-bottom:0}
.lrd-sig-reg{font-size:11px;color:#1a237e}

/* BOTTOM STRIP */
.lrd-bottom-strip{display:flex;justify-content:space-between;height:1.7cm;padding:3px 8px;background:linear-gradient(to right,#6aaed6,#bfe4f5);border-radius:0;font-size:12px;font-weight:800;color:#1a237e;flex-shrink:0;width:auto;box-sizing:border-box;page-break-inside:avoid;margin-left:-12px;margin-right:-12px;margin-top:2px;margin-bottom:0;transform:translateY(1cm)}
.lrd-bottom-address{flex:1}
.lrd-bottom-address div{margin-bottom:2px}
.lrd-bottom-contact{text-align:right}
.lrd-bottom-contact div{margin-bottom:2px}

/* PAGE NUMBER */
.lrd-page-num{font-size:12px;font-weight:700;color:#1a237e;text-align:right;white-space:nowrap;margin-left:auto;page-break-inside:avoid}

/* CONTINUED NOTICE */
.lrd-continued{text-align:center;font-size:12px;font-weight:600;color:#64748b;padding:6px 0;border-top:1px dashed #cbd5e1;margin-top:10px;font-style:italic}

/* TEMPLATE FOOTER IMAGE */
.lrd-template-footer-wrap{height:1.7cm !important;min-height:1.7cm !important;max-height:1.7cm !important;position:absolute !important;bottom:2mm !important;left:2mm !important;width:calc(100% - 4mm) !important;overflow:hidden !important;box-sizing:border-box !important;background-repeat:no-repeat !important;background-position:center !important;background-size:100% 100% !important}

/* TEMPLATE HEADER IMAGE */
.lrd-page-full .lrd-template-header-image{padding:0 !important}
.lrd-template-header-image{line-height:0;margin-bottom:1cm}
.lrd-template-header-image img{width:100%;height:2cm;display:block}

/* PACKAGE HEADER */
.lrd-package-header{background:#f1f5f9;color:#475569;font-size:12px;font-weight:800;padding:4px 12px;border-radius:6px 6px 0 0;text-transform:uppercase;border-left:4px solid #1a56db}

/* MEASUREMENT HELPER */
.lrd-print-measure .lrd-param{font-size:16px}
.lrd-print-measure .lrd-value{font-size:16px}
.lrd-print-measure .lrd-flag{font-size:13px}
.lrd-print-measure .lrd-unit{font-size:14px}
.lrd-print-measure .lrd-ref-range{font-size:10px}
.lrd-print-measure .lrd-test-header{font-size:15px}
.lrd-print-measure .lrd-result-header{font-size:12px}
.lrd-print-measure .lrd-page{border:2px solid #2B2A8E}
.lrd-print-measure .lrd-page-full{border:1px solid #2B2A8E}
.lrd-print-measure .lrd-template-header-image{margin-bottom:1cm !important}
.lrd-print-measure .lrd-template-header-image img{height:2.8cm !important}
.lrd-print-measure .lrd-sig-spacer{height:2mm !important}
.lrd-print-measure .lrd-sig-row{margin-bottom:2cm !important}

/* Spacing between pages on screen */
.lr-container .lrd-page{margin-bottom:20px}

/* ── PRINT STYLES ── */
@media print{
    @page{size:A4;margin:0}
    *{-webkit-print-color-adjust:exact !important;print-color-adjust:exact !important;color-adjust:exact !important}
    .lrd-page{box-shadow:none !important;margin:0 !important;padding:2mm 0 2mm 0 !important;width:210mm !important;height:296mm !important;min-height:296mm !important;max-width:none !important;page-break-after:always;overflow:hidden !important;border:2px solid #2B2A8E !important;display:flex !important;flex-direction:column !important;box-sizing:border-box !important;position:relative !important;font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif !important;font-size:13px !important;color:#1a1a1a !important}
    .lrd-page.lrd-page-full{box-shadow:none !important;margin:0 !important;padding:2mm 0 2mm 0 !important;width:210mm !important;height:297mm !important;border-color:#2B2A8E !important;border-width:1px !important}
    .lrd-inner-border{overflow:visible !important;border:1px solid #d1d5db !important;flex:1 1 0 !important;min-height:0 !important;display:flex !important;flex-direction:column !important;margin:0 3mm !important}
    .lrd-inner-border-full{border:none !important}
    .lrd-main-content{padding:4px 12px 8px 12px !important;overflow:visible !important;flex:1 1 0 !important;min-height:0 !important;display:flex !important;flex-direction:column !important}
    .lrd-main-content-full{padding:22px 0 8px 0 !important}
    .lrd-main-content-full .lrd-patient-qr-wrapper{margin-left:0 !important;margin-bottom:4px !important}
    .lrd-main-content-full .lrd-patient-info{padding:4px 10px !important}
    .lrd-main-content-full .lrd-patient-grid{gap:2px 12px !important}
    .lrd-main-content-full .lrd-patient-row{padding:1px 0 !important}
    .lrd-main-content-full .lrd-patient-label{font-size:12px !important;font-weight:800 !important;min-width:120px !important;text-transform:uppercase !important}
    .lrd-main-content-full .lrd-patient-value{font-size:15px !important;font-weight:700 !important;text-transform:uppercase !important}
    .lrd-main-content-full .lrd-bottom-strip{margin-left:0 !important;margin-right:0 !important}
    .lrd-main-content-full .lrd-footer-disclaimer{margin-left:0 !important;margin-right:0 !important}
    .lrd-body{flex:1 1 0 !important;min-height:0 !important;overflow:hidden !important}
    .lrd-footer-section{flex-shrink:0 !important;margin-top:auto !important;position:relative !important;left:0 !important;right:0 !important;padding:0 !important;box-sizing:border-box !important;z-index:1000 !important;page-break-inside:avoid !important}
    .lrd-result-header{font-size:12px !important}
    .lrd-page-num{padding:0 8px 2px 0 !important;margin-top:0 !important}
    .lrd-template-header-image{margin-bottom:1cm !important}
    .lrd-template-header-image:not(.lr-hidden) img{display:block !important;visibility:visible !important;height:2.8cm !important;width:100% !important}
    .lrd-page-full .lrd-template-header-image{padding:0 !important}
    .lrd-template-footer-wrap{height:1.7cm !important;min-height:1.7cm !important;max-height:1.7cm !important;width:calc(100% - 4mm) !important;position:absolute !important;bottom:2mm !important;left:2mm !important;overflow:hidden !important;box-sizing:border-box !important;background-repeat:no-repeat !important;background-position:center !important;background-size:100% 100% !important}
    .lrd-footer-disclaimer{margin-left:0px !important;margin-right:0px !important;margin-bottom:0 !important;padding:2px 14px !important;text-align:left !important;page-break-inside:avoid !important}
    .lrd-sig-row{page-break-inside:avoid !important;page-break-before:avoid !important}
    .lrd-sig-row{padding-top:0 !important;padding-bottom:1px !important;gap:4px !important;margin-top:0 !important;margin-bottom:2cm !important;border-top-width:1px !important}
    .lrd-sig-spacer{height:2mm !important}
    .lrd-sig-block{padding:2px 4px !important}
    .lrd-sig-line{margin-bottom:1px !important;height:1px !important}
    .lrd-sig-title{margin-bottom:0 !important;font-size:11px !important;color:#1a237e !important}
    .lrd-sig-name{margin-bottom:0 !important;font-size:12px !important;color:#1a237e !important;font-weight:900 !important}
    .lrd-sig-reg{font-size:11px !important;color:#1a237e !important}
    .lrd-result-critical{background:none !important}
    .lrd-result-row{background:none !important}
    .lrd-result-descriptive{grid-template-columns:1fr 3fr !important;padding:4px 8px !important;margin:1px 0 !important;border-left:2px solid #2B2A8E !important;page-break-inside:avoid}
    .lrd-result-descriptive .lrd-flag,.lrd-result-descriptive .lrd-unit,.lrd-result-descriptive .lrd-ref-range{display:none !important}
    .lrd-result-descriptive .lrd-value{text-align:left !important;font-weight:600 !important;line-height:1.4 !important;font-size:11.5px !important}
    .lrd-result-descriptive .lrd-param{align-self:start !important;padding-top:1px !important;font-size:11.5px !important}
    .lrd-test-header{padding:8px 0 !important}
    .lrd-param{font-size:16px !important}
    .lrd-value{font-size:16px !important}
    .lrd-flag{font-size:13px !important}
    .lrd-unit{font-size:14px !important}
    .lrd-ref-range{font-size:10px !important}
    .lrd-test-header{font-size:15px !important}
    .lrd-result-header{font-size:12px !important}
    .lrd-test-section{page-break-inside:avoid !important}
    .lrd-continued{page-break-inside:avoid !important}
    .lrd-bottom-strip{height:1.7cm !important;margin-left:-12px !important;margin-right:-12px !important;margin-bottom:0 !important;margin-top:2px !important;padding:3px 8px !important;page-break-inside:avoid;transform:translateY(1cm) !important}
}
