.laboratory-page .laboratory-status{display:inline-flex;align-items:center;justify-content:center;padding:5px 10px;border:1px solid #f3bbc2;border-radius:999px;background:#fff7f8;color:#86101d;font-size:.82rem;white-space:nowrap}.laboratory-page .laboratory-user-actions-heading,.laboratory-page .laboratory-user-actions{width:84px}.laboratory-page .laboratory-user-edit{display:inline-grid;place-items:center;width:2.35rem;height:2.35rem;padding:0;border:1px solid #efb9c1;border-radius:.7rem;background:#fff8f9!important;color:#84101e;box-shadow:none}.laboratory-page .laboratory-user-edit:hover{background:#8b1020!important;border-color:#8b1020!important;color:#fff;transform:translateY(-1px)}.laboratory-page .laboratory-request-modal{max-width:940px}.laboratory-page .laboratory-wide{grid-column:1/-1}.laboratory-test-picker{margin-top:18px;padding-top:14px;border-top:1px solid #f7d9dd}.laboratory-test-picker small{display:block;color:#71809b;margin-top:3px}.laboratory-urgent{display:flex;align-items:center;gap:8px;margin-top:16px;color:#86101d;font-weight:600}.laboratory-urgent input{accent-color:#8e1020}@media(max-width:640px){.laboratory-page .laboratory-request-modal{max-height:calc(100vh - 28px);overflow:auto}.laboratory-page .laboratory-wide{grid-column:auto}.laboratory-page .perm-pages-grid{grid-template-columns:1fr}.laboratory-page .today-item{align-items:flex-start}.laboratory-page .laboratory-user-actions{width:100%}}
.laboratory-page .laboratory-results-modal{max-width:900px}.laboratory-results-list{display:grid;gap:12px}.laboratory-result-card{display:grid;grid-template-columns:1.2fr 1fr 1fr;gap:12px;align-items:end;padding:14px;border:1px solid #f5dce0;border-radius:12px;background:#fffafb}.laboratory-result-name{display:grid;gap:3px;color:#87101e}.laboratory-result-name small,.laboratory-patient{color:#71809b;font-size:.82rem}.laboratory-toast{position:fixed;bottom:22px;left:22px;z-index:1300;padding:12px 16px;border-radius:10px;background:#84101e;color:#fff;box-shadow:0 12px 30px #53030a44}@media(max-width:640px){.laboratory-result-card{grid-template-columns:1fr}.laboratory-page .laboratory-results-modal{max-height:calc(100vh - 28px);overflow:auto}}
.laboratory-heading-actions,.laboratory-toolbar{display:flex;align-items:center;gap:10px}.laboratory-toolbar{justify-content:flex-start;margin-bottom:14px}.laboratory-barcode{font-family:ui-monospace,SFMono-Regular,Consolas,monospace;font-size:.78rem;font-weight:700;letter-spacing:.025em;color:#57101a;white-space:nowrap}.laboratory-pagination{display:flex;justify-content:center;align-items:center;gap:7px;margin-top:18px;direction:ltr}.laboratory-pagination button{display:inline-grid;place-items:center;min-width:34px;height:34px;padding:0;border:1px solid #f1c5cb;border-radius:9px;background:#fff;color:#74101c;font-weight:700;line-height:1;cursor:pointer;transition:transform 140ms ease,background-color 140ms ease,border-color 140ms ease,color 140ms ease}.laboratory-pagination button:hover:not(:disabled){transform:translateY(-1px);border-color:#a80f23;background:#fff6f7}.laboratory-pagination button:focus-visible{outline:3px solid #f3b8c1;outline-offset:2px}.laboratory-pagination button:disabled{opacity:.42;cursor:not-allowed}.laboratory-pagination button.is-active{background:#8b1020;color:#fff;border-color:#8b1020}.laboratory-pagination .laboratory-pagination-icon{width:34px;min-width:34px;padding:0;font-size:.82rem;line-height:0}.laboratory-pagination .laboratory-pagination-icon i{display:flex;align-items:center;justify-content:center;width:100%;height:100%;transform:translateY(-.02em)}.laboratory-audit-modal{max-width:620px}.laboratory-audit-list{display:grid;gap:10px;max-height:55vh;overflow:auto}.laboratory-audit-item{display:grid;gap:3px;padding:12px;border:1px solid #f3dce0;border-radius:11px;background:#fffafb}.laboratory-audit-item strong{color:#86101d}.laboratory-audit-item span,.laboratory-audit-item small{color:#66748f;font-size:.86rem}.laboratory-duplicate-warning{display:grid;gap:8px;margin-top:14px;padding:12px;border:1px solid #f0c6cd;border-radius:12px;background:#fff8f8}.laboratory-duplicate-warning strong{color:#83101e}.laboratory-duplicate-warning button{display:flex;justify-content:space-between;gap:8px;border:0;border-radius:8px;padding:8px 10px;background:#fff;color:#26334d;text-align:right;cursor:pointer}.laboratory-duplicate-warning small{color:#71809b}.laboratory-print-report{margin-top:18px}@media(max-width:640px){.laboratory-heading-actions{width:100%;justify-content:stretch}.laboratory-heading-actions .btn{flex:1;padding-inline:8px;font-size:.84rem}.laboratory-page .report-table-wrap{overflow:visible}.laboratory-page .men-women-table,.laboratory-page .men-women-table thead,.laboratory-page .men-women-table tbody,.laboratory-page .men-women-table tr,.laboratory-page .men-women-table td{display:block;width:100%}.laboratory-page .men-women-table thead{display:none}.laboratory-page .men-women-table tr{margin-bottom:12px;padding:12px;border:1px solid #f2d9de;border-radius:13px;background:#fffafb}.laboratory-page .men-women-table td{display:flex;justify-content:space-between;gap:12px;padding:6px 0;border:0;text-align:right}.laboratory-page .men-women-table td:before{content:attr(data-label);font-size:.75rem;font-weight:700;color:#6c7990}.laboratory-page .men-women-table td.empty-cell{display:block;text-align:center}.laboratory-page .men-women-table td.empty-cell:before{display:none}.laboratory-page .laboratory-audit-modal{max-height:calc(100vh - 28px);overflow:auto}}
.laboratory-page .emergency-actions{display:flex!important;align-items:center;justify-content:center;gap:.6rem!important;flex-wrap:wrap}.laboratory-page .emergency-icon-btn{display:inline-flex!important;align-items:center;justify-content:center;width:2.35rem!important;height:2.35rem!important;margin:0!important;border:1px solid #efb9c1!important;border-radius:.7rem!important;background:#fff8f9!important;color:#84101e!important;box-shadow:none!important}.laboratory-page .emergency-icon-btn:hover{background:#8b1020!important;border-color:#8b1020!important;color:#fff!important;transform:translateY(-1px)}
.laboratory-page .laboratory-selected-tests{display:flex;flex-wrap:wrap;gap:.55rem;margin-top:.75rem;padding:.75rem;border:1px dashed #efc2c8;border-radius:.75rem;background:#fffafb}.laboratory-page .laboratory-selected-empty{color:#748198;font-size:.85rem}.laboratory-page .laboratory-selected-test{display:inline-flex;align-items:center;gap:.45rem;border:1px solid #efb8c0;border-radius:.6rem;background:#fff;color:#7e1020;padding:.42rem .6rem;font:inherit;font-size:.84rem;cursor:pointer}.laboratory-page .laboratory-selected-test:hover{background:#fff1f3}.laboratory-page .laboratory-selected-test .fa-xmark{font-size:.75rem}
.laboratory-page .laboratory-test-picker .modern-select.is-open{z-index:260}.laboratory-page .laboratory-test-picker .modern-select-menu{top:auto;bottom:calc(100% + 8px);z-index:270}

.laboratory-category-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(255px,1fr));gap:14px}.laboratory-category-card{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:13px;min-height:104px;padding:16px;border:1px solid #f0c8ce;border-radius:16px;background:linear-gradient(145deg,#fff 0%,#fff7f8 100%);color:#26334d;font:inherit;text-align:right;cursor:pointer;box-shadow:0 10px 24px #7b102012;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}.laboratory-category-card:hover{transform:translateY(-2px);border-color:#d98692;box-shadow:0 14px 30px #7b10201e}.laboratory-category-icon{display:inline-flex;align-items:center;justify-content:center;width:48px;height:48px;border-radius:14px;background:#8b1020;color:#fff;box-shadow:0 8px 18px #8b102035}.laboratory-category-copy{display:grid;gap:5px}.laboratory-category-copy strong{font-size:1.08rem;color:#72101c}.laboratory-category-copy small{color:#71809b}.laboratory-category-action{display:inline-flex;align-items:center;gap:6px;color:#9a1425;font-weight:700;font-size:.84rem;white-space:nowrap}.laboratory-catalog-count{color:#71809b;font-size:.86rem}.laboratory-category-badge{display:inline-flex;padding:4px 9px;border:1px solid #efbcc4;border-radius:999px;background:#fff7f8;color:#80101e;font-weight:700}.laboratory-test-modal{max-width:820px}

.laboratory-template-modal{width:min(1120px,calc(100vw - 34px));max-width:1120px;max-height:calc(100vh - 34px);overflow:hidden;display:flex;flex-direction:column}.laboratory-template-modal .perm-modal-head{flex:0 0 auto}.laboratory-template-modal .perm-modal-head small{display:block;margin-top:4px;color:#71809b}.laboratory-modal-close{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border:1px solid #f0c1c8;border-radius:10px;background:#fff4f5;color:#82101f;cursor:pointer}.laboratory-template-summary{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.laboratory-template-summary span{display:inline-flex;align-items:center;gap:7px;padding:7px 10px;border-radius:10px;background:#fff3f5;color:#82101f;font-size:.86rem;font-weight:700}.laboratory-template-body{display:grid;gap:16px;overflow:auto;padding:2px 4px 10px;scrollbar-color:#d78691 #fff3f5;scrollbar-width:thin}.laboratory-result-section{border:1px solid #efd1d6;border-radius:14px;overflow:hidden;background:#fff}.laboratory-result-section h3{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:0;padding:11px 14px;background:#fff3f5;color:#76101c;font-size:1rem}.laboratory-result-section h3 span{display:inline-flex;align-items:center;justify-content:center;min-width:28px;height:25px;padding:0 8px;border-radius:999px;background:#8b1020;color:#fff;font-size:.78rem}.laboratory-form-table{display:grid}.laboratory-form-row{display:grid;grid-template-columns:minmax(180px,1.5fr) minmax(150px,1fr) minmax(130px,1fr) minmax(80px,.6fr);align-items:center;min-height:45px;border-top:1px solid #f3e0e3}.laboratory-form-row:first-child{border-top:0}.laboratory-form-row>*{padding:9px 12px}.laboratory-form-head{min-height:38px;background:#fffafb;color:#68758d;font-size:.82rem;font-weight:700}.laboratory-result-placeholder{color:#909bb0;font-size:.82rem}.laboratory-template-modal footer{flex:0 0 auto;margin-top:10px}

.laboratory-request-categories{display:flex;flex-wrap:wrap;gap:7px}.laboratory-request-categories button{display:inline-flex;align-items:center;gap:7px;padding:6px 9px;border:1px solid #edb9c1;border-radius:9px;background:#fff7f8;color:#7b101e;font:inherit;font-weight:700;cursor:pointer}.laboratory-request-categories button small{display:inline-flex;align-items:center;justify-content:center;min-width:21px;height:21px;border-radius:999px;background:#8b1020;color:#fff}.laboratory-request-categories button:disabled{cursor:default;opacity:.7}.laboratory-patient-strip{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:12px 0}.laboratory-patient-strip>span{display:grid;gap:2px;padding:9px 11px;border:1px solid #f0d4d8;border-radius:10px;background:#fffafb}.laboratory-patient-strip small{color:#71809b}.laboratory-patient-strip strong{color:#26334d;overflow-wrap:anywhere}.laboratory-result-tabs{display:flex;flex:0 0 auto;align-items:flex-start;gap:8px;min-height:54px;overflow:auto;padding:4px 2px 12px}.laboratory-result-tabs button{display:inline-flex;align-items:center;gap:8px;min-height:38px;padding:7px 11px;border:1px solid #eebec5;border-radius:10px;background:#fff7f8;color:#7c101e;font:inherit;font-weight:700;white-space:nowrap;cursor:pointer}.laboratory-result-tabs button small{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;border-radius:999px;background:#f5dce0}.laboratory-result-tabs button.is-active{background:#8b1020;color:#fff;border-color:#8b1020}.laboratory-result-tabs button.is-active small{background:#fff;color:#8b1020}.laboratory-template-modal>form{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.laboratory-entry-body{max-height:min(58vh,650px)}.laboratory-entry-table{display:grid}.laboratory-entry-row{display:grid;grid-template-columns:minmax(160px,1.25fr) minmax(130px,.9fr) minmax(120px,.8fr) minmax(75px,.45fr) minmax(140px,1fr);align-items:center;gap:9px;padding:9px 11px;border-top:1px solid #f3e0e3}.laboratory-entry-row:first-child{border-top:0}.laboratory-entry-head{min-height:38px;padding-block:7px;background:#fffafb;color:#68758d;font-size:.82rem;font-weight:700}.laboratory-entry-test{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:4px 7px;color:#78101d}.laboratory-entry-test small{grid-column:2;color:#7b879c;font-size:.76rem}.laboratory-reference-value,.laboratory-unit-value{color:#33405a}.laboratory-mobile-label{display:none}

@media(max-width:640px){
  .laboratory-page tr:has(.laboratory-barcode) td:nth-child(1)::before{content:"رقم الطلب"}.laboratory-page tr:has(.laboratory-barcode) td:nth-child(2)::before{content:"رقم العينة"}.laboratory-page tr:has(.laboratory-barcode) td:nth-child(3)::before{content:"المراجع"}.laboratory-page tr:has(.laboratory-barcode) td:nth-child(4)::before{content:"الفحوصات"}.laboratory-page tr:has(.laboratory-barcode) td:nth-child(5)::before{content:"الحالة"}.laboratory-page tr:has(.laboratory-barcode) td:nth-child(6)::before{content:"التقرير أو التاريخ"}.laboratory-page tr:has(.laboratory-barcode) td:nth-child(7)::before{content:"الإجراءات"}.laboratory-page tr:has(.laboratory-barcode) td:nth-child(8)::before{content:"الإجراءات"}
  .laboratory-page tr:has(.emergency-actions):not(:has(.laboratory-barcode)) td:nth-child(1)::before{content:"الفحص"}.laboratory-page tr:has(.emergency-actions):not(:has(.laboratory-barcode)) td:nth-child(2)::before{content:"التصنيف"}.laboratory-page tr:has(.emergency-actions):not(:has(.laboratory-barcode)) td:nth-child(3)::before{content:"الوحدة"}.laboratory-page tr:has(.emergency-actions):not(:has(.laboratory-barcode)) td:nth-child(4)::before{content:"المدى المرجعي"}.laboratory-page tr:has(.emergency-actions):not(:has(.laboratory-barcode)) td:nth-child(5)::before{content:"السعر"}.laboratory-page tr:has(.emergency-actions):not(:has(.laboratory-barcode)) td:nth-child(6)::before{content:"الإجراءات"}
  .laboratory-page tr:has(.laboratory-barcode):has(td:nth-child(8)) td:nth-child(5)::before{content:"الاستعجال"}.laboratory-page tr:has(.laboratory-barcode):has(td:nth-child(8)) td:nth-child(6)::before{content:"الحالة"}.laboratory-page tr:has(.laboratory-barcode):has(td:nth-child(8)) td:nth-child(7)::before{content:"التاريخ"}
}

@media(max-width:640px){.laboratory-category-grid{grid-template-columns:1fr;gap:10px}.laboratory-category-card{grid-template-columns:auto 1fr;min-height:90px;padding:13px}.laboratory-category-action{grid-column:2}.laboratory-template-modal{width:calc(100vw - 24px);max-height:calc(100vh - 24px);padding:14px}.laboratory-template-summary{margin-block:9px}.laboratory-form-head,.laboratory-entry-head{display:none}.laboratory-form-row{grid-template-columns:1fr 1fr;gap:0;padding:10px}.laboratory-form-row>*{padding:6px}.laboratory-form-row strong{grid-column:1/-1;color:#79101d}.laboratory-result-placeholder{grid-column:1/-1}.laboratory-patient-strip{grid-template-columns:1fr 1fr}.laboratory-entry-body{max-height:62vh}.laboratory-entry-row{grid-template-columns:1fr 1fr;gap:9px;padding:12px}.laboratory-entry-test{grid-column:1/-1;padding-bottom:4px;border-bottom:1px solid #f5e4e7}.laboratory-entry-row>label:last-child{grid-column:1/-1}.laboratory-mobile-label{display:block;margin-bottom:4px;color:#71809b;font-size:.74rem;font-weight:700}.laboratory-reference-value,.laboratory-unit-value{padding:7px 9px;border-radius:8px;background:#fffafb}.laboratory-request-categories{justify-content:flex-end}.laboratory-catalog-table td:before{content:attr(data-label)!important}.laboratory-catalog-table td:nth-child(7)::before{content:"الإجراءات"!important}}

.laboratory-template-body{grid-auto-rows:max-content;align-content:start;flex:1 1 auto;min-height:0}.laboratory-result-section{height:max-content}

/* A request can contain several forms: keep the table row to one action and reveal the forms in a focused modal. */
.laboratory-forms-summary-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:10.2rem;min-height:2.35rem;padding:7px 10px;border:1px solid #edb9c1;border-radius:10px;background:#fff7f8;color:#7b101e;font:inherit;font-size:.8rem;font-weight:800;line-height:1;white-space:nowrap;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease}.laboratory-forms-summary-btn:hover{background:#fff0f2;box-shadow:0 8px 18px rgba(134,16,29,.12);transform:translateY(-1px)}.laboratory-forms-summary-btn>i,.laboratory-form-list-arrow{color:#991827}.laboratory-forms-summary-btn strong{display:grid;place-items:center;flex:0 0 1.7rem;box-sizing:border-box;inline-size:1.7rem;block-size:1.7rem;padding:0;border-radius:50%;background:#86101d;color:#fff;font-size:.7rem;line-height:1;text-align:center;font-variant-numeric:tabular-nums}.laboratory-forms-list-modal{width:min(42rem,calc(100vw - 2rem));max-height:min(76vh,46rem);display:flex;flex-direction:column;padding:0!important;overflow:hidden}.laboratory-forms-list-modal .perm-modal-head{flex:0 0 auto;margin:0;padding:18px 20px 14px;border-bottom:1px solid #f2d9dd}.laboratory-forms-list-modal .perm-modal-head small{display:block;margin-top:3px;color:#6e7c95;font-weight:600}.laboratory-forms-list-modal footer{flex:0 0 auto;display:flex;justify-content:flex-start;margin:0;padding:12px 20px;border-top:1px solid #f2d9dd}.laboratory-forms-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;overflow:auto;padding:16px 20px}.laboratory-form-list-item{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:start;gap:10px;min-width:0;padding:11px;border:1px solid #f1d9dc;border-radius:11px;background:#fffafb;color:#26344a;font:inherit;text-align:right;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,border-color .16s ease,background-color .16s ease}.laboratory-form-list-item:hover{border-color:#a42333;background:#fff4f5;box-shadow:0 8px 18px rgba(134,16,29,.1);transform:translateY(-1px)}.laboratory-form-list-icon{display:grid;place-items:center;width:2rem;height:2rem;border-radius:8px;background:#86101d;color:#fff}.laboratory-form-list-copy{display:grid;min-width:0;gap:3px}.laboratory-form-list-copy strong{overflow-wrap:anywhere;font-size:.88rem;line-height:1.3}.laboratory-form-list-copy small{color:#8b1020;font-size:.76rem;font-weight:800}.laboratory-form-test-names{display:block;overflow:hidden;color:#66738b;font-size:.73rem;line-height:1.45;text-overflow:ellipsis;white-space:nowrap}.laboratory-form-list-arrow{align-self:center;font-size:.76rem}@media(max-width:640px){.laboratory-forms-summary-btn{width:100%}.laboratory-forms-list-modal{width:min(100%,calc(100vw - 1.25rem));max-height:82vh}.laboratory-forms-list-modal .perm-modal-head,.laboratory-forms-list-modal footer{padding-inline:14px}.laboratory-forms-list{grid-template-columns:1fr;padding:14px}.laboratory-form-test-names{white-space:normal}}

/* Parent categories use one request and one result form; internal groups are visual separators only. */
.laboratory-page .laboratory-picker-help{display:flex;align-items:flex-start;gap:7px;margin:8px 0 0;color:#6f7d94;font-size:.84rem;line-height:1.55}.laboratory-page .laboratory-picker-help i{margin-top:3px;color:#8b1020}.laboratory-page .laboratory-selected-category{display:inline-flex;align-items:center;gap:.5rem;max-width:100%;border:1px solid #b96875;border-radius:.65rem;background:#8b1020;color:#fff;padding:.48rem .7rem;font:inherit;font-size:.85rem;font-weight:700;cursor:pointer;box-shadow:0 5px 14px #8b102022}.laboratory-page .laboratory-selected-category small{display:inline-flex;margin:0;color:#fff4f5;font-size:.75rem;font-weight:600;white-space:nowrap}.laboratory-page .laboratory-selected-category .fa-xmark{font-size:.75rem}.laboratory-page .laboratory-selected-category:hover{background:#70101b}.laboratory-unified-form-note{display:flex;align-items:flex-start;gap:9px;margin:10px 0 4px;padding:10px 12px;border:1px solid #efd0d5;border-radius:11px;background:#fff8f9;color:#596780;font-size:.86rem;line-height:1.55}.laboratory-unified-form-note>i{margin-top:3px;color:#8b1020}.laboratory-unified-form-note strong{color:#77101d}.laboratory-template-modal .laboratory-template-body{border-top:1px solid #f3dde1;margin-top:10px;padding-top:13px}.laboratory-template-modal .laboratory-template-body>.laboratory-result-section{border:0;border-radius:0;overflow:visible;background:transparent}.laboratory-template-modal .laboratory-template-body>.laboratory-result-section h3{padding:14px 2px 8px;border-bottom:1px solid #efd8dc;border-radius:0;background:transparent}.laboratory-template-modal .laboratory-template-body>.laboratory-result-section:first-child h3{padding-top:0}.laboratory-template-modal .laboratory-form-table,.laboratory-template-modal .laboratory-entry-table{overflow:hidden;border:1px solid #efd9dd;border-top:0;border-radius:0 0 12px 12px;background:#fff}
@media(max-width:640px){.laboratory-page .laboratory-selected-category{width:100%;justify-content:flex-start;flex-wrap:wrap}.laboratory-page .laboratory-selected-category small{flex:1 1 100%;padding-inline-start:1.45rem;white-space:normal}.laboratory-unified-form-note{font-size:.82rem;margin-top:9px}.laboratory-template-modal .laboratory-template-body{margin-top:8px;padding-top:10px}.laboratory-template-modal .laboratory-template-body>.laboratory-result-section h3{padding-top:12px}}

/* Keep category cards compact and prevent their labels from escaping the surface. */
.laboratory-category-grid{grid-template-columns:repeat(auto-fit,minmax(280px,420px));justify-content:start}.laboratory-category-card{grid-template-columns:auto minmax(0,1fr);align-items:start;min-height:0}.laboratory-category-copy{min-width:0;padding-block:2px}.laboratory-category-copy strong,.laboratory-category-copy small{overflow-wrap:anywhere}.laboratory-category-copy small{line-height:1.5}.laboratory-category-action{grid-column:1/-1;justify-self:start;min-width:0;margin-top:3px;white-space:normal;line-height:1.45;overflow-wrap:anywhere}.laboratory-category-action i{flex:0 0 auto}
@media(max-width:640px){.laboratory-category-grid{grid-template-columns:1fr}.laboratory-category-card{grid-template-columns:auto minmax(0,1fr)}.laboratory-category-action{grid-column:1/-1}}

/* The result form is a grid rather than a semantic table, so it follows the shared table rules here. */
@media(min-width:641px){.laboratory-entry-row{grid-template-columns:repeat(5,minmax(0,1fr));gap:12px;padding:10px 12px}.laboratory-entry-row>*{min-width:0;text-align:center;overflow-wrap:anywhere}.laboratory-entry-head>span{text-align:center}.laboratory-entry-test{grid-template-columns:auto minmax(0,auto);justify-content:center;justify-items:center;text-align:center}.laboratory-entry-test small{grid-column:1/-1;text-align:center}.laboratory-entry-test strong{max-width:100%;overflow-wrap:anywhere}.laboratory-entry-row label{display:block;text-align:center}.laboratory-entry-row .form-input{text-align:center}.laboratory-reference-value,.laboratory-unit-value{display:grid;justify-items:center;text-align:center}.laboratory-entry-table .laboratory-mobile-label{display:none}}

/* The catalogue preview uses a four-column grid, not a native table. */
@media(min-width:641px){.laboratory-form-row{grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:10px 12px}.laboratory-form-row>*{min-width:0;padding:0;text-align:center;overflow-wrap:anywhere}.laboratory-form-head>span{text-align:center}.laboratory-form-row strong,.laboratory-form-row>span{display:block;text-align:center;overflow-wrap:anywhere}}

/* Keep laboratory-request tables compact: test names are available from a focused modal. */
.laboratory-tests-summary-btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-width:8.9rem;min-height:2.35rem;padding:7px 10px;border:1px solid #edb9c1;border-radius:10px;background:#fff7f8;color:#7b101e;font:inherit;font-size:.8rem;font-weight:800;line-height:1;cursor:pointer;transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease}.laboratory-tests-summary-btn:hover{background:#fff0f2;box-shadow:0 8px 18px rgba(134,16,29,.12);transform:translateY(-1px)}.laboratory-tests-summary-btn i{color:#991827}.laboratory-tests-summary-btn strong{display:grid;place-items:center;flex:0 0 1.7rem;box-sizing:border-box;inline-size:1.7rem;block-size:1.7rem;aspect-ratio:1;padding:0;border-radius:50%;background:#86101d;color:#fff;font-size:.7rem;line-height:1;text-align:center;font-variant-numeric:tabular-nums}.laboratory-test-list-modal{width:min(34rem,calc(100vw - 2rem));max-height:min(76vh,46rem);display:flex;flex-direction:column;padding:0!important;overflow:hidden}.laboratory-test-list-modal .perm-modal-head{flex:0 0 auto;margin:0;padding:18px 20px 14px;border-bottom:1px solid #f2d9dd}.laboratory-test-list-modal .perm-modal-head small{display:block;margin-top:3px;color:#6e7c95;font-weight:600}.laboratory-test-list-modal footer{flex:0 0 auto;display:flex;justify-content:flex-start;margin:0;padding:12px 20px;border-top:1px solid #f2d9dd}.laboratory-test-name-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px;overflow:auto;padding:16px 20px}.laboratory-test-name-item{display:flex;align-items:center;gap:9px;min-width:0;padding:10px 11px;border:1px solid #f1d9dc;border-radius:10px;background:#fffafb;color:#26344a;font-size:.86rem;font-weight:700}.laboratory-test-name-item i{flex:0 0 auto;color:#951425}.laboratory-test-name-item span{min-width:0;overflow-wrap:anywhere}.laboratory-request-categories .laboratory-category-form-btn{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:9px;min-width:0;width:min(100%,15.5rem);padding:8px 10px;text-align:right;transition:transform .16s ease,box-shadow .16s ease,background-color .16s ease}.laboratory-category-form-btn:not(:disabled):hover{background:#fff0f2;box-shadow:0 8px 18px rgba(134,16,29,.12);transform:translateY(-1px)}.laboratory-category-form-icon{display:flex!important;align-items:center;justify-content:center;width:2rem;height:2rem;border-radius:8px;background:#86101d;color:#fff}.laboratory-category-form-copy{display:grid;min-width:0;gap:2px}.laboratory-category-form-copy strong{overflow-wrap:anywhere;font-size:.82rem;line-height:1.2}.laboratory-request-categories .laboratory-category-form-copy small{justify-self:start;min-width:0;height:auto;padding:0;background:transparent;color:#7a7281;font-size:.72rem;font-weight:700}.laboratory-category-form-arrow{color:#a63442;font-size:.74rem}@media(max-width:640px){.laboratory-tests-summary-btn{width:100%}.laboratory-test-list-modal{width:min(100%,calc(100vw - 1.25rem));max-height:82vh}.laboratory-test-list-modal .perm-modal-head,.laboratory-test-list-modal footer{padding-inline:14px}.laboratory-test-name-list{grid-template-columns:1fr;padding:14px}.laboratory-request-categories .laboratory-category-form-btn{width:100%}}

.laboratory-correction-modal{width:min(34rem,calc(100vw - 2rem))}.laboratory-correction-note{display:flex;align-items:flex-start;gap:9px;margin:14px 0;padding:11px 12px;border:1px solid #efd2d7;border-radius:10px;background:#fff8f9;color:#5b6578;font-weight:600;line-height:1.6}.laboratory-correction-note i{margin-top:3px;color:#8b1020}.laboratory-required{margin-inline-start:5px;color:#9b1323;font-size:.75rem;font-weight:800}.laboratory-correction-modal textarea{min-height:7rem;resize:vertical}@media(max-width:640px){.laboratory-correction-modal{width:min(100%,calc(100vw - 1.25rem))}}

/* The request form keeps its identity and actions visible while only its fields scroll. */
.laboratory-page + .laboratory-page{margin-top:1rem}
.laboratory-page .laboratory-request-modal{width:min(940px,calc(100vw - 2rem));max-width:940px;max-height:min(90dvh,52rem);display:flex;flex-direction:column;overflow:hidden;padding:0!important}.laboratory-request-modal .perm-modal-head{flex:0 0 auto;display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:18px 20px 14px;border-bottom:1px solid #f2d9dd;background:#fff}.laboratory-request-modal .perm-modal-head .card-title{margin:0}.laboratory-request-form{display:flex;flex:1 1 auto;flex-direction:column;min-height:0}.laboratory-request-modal-body{display:flex;flex:1 1 auto;flex-direction:column;gap:16px;min-height:0;overflow-y:auto;padding:18px 20px 16px;scrollbar-color:#d78691 #fff3f5;scrollbar-width:thin}.laboratory-request-modal .entity-form-grid{column-gap:14px;row-gap:15px}.laboratory-request-modal .entity-form-grid>label.form-label,.laboratory-request-modal .entity-form-grid>div,.laboratory-request-modal .laboratory-test-picker{display:grid;align-content:start;gap:8px;margin:0;line-height:1.25}.laboratory-request-modal .entity-form-grid>label.form-label,.laboratory-request-modal .entity-form-grid>div>.form-label{margin:0}.laboratory-request-modal .entity-form-grid .form-input:not(textarea),.laboratory-request-modal .entity-form-grid .modern-select-trigger,.laboratory-request-modal .laboratory-test-picker .modern-select-trigger{box-sizing:border-box;min-height:2.75rem}.laboratory-request-modal .laboratory-label-title{display:inline-flex;align-items:baseline;gap:5px}.laboratory-request-modal .entity-form-grid .form-label small{margin:0}.laboratory-request-modal .laboratory-test-picker{margin-top:0;padding-top:16px}.laboratory-request-modal .laboratory-picker-help{margin:0}.laboratory-request-form>footer{display:flex;flex:0 0 auto;align-items:center;justify-content:flex-start;gap:8px;margin:0;padding:14px 20px;border-top:1px solid #f2d9dd;background:#fff;box-shadow:0 -8px 18px rgba(82,23,31,.04)}@media(max-width:640px){.laboratory-page .laboratory-request-modal{width:min(100%,calc(100vw - 1.25rem));max-height:calc(100dvh - 1.25rem);overflow:hidden}.laboratory-request-modal .perm-modal-head{padding:14px}.laboratory-request-modal-body{gap:14px;padding:14px}.laboratory-request-form>footer{padding:12px 14px}.laboratory-request-modal .entity-form-grid{row-gap:13px}}
.laboratory-existing-patient-modal{width:min(31rem,calc(100vw - 2rem));padding:0!important;overflow:hidden}.laboratory-existing-patient-modal .perm-modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:18px 20px 14px;border-bottom:1px solid #f2d9dd;background:#fff}.laboratory-existing-patient-content{display:flex;align-items:flex-start;gap:13px;padding:20px;color:#26334d}.laboratory-existing-patient-content>i{display:grid;place-items:center;flex:0 0 auto;width:2.5rem;height:2.5rem;border-radius:50%;background:#fff1f3;color:#8b1020}.laboratory-existing-patient-content>div{display:grid;gap:4px}.laboratory-existing-patient-content strong{color:#56101a}.laboratory-existing-patient-content p{margin:0;line-height:1.65}.laboratory-existing-patient-content small{color:#71809b}.laboratory-existing-patient-modal footer{display:flex;justify-content:flex-start;gap:8px;padding:14px 20px;border-top:1px solid #f2d9dd;background:#fff}.laboratory-duplicate-warning>span{color:#64748b;font-size:.86rem;line-height:1.55}.laboratory-duplicate-warning button{align-items:center}.laboratory-duplicate-warning button>span{display:grid;gap:3px}.laboratory-duplicate-warning button>i{color:#8b1020}.laboratory-existing-patient-selected button{align-self:flex-start;font-size:.82rem}.laboratory-existing-patient-selected strong{color:#53101a}@media(max-width:640px){.laboratory-existing-patient-modal{width:min(100%,calc(100vw - 1.25rem))}.laboratory-existing-patient-modal .perm-modal-head,.laboratory-existing-patient-content,.laboratory-existing-patient-modal footer{padding-inline:14px}.laboratory-existing-patient-modal footer{flex-wrap:wrap}.laboratory-existing-patient-modal footer .btn{flex:1}}
.laboratory-request-modal{position:relative}.laboratory-existing-patient-focus{position:absolute;inset:0;z-index:4;display:grid;place-items:center;padding:1.25rem;background:rgba(255,255,255,.18);backdrop-filter:blur(4px);-webkit-backdrop-filter:blur(4px)}.laboratory-existing-patient-focus-card{width:min(27rem,100%);display:grid;grid-template-columns:auto minmax(0,1fr);gap:.8rem 1rem;padding:1.1rem 1.15rem;border:1px solid #f0c6cd;border-radius:1rem;background:#fff;box-shadow:0 1.25rem 3rem rgba(82,23,31,.18)}.laboratory-existing-patient-focus-icon{display:grid;place-items:center;width:2.55rem;height:2.55rem;border-radius:.85rem;background:#fff1f3;color:#8b1020;font-size:1.05rem}.laboratory-existing-patient-focus-copy{display:grid;gap:.24rem;min-width:0}.laboratory-existing-patient-focus-copy>span{color:#71809b;font-size:.78rem;font-weight:700}.laboratory-existing-patient-focus-copy strong{color:#56101a;font-size:1rem;overflow-wrap:anywhere}.laboratory-existing-patient-focus-copy p{margin:0;color:#64748b;font-size:.86rem;line-height:1.55}.laboratory-existing-patient-focus-actions{grid-column:1/-1;display:flex;justify-content:flex-start;gap:.55rem;margin-top:.15rem}.laboratory-existing-patient-focus-actions .btn{min-height:2.45rem}@media(max-width:640px){.laboratory-existing-patient-focus{padding:.85rem}.laboratory-existing-patient-focus-card{grid-template-columns:1fr;padding:1rem}.laboratory-existing-patient-focus-icon{width:2.3rem;height:2.3rem}.laboratory-existing-patient-focus-actions{display:grid;grid-template-columns:1fr}.laboratory-existing-patient-focus-actions .btn{width:100%}}
.laboratory-page .laboratory-individual-test-picker{display:grid;gap:.75rem;margin-top:.2rem;padding:1rem;border:1px solid #efc2c8;border-radius:.85rem;background:#fffafb}.laboratory-page .laboratory-individual-test-picker header{display:flex;align-items:center;justify-content:space-between;gap:1rem}.laboratory-page .laboratory-individual-test-picker header>div{display:grid;gap:.2rem;min-width:0}.laboratory-page .laboratory-individual-test-picker strong{color:#76101d}.laboratory-page .laboratory-individual-test-picker small{margin:0;color:#71809b;line-height:1.45}.laboratory-page .laboratory-show-tests-button{white-space:nowrap;padding:.48rem .75rem;font-size:.82rem}.laboratory-page .laboratory-individual-test-actions{display:flex;align-items:center;gap:.8rem;padding-top:.1rem}.laboratory-page .laboratory-text-action{border:0;background:transparent;color:#8b1020;font:inherit;font-size:.84rem;font-weight:700;cursor:pointer}.laboratory-page .laboratory-text-action:hover{text-decoration:underline}.laboratory-page .laboratory-individual-test-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem;max-height:17rem;overflow:auto;padding-inline-end:.2rem;scrollbar-color:#d78691 #fff3f5;scrollbar-width:thin}.laboratory-page .laboratory-individual-test{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:.65rem;min-height:3.25rem;padding:.62rem .7rem;border:1px solid #f0d5d9;border-radius:.65rem;background:#fff;color:#34415a;cursor:pointer;transition:border-color 140ms ease,background-color 140ms ease,box-shadow 140ms ease}.laboratory-page .laboratory-individual-test:hover{border-color:#d58490;background:#fff8f9}.laboratory-page .laboratory-individual-test.is-selected{border-color:#ad1d30;background:#fff4f5;box-shadow:0 4px 12px #8b102012}.laboratory-page .laboratory-individual-test input{width:1rem;height:1rem;margin:0;accent-color:#8b1020}.laboratory-page .laboratory-individual-test span{display:grid;gap:.14rem;min-width:0}.laboratory-page .laboratory-individual-test span strong{color:inherit;font-size:.88rem;overflow-wrap:anywhere}.laboratory-page .laboratory-individual-test span small{font-size:.73rem;overflow-wrap:anywhere}.laboratory-page .laboratory-individual-test>i{opacity:0;color:#8b1020;font-size:.8rem}.laboratory-page .laboratory-individual-test.is-selected>i{opacity:1}@media(max-width:640px){.laboratory-page .laboratory-individual-test-picker header{align-items:flex-start;flex-direction:column}.laboratory-page .laboratory-show-tests-button{width:100%}.laboratory-page .laboratory-individual-test-grid{grid-template-columns:1fr;max-height:14rem}.laboratory-page .laboratory-individual-test-actions{justify-content:space-between}}
.laboratory-page .laboratory-test-picker .modern-select-menu{max-height:min(55dvh,33rem)}.laboratory-page .modern-select-option.is-expandable{background:#fff8f9}.laboratory-page .modern-select-option-expand{display:inline-flex;align-items:center;gap:.35rem;color:#8b1020;font-size:.72rem;font-weight:700;white-space:nowrap}.laboratory-page .modern-select-option-expand i{font-size:.65rem}.laboratory-page .modern-select-option-details{margin:.1rem .25rem .55rem;padding:.6rem;border:1px solid #efc2c8;border-radius:.75rem;background:#fff}.laboratory-page .modern-select-option-details .laboratory-individual-test-picker{margin:0;padding:0;border:0;border-radius:0;background:transparent}.laboratory-page .modern-select-option-details .laboratory-individual-test-picker header{padding-bottom:.55rem;border-bottom:1px solid #f3dde1}.laboratory-page .modern-select-option-details .laboratory-individual-test-grid{max-height:15rem}@media(max-width:640px){.laboratory-page .laboratory-test-picker .modern-select-menu{max-height:min(64dvh,31rem)}.laboratory-page .modern-select-option-details{margin-inline:.1rem;padding:.55rem}.laboratory-page .modern-select-option-details .laboratory-individual-test-grid{max-height:13rem}}
.laboratory-page .modern-select-option-details .laboratory-individual-test-picker{gap:.42rem}.laboratory-page .modern-select-option-details .laboratory-individual-test-picker header{display:flex;align-items:center;justify-content:space-between;padding-bottom:.36rem}.laboratory-page .modern-select-option-details .laboratory-individual-test-picker header strong{display:inline-flex;align-items:baseline;gap:.38rem;font-size:.84rem}.laboratory-page .modern-select-option-details .laboratory-individual-test-picker header small{font-size:.7rem;font-weight:500}.laboratory-page .modern-select-option-details .laboratory-individual-test-actions{justify-content:flex-start;gap:.65rem;padding:0}.laboratory-page .modern-select-option-details .laboratory-text-action{font-size:.76rem}.laboratory-page .modern-select-option-details .laboratory-individual-test-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:.34rem;max-height:8.25rem;padding-inline-end:.1rem}.laboratory-page .modern-select-option-details .laboratory-individual-test{grid-template-columns:auto minmax(0,1fr) auto;gap:.36rem;min-height:2.15rem;padding:.3rem .42rem;border-radius:.5rem}.laboratory-page .modern-select-option-details .laboratory-individual-test span strong{font-size:.76rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.laboratory-page .modern-select-option-details .laboratory-individual-test input{width:.86rem;height:.86rem}.laboratory-page .modern-select-option-details .laboratory-individual-test>i{font-size:.65rem}@media(max-width:640px){.laboratory-page .modern-select-option-details .laboratory-individual-test-grid{grid-template-columns:repeat(2,minmax(0,1fr));max-height:8.5rem}.laboratory-page .modern-select-option-details .laboratory-individual-test{min-height:2.1rem}.laboratory-page .modern-select-option-details .laboratory-individual-test-picker header{flex-direction:row;align-items:center}.laboratory-page .modern-select-option-details .laboratory-individual-test-picker header>div{display:contents}}
.modern-select-close-row{display:flex;justify-content:flex-start;padding:.1rem .2rem .35rem}.modern-select-close{display:inline-flex;align-items:center;gap:.32rem;border:0;border-radius:.45rem;background:transparent;color:#66748b;padding:.22rem .38rem;font:inherit;font-size:.72rem;font-weight:700}.modern-select-close:hover{background:var(--brand-50);color:var(--brand-900)}.laboratory-page .modern-select-option-details .laboratory-individual-test-picker{gap:.34rem}.laboratory-page .modern-select-option-details .laboratory-individual-test-picker header{padding-bottom:.26rem}.laboratory-page .modern-select-option-details .laboratory-individual-test-toolbar{display:flex;align-items:center;justify-content:space-between;gap:.45rem}.laboratory-page .modern-select-option-details .laboratory-individual-test-search{display:flex;align-items:center;gap:.32rem;min-width:0;flex:1;border:1px solid #f0d5d9;border-radius:.45rem;background:#fff;padding:.18rem .4rem;color:#8b1020}.laboratory-page .modern-select-option-details .laboratory-individual-test-search i{font-size:.68rem}.laboratory-page .modern-select-option-details .laboratory-individual-test-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:#34415a;font:inherit;font-size:.74rem}.laboratory-page .modern-select-option-details .laboratory-individual-test-search input::placeholder{color:#95a0b1}.laboratory-page .modern-select-option-details .laboratory-individual-test-actions{gap:.42rem;white-space:nowrap}.laboratory-page .modern-select-option-details .laboratory-text-action{font-size:.7rem}.laboratory-page .modern-select-option-details .laboratory-individual-test-grid{max-height:6rem}.laboratory-page .modern-select-option-details .laboratory-individual-test{min-height:1.82rem;padding:.22rem .34rem}.laboratory-page .modern-select-option-details .laboratory-individual-test span strong{font-size:.71rem}.laboratory-page .laboratory-individual-test-empty{grid-column:1/-1;padding:.6rem;color:#71809b;font-size:.75rem;text-align:center}@media(max-width:640px){.laboratory-page .modern-select-option-details .laboratory-individual-test-toolbar{align-items:stretch;flex-direction:column}.laboratory-page .modern-select-option-details .laboratory-individual-test-actions{justify-content:flex-start}.laboratory-page .modern-select-option-details .laboratory-individual-test-grid{max-height:5.75rem}.modern-select-close-row{padding-bottom:.25rem}}
.laboratory-page .laboratory-test-picker .modern-select.is-open .modern-select-backdrop{z-index:255;background:rgba(245,238,240,.34);backdrop-filter:blur(2.5px);-webkit-backdrop-filter:blur(2.5px)}.laboratory-page .laboratory-test-picker .modern-select-close-row{position:sticky;top:-.35rem;z-index:3;justify-content:flex-start;margin:-.1rem -.1rem .3rem;padding:.42rem .35rem .32rem;background:#fff;border-bottom:1px solid #f3dde1}.laboratory-page .laboratory-test-picker .modern-select-close{min-height:2rem;border:1px solid #efb8c0;border-radius:.55rem;background:#fff5f6;color:#7e1020;padding:.32rem .62rem;font-size:.78rem;box-shadow:0 2px 7px #8b102014}.laboratory-page .laboratory-test-picker .modern-select-close:hover{border-color:#a81c2e;background:#8b1020;color:#fff}
.laboratory-page .laboratory-test-picker .modern-select.is-open .modern-select-backdrop{background:rgba(245,238,240,.44)}.laboratory-page .modern-select-option-details .laboratory-individual-test-picker header{gap:.5rem}.laboratory-page .laboratory-individual-test-close{display:inline-flex;align-items:center;gap:.28rem;flex:0 0 auto;border:1px solid #efb8c0;border-radius:.42rem;background:#fff5f6;color:#7e1020;padding:.2rem .42rem;font:inherit;font-size:.68rem;font-weight:700;white-space:nowrap}.laboratory-page .laboratory-individual-test-close:hover{border-color:#a81c2e;background:#8b1020;color:#fff}@media(max-width:640px){.laboratory-page .laboratory-individual-test-close{font-size:.64rem;padding:.18rem .34rem}}
