/* Blood Master Sheet: the look of screens v0.5 (doc/design/bms_mockups.py), itself MediRec 3.4's (patients/static/patients/p34.css) */
:root { --ink: #1F2A27; --muted: #6B7874; --rule: #DAE3E0; --acc: #106B5A; --paper: #F2F5F4; --bad: #C0392B; --warn: #7A5200;
  --y: #8C6400; --yf: #FFF1C9; }
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); font: 13px/1.45 -apple-system, "Helvetica Neue", Arial, sans-serif; }
a { color: var(--acc); }
.m-top { height: 42px; background: #123D33; color: #DDE7E3; display: flex; align-items: center; gap: 10px; padding: 0 16px; font-size: 12.5px; }
.m-top .logo { width: 16px; height: 16px; border-radius: 4px; background: #3FA58A; } .m-top b { color: #fff; }
.m-top a { color: #DDE7E3; } .m-top .m-path { margin-left: 14px; } .m-top .sep { color: #7E968F; padding: 0 3px; }
.m-topr { margin-left: auto; display: flex; align-items: center; gap: 14px; } .m-topr form { margin: 0; }
.m-mode { display: inline-flex; border: 1px solid #C6D3CF; border-radius: 7px; overflow: hidden; background: #fff; }
.m-mode button { font: inherit; border: 0; background: #fff; padding: 2px 11px; font-size: 11.5px; font-weight: 600; color: #4C5A55; cursor: pointer; }
.m-mode button.on { background: var(--acc); color: #fff; }
button.link { font: inherit; background: none; border: 0; color: #DDE7E3; cursor: pointer; text-decoration: underline; }
.acting { background: #6A3FA0; color: #fff; padding: 7px 16px; display: flex; align-items: center; gap: 18px; font-size: 13px; }
.acting span { color: #E8E0F5; } .acting form { margin-left: auto; }
.acting .end { font: inherit; font-size: 12.5px; font-weight: 600; background: #fff; color: #2F1F4D; border: 0; border-radius: 6px; padding: 3px 14px; cursor: pointer; }
.acting form { margin: 0; }
.m-body { max-width: 1240px; margin: 0 auto; padding: 14px 16px 30px; }
.m-map { background: #fff; border: 1px solid var(--rule); border-radius: 10px; padding: 8px 10px 4px; margin-bottom: 12px; overflow-x: auto; }
.m-map svg { display: block; } .m-map a:hover rect, .m-map a:hover polygon { filter: brightness(0.96); }
.m-ph { display: flex; align-items: center; gap: 10px; margin: 6px 0 12px; flex-wrap: wrap; }
.m-ph h4 { margin: 0; font-size: 20px; }
.m-ph .n, .m-list .n { width: 26px; height: 26px; border-radius: 50%; background: var(--acc); color: #fff; font-weight: 700; display: inline-grid; place-items: center; font-size: 12px; }
.m-ph .oc, .m-list .oc { background: var(--acc); color: #fff; font-weight: 700; border-radius: 13px; padding: 2px 9px; font-size: 12px; }
.m-acts { margin-left: auto; display: flex; align-items: center; gap: 8px; } .m-acts form { margin: 0; }
.m-why { color: var(--muted); font-size: 12px; }
.m-card { background: #fff; border: 1px solid #E6E1D8; border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.m-card.soon { color: var(--muted); }
.m-cap { font-size: 11.5px; font-weight: 700; letter-spacing: .04em; color: #4C5A55; margin-bottom: 8px; display: flex; align-items: center; gap: 7px; }
.m-cap .c { width: 18px; height: 18px; border-radius: 50%; background: var(--acc); color: #fff; font-size: 10.5px; display: inline-grid; place-items: center; }
.m-btn { display: inline-block; font: inherit; font-size: 12.5px; font-weight: 600; border: 1px solid #C9C1B2; background: #fff; color: var(--ink);
  border-radius: 7px; padding: 5px 12px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.m-btn.go { background: var(--acc); border-color: var(--acc); color: #fff; } .m-btn.sm { padding: 3px 9px; font-size: 12px; }
.m-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #ECE8E0; font-size: 12.5px; }
.m-table th { font-size: 11px; color: var(--muted); font-weight: 600; background: #F7F5F0; text-align: left; padding: 6px 8px; border-bottom: 1px solid #E4DFD5; white-space: nowrap; }
.m-table td { padding: 5px 8px; border-bottom: 1px solid #F0ECE4; vertical-align: middle; }
.m-table td.n, .m-table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.m-table td.k, .k { color: var(--muted); white-space: nowrap; }
.m-table tr.sel td { background: #FFF9EC; } .m-table td.acts { text-align: right; white-space: nowrap; }
.m-table td.acts form { display: inline; margin: 0; }
.m-id { font: 700 11px/1.6 ui-monospace, Menlo, monospace; color: #1F4E8C; background: #E8EFF8; border-radius: 4px; padding: 0 6px; white-space: nowrap; }
.m-pill { display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.6; border-radius: 9px; padding: 0 7px; border: 1px solid; }
.m-pill.mute { color: var(--muted); border-color: var(--rule); background: #fff; font-weight: 500; }
.m-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; } .m-bar form { margin: 0; }
.m-in { font: inherit; border: 1px solid #CFC8BA; border-radius: 6px; padding: 4px 8px; background: #fff; } .m-in.s { width: 320px; }
.m-drop { border: 1.5px dashed #C9C1B2; border-radius: 10px; background: #FBFAF7; padding: 16px; margin-bottom: 10px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.m-k { color: var(--muted); font-size: 12px; }
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.m-list { list-style: none; margin: 0; padding: 0; } .m-list li { padding: 5px 0; } .m-list a { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.msg { background: #F1F8F1; border: 1px solid #A5D6A7; border-radius: 7px; padding: 6px 10px; } .msg.warn { background: #FFF6EC; border-color: #F0C08A; color: var(--warn); }
.login { max-width: 380px; margin: 60px auto; } .login h1 { font-size: 20px; }
.login label, .form label { display: block; margin-bottom: 10px; font-weight: 600; } .login input, .form input, .form select { display: block; width: 100%; font: inherit; padding: 6px 8px; margin-top: 4px; border: 1px solid #CFC8BA; border-radius: 6px; }
.form { max-width: 460px; } .err { color: var(--bad); font-weight: 500; font-size: 12px; }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; margin: 0 0 12px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; } .pw { font: 700 15px ui-monospace, Menlo, monospace; }
.foot { text-align: center; color: var(--muted); font-size: 11.5px; padding: 10px; }
@media (max-width: 760px) { .m-grid { grid-template-columns: 1fr; } .m-in.s { width: 100%; } }
.m-work { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 12px; } .m-mainc { min-width: 0; }
.m-side { background: #fff; border: 1px solid #E6E1D8; border-radius: 10px; padding: 12px 14px; align-self: start; }
.m-side-hd { font-weight: 700; margin-bottom: 8px; }
.m-pill.warn { color: var(--warn); border-color: #F0C08A; background: #FFF6EC; } .m-pill.ok { color: #0F5E4C; border-color: #A5D6A7; background: #F1F8F1; }
@media (max-width: 900px) { .m-work { grid-template-columns: 1fr; } }
.m-tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; } .m-tabs a { border: 1px solid #D9D2C4; border-radius: 6px; padding: 1px 8px; text-decoration: none; color: var(--ink); font-size: 12px; }
.m-tabs a.on, .m-pager a.on { background: var(--yf); border-color: var(--y); font-weight: 700; }
.m-split { display: grid; grid-template-columns: 430px minmax(0, 1fr); gap: 12px; } .m-left, .m-right { min-width: 0; }
.m-pager { display: flex; gap: 4px; margin-bottom: 6px; flex-wrap: wrap; } .m-pager a { border: 1px solid #D9D2C4; border-radius: 5px; padding: 0 7px; font-size: 12px; text-decoration: none; color: var(--ink); }
.pg-wrap { position: relative; border: 1px solid #E0D9CC; } .pg-wrap img { display: block; width: 100%; }
.pg-wrap .mk, .mk { position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #D92D20; color: #fff; font: 700 10px/18px -apple-system, Arial; text-align: center; font-style: normal; }
.m-edit td { padding: 3px 5px; } .m-edit .m-in { padding: 2px 5px; } .m-in.w { width: 150px; } .m-in.v { width: 64px; text-align: right; } .m-in.u { width: 70px; } .m-in.f { width: 36px; } .m-in.r { width: 140px; } .m-in.pgn { width: 34px; } .m-in.w2 { width: 260px; }
.m-in.red, .red { color: var(--bad); font-weight: 600; }
.m-edit tr.hand td { background: #F3F8F6; } .m-edit tr.hit td { background: #FDECEC; } .m-edit tr.onpage td:first-child { font-weight: 700; color: var(--ink); }
.names { border-color: #F3B9B3; background: #FFF8F7; } .nok { white-space: nowrap; font-size: 11.5px; color: var(--bad); }
.m-bar.end { justify-content: flex-end; margin: 8px 0 0; }
@media (max-width: 1100px) { .m-split { grid-template-columns: 1fr; } }
.m-in.v.long { width: 230px; text-align: left; }
/* steps 4–5, O6, O7: the template list and preview, the two lists, the sheet (screens v0.5) */
.m-radio { display: flex; align-items: center; gap: 7px; padding: 3px 0; } .m-radio input { accent-color: var(--acc); margin: 0; }
.m-tsel { display: flex; gap: 12px; align-items: stretch; }
.m-tlist { width: 300px; flex: none; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; align-self: flex-start; }
.m-tli { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--rule); cursor: pointer; background: #fff; }
.m-tli input { display: none; } .m-tli:last-child { border-bottom: 0; } .m-tli.on { background: #FFF1D6; box-shadow: inset 3px 0 0 var(--acc); } .m-tli .m-k { margin-left: auto; }
.m-tprev { flex: 1; min-width: 0; }
.m-prev { height: 300px; overflow: hidden; border: 1px solid #D4D4D4; border-radius: 4px; background: #fff; } .m-prev.tall { height: 520px; }
.m-prev .xl-wrap { max-height: 100%; height: 100%; border: 0; }
.m-dual { display: grid; grid-template-columns: minmax(0, 1fr) 128px minmax(0, 1fr); gap: 12px; }
.m-dl { border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.m-dl-hd { display: flex; justify-content: space-between; align-items: center; background: #F2F5F4; padding: 8px 12px; border-bottom: 1px solid var(--rule); }
.m-dl-tools { padding: 8px 12px; border-bottom: 1px solid var(--rule); } .m-dl-tools .m-in { width: 100%; }
.m-dl-body { flex: 1; padding: 2px 0 8px; max-height: 340px; overflow-y: auto; } .m-gh { font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .04em; padding: 8px 12px 3px; }
.m-it { display: flex; align-items: center; gap: 10px; padding: 4px 12px; cursor: pointer; } .m-it.sel { background: #FFF1D6; } .m-it:hover { background: #FBF7EE; }
.m-it-t { flex: 1; display: grid; line-height: 1.3; min-width: 0; } .m-it-t .m-k { font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-cb { width: 14px; height: 14px; border: 1px solid #B7AF9F; border-radius: 3px; display: inline-grid; place-items: center; font-size: 9px; background: #fff; flex: none; }
.m-cb.on { background: var(--acc); border-color: var(--acc); color: #fff; }
.m-mv { width: 22px; height: 22px; border: 1px solid #C6D3CF; border-radius: 5px; display: inline-grid; place-items: center; color: var(--acc); font-weight: 700; flex: none; }
.m-mid { display: flex; flex-direction: column; justify-content: center; gap: 8px; } .m-mid .m-btn { text-align: center; padding: 6px 0; }
.xl-wrap { overflow: auto; max-height: 640px; border: 1px solid #C8C8C8; background: #fff; }
table.xl { border-collapse: separate; border-spacing: 0; table-layout: fixed; font-family: Arial, sans-serif; color: #000; }
table.xl .cv { overflow: hidden; }
table.xl td.over, table.xl td.over .cv { overflow: visible; } table.xl td.over { z-index: 2; } table.xl thead td.over { z-index: 4; }
table.xl tr td.under { border-right-color: transparent; }        /* opaque: frozen header rows and label columns hide what scrolls under them */
table.xl td { padding: 1px 4px; border-right: 1px solid #E4E4E4; border-bottom: 1px solid #E4E4E4; overflow: hidden; text-overflow: ellipsis; background-clip: padding-box; vertical-align: bottom; line-height: 1.25; }
table.xl td { background-color: #fff; }
table.xl thead td { position: sticky; z-index: 2; } table.xl td.fx { position: sticky; z-index: 1; } table.xl thead td.fx { z-index: 3; }
table.xl td.dc { text-align: right; font-variant-numeric: tabular-nums; } table.xl thead td.dc { text-align: center; }
table.xl td.val { cursor: pointer; } table.xl td.val:hover { outline: 1px solid #9BC5B3; outline-offset: -1px; }
table.xl tr td.red { color: #FF0000; } table.xl tr td.ocr { background-color: #E7E6E6; } table.xl td.selc { outline: 2px solid #107C41; outline-offset: -2px; }
table.xl tr.new td.lc { color: #106B5A; }
.xl-tabs { display: flex; align-items: center; background: #F3F3F3; border: 1px solid #C8C8C8; border-top: 0; font: 12px Calibri, Carlito, Arial, sans-serif; flex-wrap: wrap; }
.xl-tabs button { font: inherit; border: 0; border-right: 1px solid #D4D4D4; background: transparent; color: #333; padding: 4px 14px; cursor: pointer; }
.xl-tabs button.on { background: #fff; color: #107C41; font-weight: 700; box-shadow: inset 0 2px 0 #107C41; }
.xl-note { margin-left: auto; padding: 0 10px; color: #777; font-size: 11px; }
.m-work.wide { grid-template-columns: minmax(0, 1fr) 280px; }
.m-big { font-size: 22px; font-weight: 700; margin: 2px 0 8px; } .m-big small { font-size: 13px; color: var(--muted); font-weight: 500; }
.kv.sm { grid-template-columns: 80px 1fr; font-size: 12px; } .m-rel { display: flex; align-items: center; gap: 6px; padding: 3px 0; } .m-rel .m-k { flex: 1; font-size: 11.5px; }
.m-in.sm { padding: 2px 4px; font-size: 12px; } td.wrap { white-space: normal; max-width: 260px; }
@media (max-width: 900px) { .m-tsel { flex-direction: column; } .m-tlist { width: 100%; } .m-dual { grid-template-columns: 1fr; } .m-mid { flex-direction: row; flex-wrap: wrap; } }
/* M5: step 5's switches (MediRec's recipient rules), Advanced mode's page */
.rr-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 12px; }
.rr-g { border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; } .rr-g h3 { margin: 0; font-size: 14px; padding: 10px 14px; background: #F7F9F8; border-bottom: 1px solid var(--rule); display: flex; gap: 8px; align-items: center; }
.rr-t { width: 100%; border-collapse: collapse; } .rr-t td { padding: 6px 14px; border-bottom: 1px solid #EEF1F0; vertical-align: middle; }
.rr-t tr:last-child td { border-bottom: 0; } .rr-t td.rr-sw { width: 1%; white-space: nowrap; } .rr-t td.rr-in { width: 1%; white-space: nowrap; text-align: right; color: var(--muted); font-size: 12px; }
.rr-t tr.off td { color: #A9B2AF; } .rr-t tr.on td.rr-nm { font-weight: 600; }
.sw { display: inline-flex; border: 1px solid #C6CFCC; border-radius: 7px; overflow: hidden; } .sw label { margin: 0; cursor: pointer; } .sw input { display: none; }
.sw span { display: inline-block; padding: 3px 12px; font-size: 12.5px; font-weight: 600; color: #4C5A55; background: #fff; }
.sw input:checked + span { background: #22302C; color: #fff; } .sw label:first-child input:checked + span { background: var(--acc); }
.sw.dis { opacity: .55; } .sw.dis label { cursor: default; }
.pg-modal { position: fixed; inset: 0; background: rgba(20, 30, 27, .55); z-index: 50; display: grid; place-items: center; padding: 20px; }
.pg-modal[hidden] { display: none; } .pg-box { background: #fff; border-radius: 10px; padding: 12px 14px; width: min(900px, 100%); max-height: 100%; overflow: auto; }
.pg-big img { width: 100%; } #pg-marks { position: absolute; inset: 0; pointer-events: none; }
.hl { position: absolute; border: 2px solid #F2A900; background: rgba(255, 214, 0, .22); border-radius: 2px; }
.hl.hl-value { border-color: #D92D20; background: rgba(217, 45, 32, .16); }
.dbt { color: var(--warn); background: #FFF6EC; border-radius: 4px; padding: 0 4px; white-space: normal; font-size: 11.5px; } .mth { color: #0F5E4C; font-weight: 600; }
.m-edit tr td:last-child { max-width: 260px; white-space: normal; } p.chk b.warn { color: var(--warn); }

/* CR_B_023 (shiyu 26 Oct): MediRec's colours. The operator's pages purple (MediRec static/operator.css), the patient's green (its
   app.css body.as-patient, #106B5A, as above); an operator working for a patient sees the patient's green pages under the purple bar. */
.door-pill { display: none; }
body.as-operator { --acc: #6A3FA0; --paper: #F8F6FB; --rule: #DDD3EA; --y: #6A3FA0; --yf: #EFE9F7; background: var(--paper); }
body.as-operator .m-top { background: #2F1F4D; color: #E8E0F5; }
body.as-operator .m-top .logo { background: linear-gradient(135deg, #B79BE0, #6A3FA0); }
body.as-operator .m-top a, body.as-operator button.link { color: #E8E0F5; } body.as-operator .m-top .sep { color: #9C8BBF; }
body.as-operator .door-pill { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .06em; background: #B79BE0; color: #2F1F4D;
  border-radius: 20px; padding: 2px 10px; }
body.as-operator .m-mode { border-color: #6E5A93; }
body.as-operator .m-card { border-color: #DDD3EA; } body.as-operator .m-table th { background: #F3EFF9; }
html:has(body.as-operator) { background: #F8F6FB; }            /* the whole window, below the footer too */
/* CR_B_024 (shiyu 26 Oct): the master sheet as wide as the window; its bar stays at the top once the chart has scrolled away, and
   the sheet fills the window under it (scrolling inside only then); Fit and zoom; a cell's details on hover; ↑ Top */
body.wide .m-body { max-width: none; }
.sheet-card { background: #fff; border: 1px solid #E6E1D8; border-radius: 10px; margin-bottom: 12px; }
.sheet-bar { position: sticky; top: 0; z-index: 30; background: #fff; border-bottom: 1px solid #E6E1D8; border-radius: 10px 10px 0 0;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; }
.sheet-card.stuck .sheet-bar { border-radius: 0; box-shadow: 0 2px 6px rgba(0, 0, 0, .06); }
.sheet-bar .sb-info { flex: 1 1 320px; min-width: 0; }
.sb-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }
.sb-tabs { display: inline-flex; border: 1px solid #C8C8C8; border-radius: 7px; overflow: hidden; font: 12px Calibri, Carlito, Arial, sans-serif; }
.sb-tabs button { font: inherit; border: 0; border-right: 1px solid #D4D4D4; background: #F3F3F3; color: #333; padding: 4px 12px; cursor: pointer; }
.sb-tabs button:last-child { border-right: 0; } .sb-tabs button.on { background: #fff; color: #107C41; font-weight: 700; box-shadow: inset 0 -2px 0 #107C41; }
.zoom { display: inline-flex; align-items: center; border: 1px solid #C9C1B2; border-radius: 7px; overflow: hidden; }
.zoom button { font: inherit; font-size: 12.5px; font-weight: 600; border: 0; border-right: 1px solid #E1DACD; background: #fff; color: var(--ink);
  padding: 3px 10px; cursor: pointer; } .zoom button.on { background: var(--yf); }
.zoom .zl { font-size: 12px; color: var(--muted); padding: 0 9px; min-width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.sheet-card .xl-wrap { border: 0; border-radius: 0 0 10px 10px; max-height: none; height: calc(100vh - var(--bar-h, 48px)); overflow-x: auto; overflow-y: hidden; }
.sheet-card.stuck .xl-wrap { overflow-y: auto; }
.sheet-card .s2wrap .m-table { border: 0; }
.tip { position: fixed; z-index: 60; max-width: 340px; background: #fff; border: 1px solid #CFC8BA; border-radius: 8px; box-shadow: 0 6px 18px rgba(0, 0, 0, .14);
  padding: 9px 11px; font-size: 12.5px; pointer-events: none; }
.tip .th { font-weight: 700; margin-bottom: 4px; } .tip .tv { font-size: 18px; font-weight: 700; margin-bottom: 6px; } .tip .tv small { font-size: 12px; color: var(--muted); font-weight: 500; }
.tip .tv small.red { color: var(--bad); }
.tip dl { display: grid; grid-template-columns: 76px 1fr; gap: 2px 8px; margin: 0; } .tip dt { color: var(--muted); } .tip dd { margin: 0; overflow-wrap: anywhere; }
.tip .tk { margin-top: 6px; color: var(--acc); font-weight: 600; } .tip .tn { white-space: normal; line-height: 1.4; }
table.xl td[data-note] { cursor: help; }
.to-top { position: fixed; right: 22px; bottom: 22px; z-index: 40; font: inherit; font-size: 13px; font-weight: 600; background: #fff; color: var(--ink);
  border: 1px solid #CFC8BA; border-radius: 18px; padding: 6px 14px; box-shadow: 0 3px 10px rgba(0, 0, 0, .12); cursor: pointer; }
.to-top[hidden] { display: none; }
.sheet-foot .ent { white-space: nowrap; margin-left: 8px; } .sheet-foot i { font-style: normal; } .sheet-foot i.shown { color: var(--warn); font-weight: 600; }
