:root{color-scheme:light;--bg:#f3f7fb;--surface:#fff;--surface-2:#f7fafc;--text:#1d2b3a;--muted:#738194;--line:#e3ebf2;--primary:#1677b8;--primary-dark:#0d5e96;--teal:#159c9a;--shadow:0 5px 20px #19334a0a;--sidebar:#102b43;--sidebar-text:#c1d0df;--radius:16px}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--text);font:14px/1.5 Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}button,input,select,textarea{font:inherit}button{cursor:pointer}button:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible{outline:3px solid #4aa3df66;outline-offset:1px}h1,h2,h3,h4,p{margin-top:0}h1{font-size:25px;margin:2px 0 0;font-weight:750;letter-spacing:-.5px}h2{font-size:21px;margin:0 0 5px;letter-spacing:-.3px}h3{font-size:16px;margin:0 0 3px}h4{margin:0;font-size:14px}.muted,.card-heading p,.section-intro p,.welcome-row p{color:var(--muted);margin:0}.app-shell{min-height:100vh}.sidebar{position:fixed;inset:0 auto 0 0;width:254px;height:100vh;height:100dvh;min-height:0;overflow-x:hidden;overflow-y:auto;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y;background:var(--sidebar);color:#fff;padding:24px 14px 16px;display:flex;flex-direction:column;z-index:10}.brand{display:flex;gap:11px;align-items:center;padding:0 10px 28px;color:white;text-decoration:none}.brand b{display:block;font-size:17px;letter-spacing:.1px}.brand small{display:block;font-size:11px;color:#9eb2c7;margin-top:1px}.brand-mark{width:39px;height:39px;border-radius:12px;display:grid;place-items:center;background:linear-gradient(135deg,#26a5d8,#1677b8);color:#fff;font-size:14px;font-weight:800;flex-shrink:0}.nav-label{padding:12px 12px 7px;color:#8198ad;font-size:10px;font-weight:800;letter-spacing:1.2px}.nav-item{border:0;background:transparent;color:var(--sidebar-text);padding:11px 12px;border-radius:10px;display:flex;align-items:center;gap:12px;text-align:left;width:100%;font-size:13px;margin:2px 0}.nav-item>span{font-size:17px;width:20px;text-align:center}.nav-item:hover,.nav-item.active{background:#ffffff17;color:#fff}.nav-item.active{box-shadow:inset 3px 0 #43b4e7}.nav-item em{font-size:9px;margin-left:auto;color:#92a8bb;font-style:normal}.sidebar-footer{margin-top:auto;border-top:1px solid #ffffff20;padding:17px 9px 0;display:flex;align-items:center;gap:8px;color:#afc0d0;font-size:11px}.status-dot{width:7px;height:7px;border-radius:50%;background:#f5b74f}.text-button{border:0;background:transparent;color:#9edbff;margin-left:auto;font-size:11px}.main-area{margin-left:254px;min-height:100vh;padding:0 30px 22px;max-width:1800px}.topbar{min-height:100px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--line);margin-bottom:25px}.eyebrow{color:var(--primary);font-size:10px;letter-spacing:1.5px;font-weight:800}.top-actions{display:flex;align-items:center;gap:14px;color:var(--muted);font-size:12px}.icon-button,.mobile-menu{border:1px solid var(--line);background:var(--surface);color:var(--text);width:38px;height:38px;border-radius:11px;font-size:19px}.mobile-menu{display:none}.view{display:block}.view[hidden],[hidden]{display:none!important}.welcome-row,.section-intro{display:flex;align-items:center;justify-content:space-between;gap:18px;margin-bottom:20px}.section-intro{margin-bottom:22px}.pill{font-size:11px;background:#e9f5fd;color:#176da4;padding:5px 10px;border-radius:30px;white-space:nowrap}.stats-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:15px;margin-bottom:20px}.stat-card,.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow)}.stat-card{padding:19px;min-width:0;position:relative}.stat-icon{width:35px;height:35px;display:grid;place-items:center;border-radius:11px;font-size:18px;margin-bottom:16px}.blue{background:#e6f3ff;color:#1677b8}.teal{background:#e1f8f5;color:#118b88}.violet{background:#f0eaff;color:#7655bc}.amber{background:#fff4de;color:#bd8215}.stat-label{display:block;color:var(--muted);font-size:12px}.stat-card strong{display:block;font-size:26px;letter-spacing:-.7px;margin:3px 0}.stat-card small{color:var(--muted);font-size:11px}.card{padding:22px;margin-bottom:19px}.card-heading{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}.card-heading p{font-size:12px}.quick-actions{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.quick-action{border:1px solid var(--line);border-radius:12px;background:var(--surface);padding:17px 14px;text-align:left;color:var(--text);display:flex;flex-direction:column;align-items:flex-start;gap:5px}.quick-action:hover{border-color:#9acbe8;background:var(--surface-2)}.quick-action>span{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:#eaf6fd;color:var(--primary);font-size:20px;margin-bottom:6px}.quick-action b{font-size:12px}.quick-action small{color:var(--muted);font-size:11px}.btn{border:1px solid transparent;border-radius:10px;padding:10px 15px;font-weight:650;font-size:12px;display:inline-flex;align-items:center;justify-content:center;gap:7px}.btn-primary{background:var(--primary);color:#fff}.btn-primary:hover{background:var(--primary-dark)}.btn-primary:disabled{opacity:.55;cursor:wait}.btn-secondary{background:var(--surface);border-color:var(--line);color:var(--text)}.btn-small{padding:7px 11px;font-size:11px}.form-card{padding:23px;margin-bottom:18px}.step-badge{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:#e9f5fd;color:var(--primary);font-weight:800;font-size:12px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.three-col{grid-template-columns:repeat(3,minmax(0,1fr))}.two-col{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid label{display:flex;flex-direction:column;gap:7px;color:var(--text);font-weight:650;font-size:12px;min-width:0}.form-grid input,.form-grid select,.form-grid textarea,.list-toolbar input,.search-box input,.test-search-row select{width:100%;border:1px solid #dce5ed;border-radius:9px;background:var(--surface);color:var(--text);padding:11px 12px;min-height:41px;font-size:12px;font-weight:400}.form-grid textarea{resize:vertical}.span-3{grid-column:span 3}.test-search-row{display:grid;grid-template-columns:1fr 210px;gap:12px;margin-bottom:12px}.search-box{display:flex;align-items:center;border:1px solid #dce5ed;border-radius:10px;padding:0 10px;gap:8px;background:var(--surface);color:var(--muted)}.search-box input{border:0;outline:0!important;box-shadow:none!important}.search-box button{border:0;background:transparent;color:var(--muted);font-size:19px}.test-options{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-height:270px;overflow:auto;padding:1px}.test-option{display:flex;align-items:center;gap:10px;text-align:left;border:1px solid var(--line);border-radius:10px;padding:12px;background:var(--surface);color:var(--text);min-width:0}.test-option:hover{border-color:#92c8e8}.test-option.selected{border-color:var(--primary);background:#edf8ff}.test-check{width:20px;height:20px;border:1px solid #c6d6e3;border-radius:6px;display:grid;place-items:center;flex-shrink:0;color:#fff}.test-option.selected .test-check{background:var(--primary);border-color:var(--primary)}.test-option-main{min-width:0;flex:1}.test-option-name{font-size:12px;font-weight:700;display:block;overflow-wrap:anywhere}.test-option-meta{font-size:10px;color:var(--muted);display:block;margin-top:3px}.test-option-price{font-size:12px;font-weight:750;white-space:nowrap}.selected-heading{display:flex;justify-content:space-between;align-items:center;margin:22px 0 10px}.selected-tests{border:1px solid var(--line);border-radius:11px;overflow:hidden}.selected-row{display:grid;grid-template-columns:minmax(0,1fr) 78px 100px 34px;align-items:center;gap:10px;padding:12px;border-bottom:1px solid var(--line)}.selected-row:last-child{border-bottom:0}.selected-name{font-size:12px;font-weight:700}.selected-meta{display:block;color:var(--muted);font-size:10px;margin-top:3px}.qty-input{width:70px;border:1px solid var(--line);border-radius:7px;padding:7px;background:var(--surface);color:var(--text)}.remove-item{width:30px;height:30px;border:0;background:#fff0f0;color:#bd4c4c;border-radius:8px;font-size:17px}.selected-amount{text-align:right;font-size:12px;font-weight:750}.invoice-bottom{display:grid;grid-template-columns:minmax(0,1fr) minmax(250px,.8fr);gap:24px;align-items:start}.totals-panel{border:1px solid var(--line);border-radius:12px;background:var(--surface-2);padding:17px}.totals-panel>div{display:flex;justify-content:space-between;gap:15px;padding:7px 0;font-size:12px}.totals-panel span{color:var(--muted)}.totals-panel b{font-weight:650}.totals-panel .grand-total{border-top:1px solid var(--line);margin-top:5px;padding-top:14px;color:var(--text)}.grand-total strong{font-size:21px;letter-spacing:-.5px}.totals-panel .due-row{border-top:1px dashed #cbd8e4;margin-top:5px;padding-top:12px}.due-row strong{color:#bd8215;font-size:17px}.form-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:23px}.helper{font-size:11px;color:var(--muted);line-height:1.6}.full-width{grid-column:1/-1;width:100%}.auth-panel{max-width:760px;margin:8vh auto;padding:30px;display:grid;grid-template-columns:1fr 1fr;gap:32px;align-items:center}.auth-copy p{color:var(--muted);font-size:13px}.auth-copy .brand-mark{margin-bottom:18px}.auth-copy h2{margin-bottom:8px}.auth-panel .form-grid{gap:13px}.connection-banner{background:#fff2d6;color:#7c560b;padding:10px 16px;text-align:center;font-size:12px;font-weight:650}.notice{padding:12px 15px;border-radius:10px;margin-bottom:17px;background:#e6f6ed;color:#216c42;font-size:12px}.notice.error{background:#fff0ef;color:#a62d2d}.notice.info{background:#eaf5fd;color:#155e8b}.empty-state{padding:30px 15px;text-align:center;color:var(--muted);font-size:12px}.empty-state.compact{padding:18px}.table-wrap{overflow-x:auto}.data-table{border-collapse:collapse;width:100%;white-space:nowrap}.data-table th{text-align:left;background:var(--surface-2);color:var(--muted);font-size:10px;text-transform:uppercase;letter-spacing:.5px;padding:12px;border-bottom:1px solid var(--line)}.data-table td{padding:13px 12px;border-bottom:1px solid var(--line);font-size:12px}.data-table tr:last-child td{border-bottom:0}.list-toolbar{display:flex;gap:10px;margin-bottom:15px}.list-toolbar input{max-width:420px}.settings-row{display:flex;justify-content:space-between;gap:20px;padding:14px 0;border-bottom:1px solid var(--line);font-size:12px}.settings-row span{color:var(--muted)}.planned-panel{text-align:center;padding:70px 20px}.planned-panel p{max-width:520px;margin:0 auto;color:var(--muted);font-size:13px}.planned-icon{display:grid;place-items:center;margin:0 auto 18px;width:56px;height:56px;border-radius:16px;background:#e9f5fd;color:var(--primary);font-size:28px}.app-footer{display:flex;justify-content:space-between;color:var(--muted);font-size:10px;padding:10px 4px 0}.dialog{border:1px solid var(--line);border-radius:16px;padding:24px;width:min(540px,calc(100% - 24px));background:var(--surface);color:var(--text);box-shadow:0 20px 80px #071b2d30}.dialog::backdrop{background:#0b1f32a8}.dialog .card-heading{margin-bottom:22px}.dialog .form-grid{margin-bottom:10px}.dialog .form-actions{margin-top:20px}
body.dark{color-scheme:dark;--bg:#101a25;--surface:#172534;--surface-2:#1c2b3b;--text:#e6edf5;--muted:#9aabbd;--line:#2a3a4b;--primary:#2d98d3;--primary-dark:#187eb7;--sidebar:#0b1723;--shadow:0 5px 20px #00000015}body.dark .form-grid input,body.dark .form-grid select,body.dark .form-grid textarea,body.dark .list-toolbar input,body.dark .search-box,body.dark .test-search-row select{border-color:var(--line)}body.dark .pill{background:#203b50;color:#a4dfff}body.dark .test-option.selected{background:#1a3547}body.dark .quick-action>span,body.dark .step-badge,body.dark .planned-icon{background:#203b50;color:#a4dfff}body.dark .remove-item{background:#4a292d;color:#ffb4b4}
@media(max-width:1200px){.main-area{padding:0 22px 20px}.stats-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.quick-actions{grid-template-columns:repeat(2,minmax(0,1fr))}.three-col{grid-template-columns:repeat(2,minmax(0,1fr))}.span-3{grid-column:span 2}}@media(max-width:820px){.sidebar{transform:translateX(-100%);transition:transform .2s ease;box-shadow:10px 0 30px #0002;z-index:30}.sidebar.open{transform:translateX(0)}.sidebar-overlay{position:fixed;inset:0;background:rgba(8,20,32,.48);z-index:29;border:0;padding:0;margin:0;opacity:0;visibility:hidden;pointer-events:none;transition:opacity .2s ease,visibility .2s ease}.sidebar-overlay.open{opacity:1;visibility:visible;pointer-events:none}.sidebar.open{z-index:31}.sidebar-overlay{touch-action:manipulation}body.sidebar-open{overflow:hidden;overscroll-behavior:none}body.sidebar-open .sidebar{touch-action:pan-y}.main-area{margin-left:0;padding:0 15px 18px}.mobile-menu{display:block;margin-right:12px}.topbar{min-height:82px;margin-bottom:20px}.topbar>div:nth-child(2){margin-right:auto}.topbar h1{font-size:21px}.top-actions{gap:8px}.top-actions #today-label{display:none}.auth-panel{margin:5vh auto;grid-template-columns:1fr;gap:20px;padding:23px}.auth-copy .brand-mark{margin-bottom:10px}.welcome-row,.section-intro{align-items:flex-start}.section-intro{flex-direction:column}.invoice-bottom{grid-template-columns:1fr}.test-search-row{grid-template-columns:1fr}.test-options{grid-template-columns:1fr}.form-card,.card{padding:17px}.selected-row{grid-template-columns:minmax(0,1fr) 60px 78px 30px;gap:6px;padding:10px}.qty-input{width:55px}.app-footer span{display:none}}@media(max-width:520px){.stats-grid{gap:9px}.stat-card{padding:13px}.stat-card strong{font-size:22px}.stat-icon{margin-bottom:10px}.quick-actions{gap:8px}.quick-action{padding:12px}.form-grid,.three-col,.two-col{grid-template-columns:1fr}.span-3{grid-column:span 1}.welcome-row{flex-direction:column}.welcome-row .btn{width:100%}.form-actions{flex-direction:column-reverse}.form-actions .btn{width:100%}.selected-row{grid-template-columns:minmax(0,1fr) 52px 65px 28px}.selected-amount{font-size:11px}.qty-input{width:49px;padding:6px}.card-heading{align-items:flex-start}.pill{font-size:10px}.list-toolbar{flex-direction:column}.list-toolbar input{max-width:none}.app-footer{padding-bottom:8px}}

.invoice-preview-dialog{width:min(760px,calc(100% - 20px));max-width:760px;max-height:92vh;overflow:auto}.invoice-preview-dialog #invoice-preview-content{background:#fff;color:#111;padding:16px;border:1px solid #e5e7eb;border-radius:8px}.print-invoice{font:12px/1.4 Arial,sans-serif;color:#111}.print-head{text-align:center;border-bottom:1px solid #333;padding-bottom:10px;margin-bottom:12px}.print-brand{font-size:22px;font-weight:800;letter-spacing:1.4px}.print-subtitle{font-size:11px}.print-head h2{font-size:16px;margin:8px 0 4px}.print-invoice-no{font-size:12px}.print-patient-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px 16px;margin:12px 0 16px}.print-patient-grid div{display:flex;flex-direction:column;min-width:0;overflow-wrap:anywhere}.print-patient-grid span,.print-totals span{color:#555;font-size:11px}.print-patient-grid b{font-size:12px}.print-items{width:100%;border-collapse:collapse;font-size:10px}.print-items th,.print-items td{border:1px solid #888;padding:6px 5px;text-align:left;overflow-wrap:anywhere}.print-items th{background:#f1f3f5}.print-items .num{text-align:right;white-space:nowrap}.print-totals{width:min(320px,70%);margin:12px 0 0 auto}.print-totals div{display:flex;justify-content:space-between;gap:12px;padding:4px 0;border-bottom:1px solid #ddd}.print-totals b{text-align:right;white-space:nowrap}.print-totals .print-grand{font-size:14px;border-top:1px solid #333;border-bottom:1px solid #333;padding:7px 0}.print-footer{display:flex;justify-content:space-between;gap:12px;margin-top:26px;padding-top:10px;font-size:10px;break-inside:avoid}.preview-actions{position:sticky;bottom:0;background:var(--surface);padding-top:12px}
@media print{@page{size:A5 portrait;margin:4mm}body.print-invoice-mode{background:#fff!important;margin:0!important;padding:0!important}body.print-invoice-mode *{visibility:hidden!important}body.print-invoice-mode #invoice-preview-dialog,body.print-invoice-mode #invoice-preview-dialog *{visibility:visible!important}body.print-invoice-mode #invoice-preview-dialog{position:static!important;inset:auto!important;width:100%!important;max-width:none!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#fff!important;color:#111!important;display:block!important}body.print-invoice-mode #invoice-preview-dialog::backdrop{display:none!important}body.print-invoice-mode #invoice-preview-dialog .card-heading,body.print-invoice-mode #invoice-preview-dialog .preview-actions{display:none!important}body.print-invoice-mode #invoice-preview-content{border:0!important;border-radius:0!important;padding:0!important;margin:0!important}body.print-invoice-mode #invoice-preview-content .print-invoice{font-size:9pt!important}.print-brand{font-size:17pt!important}.print-subtitle{font-size:8pt!important}.print-head h2{font-size:13pt!important}.print-patient-grid{gap:5px 10px!important;margin:7px 0 10px!important}.print-patient-grid span,.print-totals span{font-size:7pt!important}.print-patient-grid b{font-size:8pt!important}.print-items{font-size:7pt!important}.print-items th,.print-items td{padding:3px 2px!important}.print-totals{width:65%!important;margin-top:8px!important}.print-totals div{padding:2px 0!important}.print-footer{margin-top:15px!important;font-size:7pt!important}tr,td,th,.print-totals,.print-patient-grid{break-inside:avoid!important}}

.lab-report-sheet{background:#fff;color:#111;padding:20px;font:12px/1.45 Arial,sans-serif;border:1px solid #ddd}.lab-report-header{text-align:center;border-bottom:2px solid #222;padding-bottom:12px;margin-bottom:14px}.lab-report-brand{font-size:22px;font-weight:800;letter-spacing:1.3px}.lab-report-header h2{font-size:17px;margin:10px 0 0}.lab-report-patient{display:grid;grid-template-columns:1fr 1fr;gap:9px 16px;margin:12px 0 18px}.lab-report-patient div{display:flex;flex-direction:column;overflow-wrap:anywhere}.lab-report-patient span{font-size:10px;color:#555}.lab-report-patient b{font-size:12px}.lab-report-values{width:100%;border-collapse:collapse;font-size:11px}.lab-report-values th,.lab-report-values td{border:1px solid #777;padding:7px 6px;text-align:left;overflow-wrap:anywhere}.lab-report-values th{background:#f1f3f5}.lab-report-notes{margin-top:14px}.lab-report-footer{display:flex;justify-content:space-between;gap:14px;margin-top:34px;padding-top:10px;border-top:1px solid #ddd;font-size:10px;break-inside:avoid}
@media print{@page{size:A4 portrait;margin:8mm}body.print-report-mode{background:#fff!important;margin:0!important;padding:0!important}body.print-report-mode *{visibility:hidden!important}body.print-report-mode #report-preview-dialog,body.print-report-mode #report-preview-dialog *{visibility:visible!important}body.print-report-mode #report-preview-dialog{position:static!important;inset:auto!important;width:100%!important;max-width:none!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;background:#fff!important;color:#111!important;display:block!important}body.print-report-mode #report-preview-dialog::backdrop{display:none!important}body.print-report-mode #report-preview-dialog .card-heading,body.print-report-mode #report-preview-dialog .preview-actions{display:none!important}body.print-report-mode #report-preview-content{margin:0!important;padding:0!important;border:0!important}body.print-report-mode #report-preview-content .lab-report-sheet{border:0!important;padding:0!important;font-size:10pt!important}.lab-report-brand{font-size:20pt!important}.lab-report-header h2{font-size:15pt!important}.lab-report-patient{gap:6px 12px;margin:10px 0 14px!important}.lab-report-patient span{font-size:8pt!important}.lab-report-patient b{font-size:9pt!important}.lab-report-values{font-size:9pt!important}.lab-report-values th,.lab-report-values td{padding:5px!important}.lab-report-footer{margin-top:28px!important;font-size:8pt!important}}

.row-actions{display:flex;flex-wrap:wrap;gap:6px;min-width:150px}.date-filter-label{display:flex;flex-direction:column;gap:5px;min-width:125px;font-size:12px;color:var(--muted)}.date-filter-label input{min-width:0}.data-table td small{display:block;color:var(--muted);font-size:11px;margin-top:3px}

/* Searchable invoice test picker: results behave like a dropdown, not a permanent catalog list. */
.test-picker{position:relative;margin-bottom:14px}.test-picker .test-search-row{margin-bottom:0}.test-picker .test-options{position:absolute;z-index:8;top:calc(100% + 5px);left:0;right:0;display:block;max-height:260px;overflow:auto;padding:6px;background:var(--surface);border:1px solid var(--line);border-radius:12px;box-shadow:0 12px 30px #102b431c}.test-picker .test-options[hidden]{display:none!important}.test-picker .test-options .test-option{width:100%;margin:3px 0}.selected-test-action{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:9px}.selected-test-action span{font-size:12px;color:var(--text);font-weight:650}.selected-test-action [hidden]{display:none!important}.selected-test-action .btn[hidden]{display:none!important}.test-picker .test-search-row{position:relative}

#result-machine-field[hidden]{display:none!important}

.install-app-button{white-space:nowrap;padding:9px 12px}.install-app-button[hidden]{display:none!important}@media(max-width:520px){.install-app-button{padding:8px 9px;font-size:11px}}

@media print{body.print-invoice-mode #invoice-preview-dialog{break-inside:auto!important;page-break-inside:auto!important}body.print-invoice-mode #print-invoice-sheet{break-inside:avoid-page!important;page-break-inside:avoid!important}body.print-report-mode #report-preview-dialog{break-inside:auto!important;page-break-inside:auto!important}body.print-report-mode .lab-report-sheet{break-after:page;page-break-after:always;break-inside:auto!important;page-break-inside:auto!important}body.print-report-mode .lab-report-sheet:last-child{break-after:auto;page-break-after:auto}body.print-report-mode .lab-report-values tr{break-inside:avoid;page-break-inside:avoid}}

/* Multi-test invoice report entry and grouped print controls. */
.report-test-card{border:1px solid var(--line);border-radius:12px;padding:16px;margin:14px 0;background:var(--surface)}
.report-test-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:14px}
.report-test-heading h4{font-size:14px;margin:0 0 4px}.report-test-heading p{margin:0}
.report-test-fields{margin-bottom:12px}.report-notes-label{display:flex;flex-direction:column;gap:7px;font-size:12px;font-weight:650}
.report-notes-label textarea{width:100%;border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--text);padding:10px;font:inherit;font-weight:400}
.report-print-actions{display:flex;flex-wrap:wrap;justify-content:flex-start;gap:8px}
.report-print-actions .btn{white-space:normal}
body.print-report-mode #report-preview-content .lab-report-sheet{break-after:page;page-break-after:always}
body.print-report-mode #report-preview-content .lab-report-sheet:last-child{break-after:auto;page-break-after:auto}
@media(max-width:520px){.report-test-card{padding:12px}.report-test-heading{flex-direction:column}.report-print-actions{flex-direction:column}.report-print-actions .btn{width:100%}}

/* Diagnostic report layout based on the supplied reference template. */
.lab-report-sheet{background:#fff;color:#111;padding:10mm;min-height:250mm;font-family:Arial,Helvetica,sans-serif;font-size:10pt;line-height:1.25}
.lab-report-brand{text-align:center;font-size:21pt;font-weight:800;letter-spacing:.8px;color:#111}
.lab-report-subtitle{text-align:center;font-size:9pt;margin-bottom:10px}
.lab-report-patient-box{display:grid;grid-template-columns:minmax(0,1fr) 76px;gap:5px 10px;border:1.4px solid #555;padding:7px;margin:10px 0 18px}
.lab-report-info-grid{display:grid;grid-template-columns:1fr 1fr;gap:5px 14px}
.lab-report-info-grid>div{display:grid;grid-template-columns:100px minmax(0,1fr);gap:5px;align-items:start}
.lab-report-info-grid span,.lab-report-referrer span{white-space:nowrap}
.lab-report-info-grid b,.lab-report-referrer b{font-weight:700;overflow-wrap:anywhere}
.lab-report-code{border:1px solid #333;display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:64px;text-align:center}
.lab-report-code strong{font-size:27px;letter-spacing:1px;border:3px solid #111;padding:2px 5px;line-height:1}
.lab-report-code small{font-size:7pt;margin-top:4px;overflow-wrap:anywhere}
.lab-report-referrer{grid-column:1/-1;display:grid;grid-template-columns:100px 1fr;gap:5px;border-top:1px solid #bbb;padding-top:5px}
.lab-report-title{text-align:center;text-decoration:underline;text-underline-offset:3px;font-size:17pt;line-height:1.2;margin:16px 0 18px;font-weight:800}
.lab-report-test-block{margin:0 0 12px;break-inside:auto;page-break-inside:auto}
.lab-report-test-block>h3{font-size:12pt;font-weight:800;margin:12px 0 5px}
.lab-report-values{width:100%;border-collapse:collapse;font-size:9.5pt;margin:4px 0 10px}
.lab-report-values th,.lab-report-values td{border:1px solid #666;padding:5px 7px;text-align:left;vertical-align:top}
.lab-report-values th{font-size:10pt;text-align:center;font-weight:800}
.lab-report-values th:first-child{width:43%}.lab-report-values th:nth-child(2){width:24%}.lab-report-values th:last-child{width:33%}
.lab-report-values tr.abnormal-result td{font-weight:700}
.report-unit{font-weight:400}
.lab-report-notes{margin:8px 0;font-size:9pt}
.lab-report-signatures{display:flex;justify-content:space-between;gap:30px;margin-top:48px;padding-top:12px;font-size:9pt;break-inside:avoid;page-break-inside:avoid}
.lab-report-signatures>div{display:flex;flex-direction:column;min-width:35%;gap:3px}
.lab-report-signatures>div:last-child{text-align:left}
@media(max-width:650px){.lab-report-sheet{padding:12px}.lab-report-info-grid{grid-template-columns:1fr}.lab-report-info-grid>div{grid-template-columns:92px 1fr}.lab-report-patient-box{grid-template-columns:minmax(0,1fr) 60px}.lab-report-referrer{grid-template-columns:92px 1fr}.lab-report-signatures{gap:12px;font-size:8pt}}
@media print{
 body.print-report-mode #report-preview-content .lab-report-sheet{padding:0!important;min-height:0!important;font-size:9pt!important;color:#111!important}
 body.print-report-mode .lab-report-brand{font-size:19pt!important}
 body.print-report-mode .lab-report-title{font-size:15pt!important;margin:12px 0!important}
 body.print-report-mode .lab-report-patient-box{margin:8px 0 12px!important;padding:6px!important}
 body.print-report-mode .lab-report-values{font-size:8.5pt!important}
 body.print-report-mode .lab-report-values th,body.print-report-mode .lab-report-values td{padding:4px 5px!important}
 body.print-report-mode .lab-report-test-block>h3{font-size:10pt!important}
 body.print-report-mode .lab-report-signatures{margin-top:30px!important}
}

.lab-report-code-qr{width:68px;height:68px;display:flex;align-items:center;justify-content:center;background:#fff}.lab-report-code-qr img,.lab-report-code-qr canvas{max-width:68px;max-height:68px}.lab-report-code-qr.qr-fallback{font-size:12px;font-weight:800;overflow-wrap:anywhere;text-align:center}
@media print{body.print-report-mode .lab-report-code-qr{width:68px!important;height:68px!important}body.print-report-mode .lab-report-code-qr img,body.print-report-mode .lab-report-code-qr canvas{max-width:68px!important;max-height:68px!important}}

/* Group-wise laboratory report: subgroup headings live inside one shared results table. */
.lab-report-values .report-subgroup-row td{font-size:11pt;font-weight:800;text-align:left;background:#fff;padding:8px 6px 4px;border-left:0;border-right:0;border-top:1px dotted #777}
.lab-report-values .report-comment-row td{font-size:9pt;font-weight:400;text-align:left}
@media print{
 @page{size:A4 portrait;margin:8mm}
 body.print-report-mode #report-preview-content .lab-report-sheet{break-after:page;page-break-after:always;min-height:0!important}
 body.print-report-mode #report-preview-content .lab-report-sheet:last-child{break-after:auto;page-break-after:auto}
 body.print-report-mode .lab-report-values .report-subgroup-row{break-after:avoid;page-break-after:avoid}
}

/* Refined reference-style report spacing and alignment. */
.lab-report-sheet{padding:0!important;min-height:0!important;position:relative}
.lab-report-top-spacer{height:1.5in;min-height:1.5in;width:100%}
.lab-report-header{border-bottom:0!important;padding-bottom:0!important;margin-bottom:0!important;text-align:left!important}
.lab-report-patient-box{text-align:left!important;margin:0 0 12px!important;align-items:start}
.lab-report-info-grid{text-align:left!important}
.lab-report-info-grid>div{justify-items:start!important;text-align:left!important;grid-template-columns:100px minmax(0,1fr)!important}
.lab-report-info-grid span,.lab-report-info-grid b,.lab-report-referrer span,.lab-report-referrer b{text-align:left!important}
.lab-report-referrer{justify-items:start!important;text-align:left!important}
.lab-report-title{text-align:center!important;margin:12px 0 14px!important;border-bottom:2px solid #222;padding-bottom:10px}
.lab-report-signatures{margin-top:0!important;padding-top:0!important;position:relative;min-height:42px}
@media print{
 @page{size:A4 portrait;margin:0.5in}
 body.print-report-mode #report-preview-content .lab-report-sheet{padding:0!important;min-height:0!important;position:relative}
 body.print-report-mode .lab-report-top-spacer{height:1.5in!important;min-height:1.5in!important}
 body.print-report-mode .lab-report-patient-box{margin-bottom:10px!important}
 body.print-report-mode .lab-report-signatures{position:fixed;left:0;right:0;bottom:0.5in;margin:0!important;padding:0 0 0!important;min-height:38px!important;background:#fff}
 body.print-report-mode .lab-report-signatures>div{max-width:42%}
 body.print-report-mode .lab-report-title{margin:10px 0 12px!important}
}

/* Report pagination fix: never pin the footer to the viewport during print. */
.lab-report-sheet{box-sizing:border-box;display:flex;flex-direction:column;min-height:11.69in;padding:0 var(--report-right-space,.5in) var(--report-bottom-space,.5in) var(--report-left-space,.5in)!important;margin:0!important;position:relative!important;overflow:visible!important}
.lab-report-top-spacer{height:var(--report-top-space,1.5in)!important;min-height:var(--report-top-space,1.5in)!important;position:relative;box-sizing:border-box}
.lab-report-configured-brand{position:absolute;left:0;right:0;top:0;text-align:center;font-size:18pt;font-weight:800;color:#111}
.lab-report-header{flex:0 0 auto}
.lab-report-values{flex:0 0 auto}
.lab-report-signatures{position:static!important;left:auto!important;right:auto!important;bottom:auto!important;margin-top:auto!important;padding-top:12px!important;padding-bottom:0!important;break-inside:avoid!important;page-break-inside:avoid!important;flex:0 0 auto}
.lab-report-custom-footer{font-size:8.5pt;text-align:center;width:100%;margin-top:6px}
@media print{
 @page{size:A4 portrait;margin:0}
 body.print-report-mode #report-preview-dialog{position:static!important;display:block!important;visibility:visible!important;width:100%!important;max-width:none!important;max-height:none!important;height:auto!important;overflow:visible!important;border:0!important;padding:0!important;margin:0!important;box-shadow:none!important}
 body.print-report-mode #report-preview-dialog>.card-heading,
 body.print-report-mode #report-preview-dialog>.preview-actions{display:none!important}
 body.print-report-mode #report-preview-content{display:block!important;width:100%!important;margin:0!important;padding:0!important}
 body.print-report-mode #report-preview-content .lab-report-sheet{display:flex!important;box-sizing:border-box!important;width:100%!important;min-height:11.69in!important;height:auto!important;margin:0!important;padding:0 var(--report-right-space,.5in) var(--report-bottom-space,.5in) var(--report-left-space,.5in)!important;position:relative!important;overflow:visible!important;break-inside:auto!important;page-break-inside:auto!important;break-after:page!important;page-break-after:always!important}
 body.print-report-mode #report-preview-content .lab-report-sheet:last-child{break-after:auto!important;page-break-after:auto!important}
 body.print-report-mode .lab-report-top-spacer{height:var(--report-top-space,1.5in)!important;min-height:var(--report-top-space,1.5in)!important}
 body.print-report-mode .lab-report-signatures{position:static!important;left:auto!important;right:auto!important;bottom:auto!important;margin-top:auto!important;padding-top:12px!important;break-inside:avoid!important;page-break-inside:avoid!important}
 body.print-report-mode .lab-report-header,body.print-report-mode .lab-report-values{break-inside:auto!important;page-break-inside:auto!important}
 body.print-report-mode .lab-report-values tr{break-inside:avoid!important;page-break-inside:avoid!important}
}

/* Final blank-page fix: let each group report use natural content height. */
@media print{
 @page{size:A4 portrait;margin:8mm}
 html,body{height:auto!important;min-height:0!important;overflow:visible!important}
 body.print-report-mode #report-preview-dialog{position:static!important;inset:auto!important;display:block!important;width:100%!important;max-width:none!important;height:auto!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important}
 body.print-report-mode #report-preview-content{display:block!important;width:100%!important;height:auto!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important}
 body.print-report-mode #report-preview-content .lab-report-sheet{display:block!important;box-sizing:border-box!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;padding-top:var(--report-top-space,1.5in)!important;padding-right:var(--report-right-space,.5in)!important;padding-bottom:var(--report-bottom-space,.5in)!important;padding-left:var(--report-left-space,.5in)!important;overflow:visible!important;position:static!important;break-inside:auto!important;page-break-inside:auto!important;break-after:auto!important;page-break-after:auto!important}
 body.print-report-mode #report-preview-content .lab-report-sheet:not(:first-child){break-before:page!important;page-break-before:always!important}
 body.print-report-mode #report-preview-content .lab-report-sheet:first-child{break-before:auto!important;page-break-before:auto!important}
 body.print-report-mode #report-preview-content .lab-report-sheet:last-child{break-after:auto!important;page-break-after:auto!important}
 body.print-report-mode .lab-report-top-spacer{height:0!important;min-height:0!important;position:relative!important}
 body.print-report-mode .lab-report-signatures{display:flex!important;position:static!important;left:auto!important;right:auto!important;bottom:auto!important;min-height:0!important;margin-top:24px!important;padding-top:8px!important;break-inside:avoid!important;page-break-inside:avoid!important}
 body.print-report-mode .lab-report-values,body.print-report-mode .lab-report-values tbody{overflow:visible!important}
 body.print-report-mode .lab-report-values tr{break-inside:avoid!important;page-break-inside:avoid!important}
 body.print-report-mode #report-preview-dialog>.card-heading,body.print-report-mode #report-preview-dialog>.preview-actions{display:none!important}
}

/* Sample-matched laboratory result table: crisp outer frame, balanced columns, dotted result rows. */
.lab-report-values{width:100%!important;border-collapse:collapse!important;border-spacing:0!important;table-layout:fixed!important;margin:8px 0 12px!important;border:1.2px solid #333!important;color:#111!important;background:#fff!important;font-size:9.2pt!important;line-height:1.25!important}
.lab-report-values thead{display:table-header-group}
.lab-report-values thead tr{break-inside:avoid!important;page-break-inside:avoid!important}
.lab-report-values thead th{border:1px solid #333!important;background:#fff!important;color:#111!important;font-weight:800!important;text-align:center!important;vertical-align:middle!important;padding:5px 6px!important}
.lab-report-values thead th:nth-child(1),.lab-report-values tbody td:nth-child(1){width:30%!important}
.lab-report-values thead th:nth-child(2),.lab-report-values tbody td:nth-child(2){width:25%!important}
.lab-report-values thead th:nth-child(3),.lab-report-values tbody td:nth-child(3){width:45%!important}
.lab-report-values tbody td{border:1px dotted #777!important;padding:4px 6px!important;vertical-align:middle!important;overflow-wrap:anywhere!important;background:#fff!important;color:#111!important}
.lab-report-values tbody td:nth-child(1){text-align:left!important;font-weight:600!important}
.lab-report-values tbody td:nth-child(2),.lab-report-values tbody td:nth-child(3){text-align:center!important}
.lab-report-values .report-subgroup-row td{border-top:0!important;border-bottom:0!important;border-left:0!important;border-right:0!important;padding:8px 0 3px!important;font-size:10.5pt!important;font-weight:800!important;text-align:left!important;line-height:1.2!important;background:#fff!important}
.lab-report-values .report-subgroup-row:first-child td{padding-top:6px!important}
.lab-report-values .report-comment-row td{border:1px dotted #777!important;text-align:left!important;font-weight:400!important;padding:5px 6px!important}
.lab-report-values .abnormal-result td{font-weight:800!important}
@media print{
 body.print-report-mode .lab-report-values{width:100%!important;border:1.2px solid #333!important;border-collapse:collapse!important;table-layout:fixed!important;font-size:9pt!important;margin:8px 0 12px!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
 body.print-report-mode .lab-report-values thead th{border:1px solid #333!important;padding:5px 6px!important}
 body.print-report-mode .lab-report-values tbody td{border:1px dotted #777!important;padding:4px 6px!important}
 body.print-report-mode .lab-report-values .report-subgroup-row td{border-left:0!important;border-right:0!important;border-bottom:0!important;border-top:0!important;padding:8px 0 3px!important}
 body.print-report-mode .lab-report-values .report-comment-row td{border:1px dotted #777!important}
}

/* Report pagination/signature final override: avoid double page breaks and fit within A4 printable area. */
.lab-report-sheet{display:flex;flex-direction:column;box-sizing:border-box;min-height:10.7in!important;height:auto!important;overflow:visible!important}
.lab-report-end-report{font-size:9pt;font-weight:700;text-align:center;margin:14px 0 4px;padding-top:5px;border-top:1px solid #555;break-inside:avoid;page-break-inside:avoid}
.lab-report-electronic-signature{display:block;object-fit:contain;object-position:left center;width:auto;max-width:190px;height:44px;margin:2px 0 3px;background:#fff}
.lab-report-signature-placeholder{display:block;font-size:8.5pt;margin:8px 0 3px}
.lab-report-signatures{margin-top:auto!important;padding-top:8px!important;min-height:0!important;break-inside:avoid!important;page-break-inside:avoid!important}
@media print{
 @page{size:A4 portrait;margin:0}
 html,body{height:auto!important;min-height:0!important;overflow:visible!important}
 body.print-report-mode #report-preview-dialog{position:static!important;inset:auto!important;display:block!important;width:100%!important;max-width:none!important;height:auto!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important}
 body.print-report-mode #report-preview-dialog>.card-heading,body.print-report-mode #report-preview-dialog>.preview-actions{display:none!important}
 body.print-report-mode #report-preview-content{display:block!important;width:100%!important;height:auto!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important}
 body.print-report-mode #report-preview-content .lab-report-sheet{display:flex!important;flex-direction:column!important;box-sizing:border-box!important;width:100%!important;min-height:10.7in!important;height:auto!important;max-height:none!important;margin:0!important;padding:var(--report-top-space,1.5in) var(--report-right-space,.5in) var(--report-bottom-space,.5in) var(--report-left-space,.5in)!important;position:static!important;overflow:visible!important;break-before:auto!important;page-break-before:auto!important;break-after:page!important;page-break-after:always!important;break-inside:auto!important;page-break-inside:auto!important}
 body.print-report-mode #report-preview-content .lab-report-sheet:last-child{break-after:auto!important;page-break-after:auto!important}
 body.print-report-mode .lab-report-top-spacer{height:0!important;min-height:0!important}
 body.print-report-mode .lab-report-signatures{display:flex!important;position:static!important;left:auto!important;right:auto!important;bottom:auto!important;margin-top:auto!important;padding-top:8px!important;padding-bottom:0!important;break-inside:avoid!important;page-break-inside:avoid!important}
 body.print-report-mode .lab-report-end-report{margin:12px 0 4px!important;border-top:1px solid #555!important;break-inside:avoid!important;page-break-inside:avoid!important}
 body.print-report-mode .lab-report-electronic-signature{max-width:190px!important;height:44px!important;object-fit:contain!important}
 body.print-report-mode .lab-report-values tr{break-inside:avoid!important;page-break-inside:avoid!important}
}

/* Result column: visually remove internal cell borders; keep value and unit together. */
.lab-report-values tbody td.report-result-cell{border-left:0!important;border-right:0!important;display:table-cell!important;text-align:center!important;white-space:normal!important}
.lab-report-values .report-result-value{display:inline;font-weight:inherit}
.lab-report-values .report-result-unit{display:inline;margin-left:5px;font-size:.95em;white-space:nowrap}
@media print{
 body.print-report-mode .lab-report-values tbody td.report-result-cell{border-left:0!important;border-right:0!important;text-align:center!important}
 body.print-report-mode .lab-report-values .report-result-unit{display:inline!important;margin-left:5px!important;white-space:nowrap!important}
}

/* Print isolation: visibility:hidden keeps the whole application in document flow and creates blank pages.
   Remove the app shell from print layout and print only the active preview dialog. */
@media print{
 @page{size:auto;margin:0}
 body.print-report-mode,body.print-invoice-mode{display:block!important;position:static!important;width:auto!important;height:auto!important;min-height:0!important;overflow:visible!important;margin:0!important;padding:0!important;background:#fff!important}
 body.print-report-mode #app,body.print-invoice-mode #app,
 body.print-report-mode .app-shell,body.print-invoice-mode .app-shell,
 body.print-report-mode .app-layout,body.print-invoice-mode .app-layout{display:none!important}
 body.print-report-mode> :not(#report-preview-dialog),
 body.print-invoice-mode> :not(#invoice-preview-dialog){display:none!important}
 body.print-report-mode #report-preview-dialog,body.print-invoice-mode #invoice-preview-dialog{display:block!important;position:static!important;inset:auto!important;float:none!important;clear:both!important;visibility:visible!important;width:100%!important;height:auto!important;min-height:0!important;max-width:none!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;transform:none!important}
 body.print-report-mode #report-preview-dialog *,body.print-invoice-mode #invoice-preview-dialog *{visibility:visible!important}
 body.print-report-mode #report-preview-content,body.print-invoice-mode #invoice-preview-content{display:block!important;position:static!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important}
 body.print-report-mode #report-preview-content .lab-report-sheet{break-after:page!important;page-break-after:always!important;break-inside:auto!important;page-break-inside:auto!important}
 body.print-report-mode #report-preview-content .lab-report-sheet:last-child{break-after:auto!important;page-break-after:auto!important}
 body.print-invoice-mode #print-invoice-sheet{break-after:auto!important;page-break-after:auto!important;break-inside:auto!important;page-break-inside:auto!important}
}
/* Make the complete Result cell border invisible, not just its left/right edges. */
.lab-report-values tbody td.report-result-cell,
body.print-report-mode .lab-report-values tbody td.report-result-cell{
 border:0!important;border-color:transparent!important;outline:0!important;box-shadow:none!important;background:transparent!important;
}

/* Print only the dedicated cloned page; avoids modal/top-layer and hidden-shell pagination bugs. */
@media print{
 body.print-report-mode> :not(#lab-report-print-root),
 body.print-invoice-mode> :not(#lab-invoice-print-root){display:none!important}
 body.print-report-mode #lab-report-print-root,
 body.print-invoice-mode #lab-invoice-print-root{display:block!important;visibility:visible!important;position:static!important;float:none!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;margin:0!important;padding:0!important;border:0!important;box-shadow:none!important;background:#fff!important;color:#111!important}
 body.print-report-mode #lab-report-print-root *,
 body.print-invoice-mode #lab-invoice-print-root *{visibility:visible!important}
 body.print-report-mode #lab-report-print-root .lab-report-sheet{display:block!important;position:static!important;box-sizing:border-box!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;padding-top:var(--report-top-space,1.5in)!important;padding-right:var(--report-right-space,.5in)!important;padding-bottom:var(--report-bottom-space,.5in)!important;padding-left:var(--report-left-space,.5in)!important;overflow:visible!important;break-before:auto!important;page-break-before:auto!important;break-after:page!important;page-break-after:always!important;break-inside:auto!important;page-break-inside:auto!important}
 body.print-report-mode #lab-report-print-root .lab-report-sheet:last-child{break-after:auto!important;page-break-after:auto!important}
 body.print-report-mode #lab-report-print-root .lab-report-top-spacer{height:0!important;min-height:0!important}
 body.print-report-mode #lab-report-print-root .lab-report-signatures{display:flex!important;position:static!important;margin-top:24px!important;padding-top:8px!important;break-inside:avoid!important;page-break-inside:avoid!important}
 body.print-report-mode #lab-report-print-root .lab-report-values{width:100%!important;border:1px solid #333!important;border-collapse:collapse!important}
 body.print-report-mode #lab-report-print-root .lab-report-values thead th{border-top:1px solid #333!important;border-bottom:1px solid #333!important;border-left:0!important;border-right:0!important}
 body.print-report-mode #lab-report-print-root .lab-report-values tbody td{border-top:1px dotted #777!important;border-bottom:1px dotted #777!important;border-left:0!important;border-right:0!important}
 body.print-report-mode #lab-report-print-root .lab-report-values tbody td.report-result-cell{border:0!important;outline:0!important;box-shadow:none!important}
 body.print-report-mode #lab-report-print-root .lab-report-values .report-subgroup-row td{border:0!important}
 body.print-invoice-mode #lab-invoice-print-root #print-invoice-sheet{display:block!important;position:static!important;width:100%!important;height:auto!important;min-height:0!important;max-height:none!important;margin:0!important;padding:0!important;border:0!important;overflow:visible!important;break-before:auto!important;break-after:auto!important;page-break-before:auto!important;page-break-after:auto!important;break-inside:auto!important;page-break-inside:auto!important}
}


/* Requested report table rules: keep the outside frame and horizontal row rules only. */
.lab-report-values tbody td:nth-child(1){border-right:0!important}
.lab-report-values tbody td:nth-child(3){border-left:0!important}
.lab-report-values tbody td.report-result-cell{border-top:1px dotted #777!important;border-bottom:1px dotted #777!important;border-left:0!important;border-right:0!important;outline:0!important;box-shadow:none!important;background:#fff!important}
.lab-report-signatures{margin-top:auto!important;padding-top:8px!important}
.lab-report-authorized-block{margin-bottom:.5in!important;break-inside:avoid!important;page-break-inside:avoid!important}
.lab-report-signatory-name{font-weight:800!important}
@media print{
 body.print-report-mode #lab-report-print-root .lab-report-sheet{display:flex!important;flex-direction:column!important;min-height:10.7in!important;height:auto!important;position:static!important;break-before:auto!important;page-break-before:auto!important;break-after:page!important;page-break-after:always!important;padding-top:var(--report-top-space,1.5in)!important;padding-right:var(--report-right-space,.5in)!important;padding-bottom:var(--report-bottom-space,.5in)!important;padding-left:var(--report-left-space,.5in)!important}
 body.print-report-mode #lab-report-print-root .lab-report-sheet:last-child{break-after:auto!important;page-break-after:auto!important}
 body.print-report-mode #lab-report-print-root .lab-report-signatures{display:flex!important;flex-direction:row!important;flex-wrap:wrap!important;margin-top:auto!important;padding-top:8px!important}
 body.print-report-mode #lab-report-print-root .lab-report-authorized-block{margin-bottom:.5in!important}
 body.print-report-mode #lab-report-print-root .lab-report-values tbody td:nth-child(1){border-right:0!important}
 body.print-report-mode #lab-report-print-root .lab-report-values tbody td:nth-child(2){border-top:1px dotted #777!important;border-bottom:1px dotted #777!important;border-left:0!important;border-right:0!important;outline:0!important;box-shadow:none!important}
 body.print-report-mode #lab-report-print-root .lab-report-values tbody td:nth-child(3){border-left:0!important}
}


/* Warm cream application surfaces improve text contrast without changing report print paper. */
:root{--bg:#f5f0e5;--surface:#fffaf0;--surface-2:#f8f1e4;--line:#ded5c5;--text:#252d35;--muted:#626f7d}
.card,.stat-card,.auth-panel,.dialog:not(.invoice-preview-dialog){background:var(--surface)}
.form-grid input,.form-grid select,.form-grid textarea,.list-toolbar input,.search-box,.test-search-row select{background:#fffdf7;color:var(--text)}
.data-table th{background:#eee5d5;color:#263442}
body.dark{--bg:#101a25;--surface:#172534;--surface-2:#1c2b3b;--text:#e6edf5;--muted:#9aabbd;--line:#2a3a4b}
.btn-printed{background:#18794e!important;border-color:#18794e!important;color:#fff!important;box-shadow:0 0 0 1px #18794e22}
.btn-printed::after{content:"";}
.ultrasound-signatory{margin-left:auto!important;min-width:220px!important}


/* Settings submenu: clear hierarchy and scalable nested pages. */
.settings-subitem{padding-left:18px!important;font-size:12px!important;border-radius:8px!important;margin:1px 0!important}
.settings-subitem>span{font-size:15px!important;width:18px!important}
.settings-subitem.active{background:#ffffff20!important;box-shadow:inset 3px 0 #7dd3fc!important;color:#fff!important}
.settings-page[hidden]{display:none!important}


/* Compact date/search filters for today-first patient and report workflows. */
.report-filters{display:flex;align-items:end;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.report-filters .date-filter-label{min-width:155px;margin:0}
.report-filters>input[type=search]{flex:1;min-width:210px}
.report-filters .btn{white-space:nowrap}
@media(max-width:640px){.report-filters{display:grid;grid-template-columns:1fr 1fr}.report-filters>input[type=search]{grid-column:1/-1;min-width:0}.report-filters .btn{grid-column:1/-1;width:100%}}


/* Report print refinements: distinct table frame, outlined result rows, borderless subgroup labels. */
.lab-report-referrer-details{display:flex;flex-direction:column;align-items:flex-start;gap:1px;min-width:0}
.lab-report-doctor-designation{display:block;font-size:8.5pt;font-weight:400;line-height:1.25;color:#222;overflow-wrap:anywhere}
.lab-report-values{border:2px solid #333!important;outline:1px solid #333!important;outline-offset:0!important}
.lab-report-values tbody tr:not(.report-subgroup-row):not(.report-comment-row) td,
body.print-report-mode #lab-report-print-root .lab-report-values tbody tr:not(.report-subgroup-row):not(.report-comment-row) td{
  border-top:1px solid #333!important;border-bottom:1px solid #333!important;
  border-left:0!important;border-right:0!important;
}
.lab-report-values tbody tr:not(.report-subgroup-row):not(.report-comment-row) td:first-child,
body.print-report-mode #lab-report-print-root .lab-report-values tbody tr:not(.report-subgroup-row):not(.report-comment-row) td:first-child{border-left:1px solid #333!important}
.lab-report-values tbody tr:not(.report-subgroup-row):not(.report-comment-row) td:last-child,
body.print-report-mode #lab-report-print-root .lab-report-values tbody tr:not(.report-subgroup-row):not(.report-comment-row) td:last-child{border-right:1px solid #333!important}
.lab-report-values tbody tr.report-subgroup-row td,
body.print-report-mode #lab-report-print-root .lab-report-values tbody tr.report-subgroup-row td{border:0!important;outline:0!important;box-shadow:none!important;background:#fff!important;padding-top:9px!important;padding-bottom:4px!important}
.lab-report-values tbody tr.report-comment-row td,
body.print-report-mode #lab-report-print-root .lab-report-values tbody tr.report-comment-row td{border:1px dotted #777!important}
.lab-report-signatures{margin-top:auto!important;padding-top:18px!important;transform:translateY(.08in)}
.lab-report-electronic-signature{max-width:165px!important;height:36px!important;margin:8px 0 4px!important}
.lab-report-signature-placeholder{margin:12px 0 4px!important}
@media print{
 body.print-report-mode #lab-report-print-root .lab-report-values{border:2px solid #333!important;outline:1px solid #333!important}
 body.print-report-mode #lab-report-print-root .lab-report-signatures{margin-top:auto!important;padding-top:18px!important;transform:translateY(.08in)!important}
 body.print-report-mode #lab-report-print-root .lab-report-electronic-signature{max-width:165px!important;height:36px!important;margin:8px 0 4px!important}
}


/* Final report-print refinements requested from the sample printout. */
.lab-report-sheet,body.print-report-mode #lab-report-print-root .lab-report-sheet{border:0!important;outline:0!important;box-shadow:none!important;background:#fff!important}
.lab-report-referrer,body.print-report-mode #lab-report-print-root .lab-report-referrer{border-top:0!important;padding-top:2px!important}
.lab-report-referrer-details{display:flex!important;flex-direction:row!important;align-items:baseline!important;flex-wrap:wrap!important;column-gap:5px!important;row-gap:0!important}
.lab-report-referrer-name{font-weight:800!important}
.lab-report-doctor-designation{display:inline!important;font-size:8.5pt!important;font-weight:300!important;color:#555!important}
.lab-report-doctor-specialization{display:inline!important;font-size:8.5pt!important;font-weight:800!important;color:#111!important}
.lab-report-values,body.print-report-mode #lab-report-print-root .lab-report-values{border:1px solid #aaa!important;outline:0!important;box-shadow:none!important;border-collapse:collapse!important}
.lab-report-values thead th,body.print-report-mode #lab-report-print-root .lab-report-values thead th{border:1px solid #aaa!important}
.lab-report-values tbody tr:not(.report-subgroup-row):not(.report-comment-row) td,body.print-report-mode #lab-report-print-root .lab-report-values tbody tr:not(.report-subgroup-row):not(.report-comment-row) td{border-top:1px dotted #aaa!important;border-bottom:1px dotted #aaa!important;border-left:0!important;border-right:0!important;outline:0!important;box-shadow:none!important}
.lab-report-values tbody tr:not(.report-subgroup-row):not(.report-comment-row) td:first-child,body.print-report-mode #lab-report-print-root .lab-report-values tbody tr:not(.report-subgroup-row):not(.report-comment-row) td:first-child{border-left:1px dotted #aaa!important}
.lab-report-values tbody tr:not(.report-subgroup-row):not(.report-comment-row) td:last-child,body.print-report-mode #lab-report-print-root .lab-report-values tbody tr:not(.report-subgroup-row):not(.report-comment-row) td:last-child{border-right:1px dotted #aaa!important}
.lab-report-values tbody tr.report-subgroup-row td,body.print-report-mode #lab-report-print-root .lab-report-values tbody tr.report-subgroup-row td{border:0!important;outline:0!important;box-shadow:none!important;background:#fff!important}
@media print{
 body.print-report-mode #lab-report-print-root .lab-report-sheet{border:0!important;outline:0!important;box-shadow:none!important}
 body.print-report-mode #lab-report-print-root .lab-report-referrer{border-top:0!important}
 body.print-report-mode #lab-report-print-root .lab-report-values{border:1px solid #aaa!important;outline:0!important;box-shadow:none!important}
}

/* MAA Nursing Home invoice layout: compact A5 with QR, patient box and footer. */
.print-invoice{font:10px/1.3 Arial,Helvetica,sans-serif!important;color:#111!important}.print-head{text-align:left!important;margin:0 0 7px!important;padding:0 0 6px!important}.print-head-main{display:flex;align-items:center;justify-content:space-between;gap:8px}.print-head-copy{min-width:0;flex:1;text-align:center}.print-brand{text-transform:uppercase;font-size:16px!important;line-height:1.15;font-weight:800;letter-spacing:.3px!important}.print-subtitle,.print-mobile{font-size:9px!important;margin-top:2px}.print-invoice-qr{width:72px;height:72px;flex:0 0 72px;display:flex;align-items:center;justify-content:center;border:1px solid #ddd;padding:2px}.print-invoice-qr img,.print-invoice-qr canvas{max-width:100%;max-height:100%}.print-patient-box{border:1px solid #bbb;padding:6px 7px;margin:7px 0 5px}.print-patient-grid{grid-template-columns:1fr 1fr;gap:4px 10px;margin:0!important}.print-patient-grid div{display:grid;grid-template-columns:78px minmax(0,1fr);gap:4px;align-items:start}.print-patient-grid span,.print-totals span{font-size:8px!important;color:#444}.print-patient-grid b{font-size:9px!important;font-weight:700}.print-invoice-title{text-align:center;font-size:17px!important;letter-spacing:1px;margin:7px 0 8px!important;font-weight:800}.print-items{font-size:8.5px!important}.print-items th,.print-items td{padding:4px 3px!important;border:1px solid #aaa!important}.print-totals{margin-top:6px!important;max-width:70%;margin-left:auto}.print-totals div{display:flex;justify-content:space-between;gap:8px;padding:2px 0;font-size:9px}.print-totals .print-grand{border-top:1px solid #555;border-bottom:1px solid #555;padding:4px 0;margin:2px 0;font-weight:800}.print-footer{margin-top:10px!important;padding-top:5px!important;border-top:1px solid #ddd;display:flex;justify-content:space-between;gap:10px;font-size:8px!important}@media print{body.print-invoice-mode #lab-invoice-print-root .print-invoice{font-size:9px!important}body.print-invoice-mode #lab-invoice-print-root .print-head{margin-bottom:6px!important}body.print-invoice-mode #lab-invoice-print-root .print-patient-box{margin:6px 0 4px!important;padding:5px 6px!important}body.print-invoice-mode #lab-invoice-print-root .print-patient-grid{gap:3px 8px!important}body.print-invoice-mode #lab-invoice-print-root .print-invoice-title{margin:6px 0!important}body.print-invoice-mode #lab-invoice-print-root .print-items th,body.print-invoice-mode #lab-invoice-print-root .print-items td{padding:3px!important}body.print-invoice-mode #lab-invoice-print-root .print-footer{margin-top:8px!important}}
.lab-report-values tbody tr.report-subgroup-row td,body.print-report-mode #lab-report-print-root .lab-report-values tbody tr.report-subgroup-row td{border:0!important;border-top:0!important;border-bottom:0!important;border-left:0!important;border-right:0!important;outline:0!important;box-shadow:none!important;background:#fff!important}


/* Keep navigation views and Settings sub-pages strictly isolated. */
.view[hidden],.settings-page[hidden]{display:none!important;}
/* Print: subgroup headings must visually break table borders at both sides. */
.lab-report-values tbody tr.report-subgroup-row,body.print-report-mode #lab-report-print-root .lab-report-values tbody tr.report-subgroup-row{border:0!important;outline:0!important;box-shadow:none!important;}
.lab-report-values tbody tr.report-subgroup-row>td,body.print-report-mode #lab-report-print-root .lab-report-values tbody tr.report-subgroup-row>td,.lab-report-values tbody tr.report-subgroup-row>td:first-child,.lab-report-values tbody tr.report-subgroup-row>td:last-child,body.print-report-mode #lab-report-print-root .lab-report-values tbody tr.report-subgroup-row>td:first-child,body.print-report-mode #lab-report-print-root .lab-report-values tbody tr.report-subgroup-row>td:last-child{border:0!important;border-left:0!important;border-right:0!important;border-top:0!important;border-bottom:0!important;outline:0!important;box-shadow:inset 3px 0 0 #fff,inset -3px 0 0 #fff!important;background:#fff!important;}

/* Subgroup heading is a label, not a bordered table row. Hide table frame and cell borders behind it in screen and print output. */
.lab-report-values tbody tr.report-subgroup-row,
.lab-report-values tbody tr.report-subgroup-row > td,
body.print-report-mode #lab-report-print-root .lab-report-values tbody tr.report-subgroup-row,
body.print-report-mode #lab-report-print-root .lab-report-values tbody tr.report-subgroup-row > td {
  border: 0 !important;
  border-color: #fff !important;
  outline: 0 !important;
  box-shadow: inset 4px 0 0 #fff, inset -4px 0 0 #fff !important;
  background: #fff !important;
}

/* Report title must not draw an extra underline across the report table. */
.lab-report-title,body.print-report-mode #lab-report-print-root .lab-report-title{text-decoration:none!important;border:0!important;box-shadow:none!important;margin-bottom:10px!important}
.lab-report-values,body.print-report-mode #lab-report-print-root .lab-report-values{margin-top:0!important}

/* Cloned print documents must never remain visible in normal app navigation. */
body:not(.print-invoice-mode):not(.print-report-mode) #lab-invoice-print-root,
body:not(.print-invoice-mode):not(.print-report-mode) #lab-report-print-root{display:none!important}
body.print-invoice-mode #lab-invoice-print-root,
body.print-report-mode #lab-report-print-root{display:block}

/* Definitive report print fixes: subgroup labels have no visible table side edges. */
.lab-report-values .report-subgroup-row,
.lab-report-values .report-subgroup-row > td,
body.print-report-mode #lab-report-print-root .lab-report-values .report-subgroup-row,
body.print-report-mode #lab-report-print-root .lab-report-values .report-subgroup-row > td{
  border:0!important;
  border-left:1px solid #fff!important;
  border-right:1px solid #fff!important;
  border-top:1px solid #fff!important;
  border-bottom:1px solid #fff!important;
  outline:0!important;
  box-shadow:inset 5px 0 0 #fff,inset -5px 0 0 #fff!important;
  background:#fff!important;
}
/* End Report is a text marker only; remove the horizontal rule above it. */
.lab-report-end-report,
body.print-report-mode #lab-report-print-root .lab-report-end-report{
  border:0!important;
  border-top:0!important;
  box-shadow:none!important;
  padding-top:5px!important;
  margin-top:14px!important;
  text-align:center!important;
  font-weight:800!important;
}
/* Keep signatory at the bottom of each report page, after all result rows. */
body.print-report-mode #lab-report-print-root .lab-report-sheet{
  display:flex!important;
  flex-direction:column!important;
  min-height:10.7in!important;
  height:auto!important;
  overflow:visible!important;
}
body.print-report-mode #lab-report-print-root .lab-report-signatures{
  margin-top:auto!important;
  padding-top:36px!important;
  flex-shrink:0!important;
  break-inside:avoid!important;
  page-break-inside:avoid!important;
}
/* Do not print a caption under the QR; keep QR graphic visible. */
.lab-report-code small{display:none!important}
.lab-report-code-qr{background:#fff!important;overflow:hidden!important}
.lab-report-code-qr img{display:block!important;object-fit:contain!important;width:68px!important;height:68px!important}


/* Fix subgroup frame: keep subgroup labels borderless and remove the outer frame from each subgroup's result table. Keep only row separators and column headers framed. */
.lab-report-values.lab-report-section-table,
body.print-report-mode #lab-report-print-root .lab-report-values.lab-report-section-table {
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
  border-collapse: separate !important;
  border-spacing: 0 !important;
}
.lab-report-values.lab-report-section-table tbody td,
body.print-report-mode #lab-report-print-root .lab-report-values.lab-report-section-table tbody td {
  border-left: 0 !important;
  border-right: 0 !important;
}
.lab-report-values.lab-report-section-table tbody tr:not(.report-comment-row) td,
body.print-report-mode #lab-report-print-root .lab-report-values.lab-report-section-table tbody tr:not(.report-comment-row) td {
  border-top: 1px dotted #aaa !important;
  border-bottom: 1px dotted #aaa !important;
}
.lab-report-values.lab-report-section-table tbody tr.report-comment-row td,
body.print-report-mode #lab-report-print-root .lab-report-values.lab-report-section-table tbody tr.report-comment-row td {
  border: 1px dotted #aaa !important;
}
.lab-report-end-report,
body.print-report-mode #lab-report-print-root .lab-report-end-report {
  border: 0 !important;
  border-top: 0 !important;
  background: transparent !important;
}


/* Override legacy first/last-cell borders specifically for the split subgroup tables. */
.lab-report-values.lab-report-section-table tbody tr td:first-child,
.lab-report-values.lab-report-section-table tbody tr td:last-child,
body.print-report-mode #lab-report-print-root .lab-report-values.lab-report-section-table tbody tr td:first-child,
body.print-report-mode #lab-report-print-root .lab-report-values.lab-report-section-table tbody tr td:last-child {
  border-left: 0 !important;
  border-right: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}
body.print-report-mode #lab-report-print-root .lab-report-values.lab-report-section-table {
  border-left: 0 !important;
  border-right: 0 !important;
  outline: 0 !important;
}

/* Subgroup headings are now outside result tables, so table borders cannot cross them. */
.lab-report-column-header,.lab-report-section-table{
  width:100%!important;table-layout:fixed!important;border-collapse:separate!important;border-spacing:0!important;margin:0!important;
}
.lab-report-column-header th{border:1px solid #666!important}
.report-subgroup-heading{
  display:block!important;width:100%!important;box-sizing:border-box!important;
  margin:0!important;padding:8px 0 3px!important;background:#fff!important;color:#111!important;
  border:0!important;outline:0!important;box-shadow:none!important;font-size:10.5pt!important;
  font-weight:800!important;line-height:1.2!important;break-after:avoid!important;page-break-after:avoid!important;
}
.lab-report-section-table td{box-sizing:border-box!important}
.lab-report-code-qr{display:flex!important;align-items:center!important;justify-content:center!important;width:68px!important;height:68px!important;min-width:68px!important;min-height:68px!important;flex:0 0 68px!important}
.lab-report-code-qr canvas,.lab-report-code-qr img{display:block!important;visibility:visible!important;opacity:1!important;width:68px!important;height:68px!important;max-width:68px!important;max-height:68px!important;object-fit:contain!important}
.lab-report-referrer{display:grid!important}
@media print{
 body.print-report-mode #lab-report-print-root .report-subgroup-heading{border:0!important;box-shadow:none!important;background:#fff!important}
 body.print-report-mode #lab-report-print-root .lab-report-column-header,
 body.print-report-mode #lab-report-print-root .lab-report-section-table{border-collapse:separate!important;border-spacing:0!important}
 body.print-report-mode #lab-report-print-root .lab-report-code-qr canvas,
 body.print-report-mode #lab-report-print-root .lab-report-code-qr img{display:block!important;visibility:visible!important;opacity:1!important}
}

/* Preview UX fix: make test search results easy to tap on mobile and polish consumables. */
.test-picker .test-options{z-index:30;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;touch-action:pan-y}
.test-picker .test-options .test-option{min-height:54px;cursor:pointer;touch-action:manipulation}
.test-picker .test-options .test-option:active{background:var(--surface-2);border-color:var(--primary)}
.consumables-picker{border:1px solid var(--line);border-radius:14px;padding:15px 14px 13px;margin:16px 0 0;min-width:0;background:linear-gradient(135deg,var(--surface),var(--surface-2))}
.consumables-picker legend{padding:0 7px;font-size:12px;font-weight:750;color:var(--text);letter-spacing:.1px}
.consumables-checkbox-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;margin-top:4px}
.consumables-checkbox-grid label{display:flex;align-items:center;gap:9px;min-width:0;border:1px solid var(--line);border-radius:11px;background:var(--surface);padding:11px 10px;font-size:12px;font-weight:600;color:var(--text);line-height:1.35;cursor:pointer;transition:border-color .15s,background .15s,box-shadow .15s}
.consumables-checkbox-grid label:has(input:checked){border-color:var(--primary);background:#eaf6ff;box-shadow:0 0 0 2px #1677b812}
.consumables-checkbox-grid input[type=checkbox]{width:18px;height:18px;min-width:18px;min-height:18px;margin:0;accent-color:var(--primary)}
.consumables-picker .helper{display:block;margin-top:10px}
body.dark .consumables-picker{background:linear-gradient(135deg,var(--surface),var(--surface-2))}
body.dark .consumables-checkbox-grid label:has(input:checked){background:#1a3547}
@media(max-width:520px){.consumables-picker{padding:13px 10px 11px}.consumables-checkbox-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.consumables-checkbox-grid label{padding:10px 8px;font-size:11px;gap:7px;overflow-wrap:anywhere}.consumables-checkbox-grid input[type=checkbox]{width:17px;height:17px;min-width:17px;min-height:17px}}
