/* All colours and sizes are defined once here.
   Status colours: .s-<status>   Lab stage colours: .st-<stage>   */
:root {
  --bg: #f3f5f8; --card: #fff; --ink: #0f1b2d; --mute: #5f6f85; --line: #dfe5ec; --line-2: #c5cfdb;
  --acc: #0b7a75; --acc-2: #096661; --acc-ink: #fff; --soft: #e3f4f2;
  --bad: #c0271b; --bad-soft: #fdecea; --warn: #b25e09; --warn-soft: #fff3df; --ok: #0a7a4b; --ok-soft: #e0f6ea;
  --info: #1d5fd1; --info-soft: #e5eefd; --vio: #6a35c9; --vio-soft: #f0e9fc;
  --nav: #0d1b2a; --nav-2: #16283b; --nav-ink: #b8c7d6;
  --r: 10px; --shadow: 0 1px 2px #0d1b2a0d, 0 4px 14px #0d1b2a0a;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.45 "Segoe UI Variable Text", "Segoe UI", system-ui, Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; }
h2 { font-size: 21px; font-weight: 650; letter-spacing: -.01em; }
h3 { font-size: 16px; }
h4 { margin: 16px 0 8px; font-size: 12px; color: var(--mute); text-transform: uppercase; letter-spacing: .06em; font-weight: 650; }
.card > h4:first-child { margin-top: 0; }
a { color: var(--acc); }
.muted { color: var(--mute); font-size: 13px; }
.grow { flex: 1; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.error { color: var(--bad); font-style: normal; font-size: 13px; }
.icon { width: 18px; height: 18px; flex-shrink: 0; vertical-align: -3px; }
kbd { font: 600 10.5px ui-monospace, Consolas, monospace; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; opacity: .65; margin-left: 6px; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.nav { width: 232px; background: var(--nav); color: var(--nav-ink); padding: 12px 10px 20px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex !important; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; line-height: 1.25; color: #fff !important; padding: 6px 8px 16px !important; background: none !important; }
.brand .logo { width: 36px; height: 36px; flex: none; font-size: 13.5px; font-weight: 750; letter-spacing: .02em; }
.brand-logo { width: 36px; height: 36px; flex: none; object-fit: contain; border-radius: 9px; background: #fff; padding: 3px; }
.nav a .brand-name { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--acc); color: #fff; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #7f93a8; padding: 16px 10px 5px; font-weight: 650; }
.nav a { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; padding: 8px 10px; border-radius: 8px; margin: 1px 0; }
.nav a:hover { background: var(--nav-2); color: #fff; }
.nav a.active { background: var(--acc); color: #fff; font-weight: 600; }
.nav a span { flex: 1; }
.nav-fold summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; }
.nav-fold summary::after { content: "+"; font-size: 14px; }
.nav-fold[open] summary::after { content: "−"; }
.nav-fold summary::-webkit-details-marker { display: none; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 14px; background: var(--card); border-bottom: 1px solid var(--line); padding: 9px 22px; position: sticky; top: 0; z-index: 10; }
.org { display: flex; flex-direction: column; line-height: 1.25; }
.who { display: flex; align-items: center; gap: 9px; line-height: 1.2; }
.who > div { display: flex; flex-direction: column; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--soft); color: var(--acc); font-weight: 700; font-size: 12.5px; }
main { padding: 20px 22px 40px; flex: 1; max-width: 1500px; width: 100%; }
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.page-head h2 small { font-weight: 400; color: var(--mute); font-size: 14px; margin-left: 6px; }

/* ---------- building blocks ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.narrow-card { max-width: 760px; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.side-col { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 14px; align-items: start; }
@media (max-width: 1100px) { .two-col, .side-col { grid-template-columns: 1fr; } }

input, select, textarea { font: inherit; color: inherit; background: var(--card); border: 1px solid var(--line-2); border-radius: 8px; padding: 7px 10px; max-width: 100%; transition: border-color .12s, box-shadow .12s; }
input:hover, select:hover, textarea:hover { border-color: #9fb0c3; }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--acc); box-shadow: 0 0 0 3px #0b7a7526; }
input:disabled, select:disabled, textarea:disabled { background: var(--bg); color: var(--mute); }
textarea { width: 100%; }
input[type=checkbox] { width: 16px; height: 16px; vertical-align: -3px; accent-color: var(--acc); }
.narrow { width: 120px; }
.tiny { width: 78px; }
.search { position: relative; flex: 1; min-width: 220px; max-width: 420px; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--mute); }
.search input { width: 100%; padding-left: 34px; }

.btn { font: inherit; font-weight: 550; display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); border-radius: 8px; padding: 7px 13px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--acc); background: #f7fbfb; }
.btn.primary { background: var(--acc); border-color: var(--acc); color: var(--acc-ink); }
.btn.primary:hover { background: var(--acc-2); }
.btn.ghost { border-color: transparent; background: none; color: var(--mute); }
.btn.ghost:hover { background: var(--bg); color: var(--ink); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); background: var(--bad-soft); }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn.wide { width: 100%; justify-content: center; padding: 11px; margin-top: 12px; font-weight: 650; }
.btn:disabled { opacity: .5; cursor: default; }

.field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; font-weight: 550; color: var(--mute); }
.field > input, .field > select, .field > textarea { font-size: 14.5px; font-weight: 400; color: var(--ink); width: 100%; }
.grid { display: grid; gap: 12px 14px; margin: 8px 0; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.span4 { grid-column: span 4; }
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }

.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow); }
.table th { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); text-align: left; background: #f6f8fa; font-weight: 650; }
.table th.num { text-align: right; }
.table th, .table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafcfd; }
.table.compact th, .table.compact td { padding: 6px 9px; }
.table.compact { box-shadow: none; }
.table tr.off { opacity: .5; }
.table td small { display: block; color: var(--mute); font-size: 12.5px; }
.actions { text-align: right; white-space: nowrap; }
.actions > * { margin-left: 4px; }
.due { color: var(--bad); font-weight: 650; }
.empty { color: var(--mute); text-align: center; padding: 28px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; border-radius: 20px; padding: 2px 10px; background: #e9edf2; color: var(--mute); white-space: nowrap; }
.s-pending { background: var(--bad-soft); color: var(--bad); }
.s-partial, .s-admitted { background: var(--warn-soft); color: var(--warn); }
.s-entered, .s-opd { background: var(--info-soft); color: var(--info); }
.s-approved, .s-discharged { background: var(--ok-soft); color: var(--ok); }
.s-cancelled { background: #e9edf2; color: var(--mute); }
.s-lab { background: var(--soft); color: var(--acc); }
.s-ipd { background: var(--vio-soft); color: var(--vio); }
/* lab stages: --c is the stage colour, --s its soft background */
.st-sample { --c: var(--warn); --s: var(--warn-soft); }
.st-entry { --c: var(--info); --s: var(--info-soft); }
.st-review { --c: var(--vio); --s: var(--vio-soft); }
.st-ready { --c: var(--ok); --s: var(--ok-soft); }
.st-delivered, .st-cancelled { --c: var(--mute); --s: #e9edf2; }
.badge[class*="st-"] { background: var(--s); color: var(--c); }

.chips { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0; }
.chip { font: inherit; font-size: 13px; border: 1px solid var(--line-2); background: var(--card); border-radius: 20px; padding: 4px 12px; cursor: pointer; }
.chip:hover { border-color: var(--acc); }
.chip.on { background: var(--acc); color: #fff; border-color: var(--acc); }

#item-search, #test-search { width: 100%; font-size: 15.5px; padding: 10px 12px; }
.pick-list { border: 1px solid var(--line); border-radius: 8px; max-height: 210px; overflow: auto; margin: 6px 0; }
.pick-list.tall { max-height: 330px; }
.pick-list button { display: flex; gap: 10px; align-items: baseline; width: 100%; text-align: left; font: inherit; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 8px 11px; cursor: pointer; }
.pick-list button:last-child { border-bottom: 0; }
.pick-list button:hover { background: var(--soft); }
.pick-list .num { margin-left: auto; font-weight: 650; }
.picked { display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--soft); border-radius: 8px; padding: 10px 13px; }
.note { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--warn-soft); color: #6d3b06; border: 1px solid #f5d9a8; border-radius: 8px; padding: 9px 13px; font-size: 14px; margin: 0 0 14px; }
.note.bad { background: var(--bad-soft); border-color: #f5c4bf; color: #7d1a12; }
.totals { margin: 10px 0 0 auto; max-width: 330px; }
.totals > div { display: flex; justify-content: space-between; align-items: center; padding: 4px 0; gap: 10px; }
.totals .grand { border-top: 2px solid var(--ink); margin-top: 4px; font-size: 18px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 12px 0; }
.tile { position: relative; display: flex; flex-direction: column; gap: 4px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow); }
.tile b { font-size: 20px; font-variant-numeric: tabular-nums; }
.tiles.big { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.tiles.big .tile b { font-size: 26px; line-height: 1.2; }
.tile span { color: var(--mute); font-size: 13px; }
.tile small { color: var(--mute); font-size: 12.5px; }
.tile.good b { color: var(--ok); }
h4 .plain { text-transform: none; letter-spacing: 0; font-weight: 400; margin-left: 6px; }
.page-head.sub { margin: 18px 0 8px; }
.page-head.sub h4 { margin: 0; }
a.tile:hover { border-color: var(--acc); }
.tile.primary { border-left: 4px solid var(--acc); }
.tile.warn b { color: var(--bad); }
.tile kbd { position: absolute; right: 10px; top: 10px; }

/* owner view */
.money-line { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin: 10px 0 4px; }
.money-line > div { display: flex; flex-direction: column; gap: 2px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 16px; box-shadow: var(--shadow); min-width: 120px; }
.money-line > div span { color: var(--mute); font-size: 12.5px; }
.money-line > div b { font-size: 22px; line-height: 1.2; font-variant-numeric: tabular-nums; }
.money-line > i { align-self: center; font-style: normal; font-size: 20px; color: var(--mute); }
.money-line .main { border-left: 4px solid var(--acc); flex: 1; }
.money-line .good { flex: 1; }
.money-line .good b { color: var(--ok); }
.money-line .warn b { color: var(--bad); }
.two-col.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.breakdown .progress { min-width: 90px; }
.trend td.bars { width: 38%; min-width: 120px; }
.trend td.bars u, .key { display: block; height: 7px; border-radius: 4px; margin: 2px 0; min-width: 2px; }
.billed { background: var(--acc); }
.got { background: #7bc4a0; }
.key { display: inline-block; width: 12px; margin: 0 2px 0 8px; }
.table tfoot th { background: #f6f8fa; border-bottom: 0; }
@media (max-width: 1100px) { .two-col.even { grid-template-columns: 1fr; } }

.beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.bed { display: flex; flex-direction: column; gap: 2px; text-align: left; font: inherit; border-radius: var(--r); padding: 12px; border: 1px solid var(--line); background: var(--card); cursor: pointer; text-decoration: none; color: inherit; }
.bed b { font-size: 17px; }
.bed.free { border-left: 4px solid var(--ok); }
.bed.busy { border-left: 4px solid var(--warn); background: #fffaf0; }
/* moving rows by drag and drop (MasterScreen print order, a profile's tests) */
.drag-hint { margin: -6px 0 8px; }
.table th.drag-col { width: 28px; }
.drag-handle { cursor: grab; color: var(--mute); font-size: 16px; user-select: none; text-align: center; }
tr[draggable="true"], .order-list li { cursor: grab; }
.dragging { opacity: .4; }
.table tr.drop-target td, .order-list li.drop-target { box-shadow: inset 0 2px 0 var(--acc); background: var(--soft); }
.order-list { list-style: none; margin: 6px 0 14px; padding: 0; border: 1px solid var(--line); border-radius: 8px; max-height: 320px; overflow: auto; }
.order-list:empty { display: none; }
.order-list li { display: flex; align-items: center; gap: 8px; padding: 5px 10px; border-bottom: 1px solid var(--line); background: var(--card); }
.order-list li:last-child { border-bottom: 0; }
.order-list .order-no { width: 26px; text-align: right; color: var(--mute); font-variant-numeric: tabular-nums; }
.order-list .order-name { flex: 1; }
.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; max-height: 260px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }

.overlay { position: fixed; inset: 0; background: #0d1b2a8c; backdrop-filter: blur(2px); display: grid; place-items: start center; padding: 6vh 12px; overflow: auto; z-index: 20; }
.modal { background: var(--card); border-radius: 14px; width: min(540px, 100%); padding: 20px; box-shadow: 0 20px 60px #0d1b2a40; }
.modal.wide { width: min(960px, 100%); }
.modal h3 { margin-bottom: 12px; font-size: 17px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.toast { position: fixed; right: 20px; bottom: 20px; background: var(--ok); color: #fff; padding: 11px 18px; border-radius: 10px; z-index: 30; box-shadow: 0 8px 24px #0004; font-weight: 550; }
.toast.bad { background: var(--bad); }

/* ---------- sign in ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; background:
  radial-gradient(1200px 600px at 10% 0%, #0b7a7555 0%, transparent 60%),
  radial-gradient(900px 500px at 100% 100%, #1d5fd133 0%, transparent 60%),
  linear-gradient(135deg, #0d1b2a 0%, #0b3d47 100%); }
.login-box { display: grid; grid-template-columns: 1.1fr 1fr; width: min(860px, 100%); min-height: 460px; background: var(--card); border-radius: 18px; overflow: hidden; box-shadow: 0 30px 80px #0007; }
.login-side { position: relative; background: linear-gradient(160deg, var(--acc) 0%, var(--acc-2) 55%, #07403d 100%); color: #fff; padding: 40px 36px; display: flex; flex-direction: column; justify-content: space-between; gap: 32px; overflow: hidden; }
.login-brand { flex: 1; justify-content: center; }
.login-company { position: relative; z-index: 1; display: flex; flex-direction: column; gap: 2px; padding-top: 14px; border-top: 1px solid #ffffff2e; }
.login-company strong { font-size: 13.5px; font-weight: 650; letter-spacing: .02em; }
.login-company span { font-size: 11.5px; text-transform: uppercase; letter-spacing: .09em; opacity: .75; }
.login-side::after { content: ""; position: absolute; right: -90px; bottom: -90px; width: 260px; height: 260px; border-radius: 50%; border: 38px solid #ffffff12; pointer-events: none; }
.login-brand { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.login-logo { width: 92px; height: 92px; object-fit: contain; border-radius: 18px; background: #fff; padding: 10px; margin-bottom: 14px; box-shadow: 0 8px 24px #0003; }
.login-logo.monogram { display: grid; place-items: center; padding: 0; color: var(--acc); font-size: 34px; font-weight: 750; letter-spacing: .02em; }
.login-side h1 { font-size: 26px; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
.login-addr { margin: 0; opacity: .85; font-size: 13.5px; }
.login-form { padding: 40px 36px; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.login-form h2 { font-size: 24px; }
.login-form h2 + .muted { margin: 2px 0 8px; }
.login-form .btn.wide { margin-top: 6px; padding-top: 11px; padding-bottom: 11px; }
.login-ver { text-align: center; margin: 4px 0 0; }
@media (max-width: 700px) { .login-box { grid-template-columns: 1fr; min-height: 0; } .login-side { padding: 28px 24px; } .login-logo { width: 72px; height: 72px; } .login-form { padding: 28px 24px; } }

/* ---------- lab flow ---------- */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 12px 0 18px; }
.flow-step { position: relative; display: flex; flex-direction: column; gap: 3px; background: var(--card); border: 1px solid var(--line); border-top: 3px solid var(--c); border-radius: var(--r); padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow); cursor: pointer; font: inherit; text-align: left; }
.flow-step:hover, .flow-step.on { background: var(--s); border-color: var(--c); }
.flow-step .top { display: flex; align-items: center; gap: 8px; color: var(--c); font-weight: 650; font-size: 13px; }
.flow-step b { font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.flow-step small { color: var(--mute); font-size: 12.5px; }
.flow-step kbd { position: absolute; right: 10px; top: 12px; color: var(--mute); }
.flow.slim .flow-step { flex-direction: row; align-items: center; gap: 10px; padding: 10px 14px; }
.flow.slim .flow-step b { font-size: 20px; margin-left: auto; }

.progress { display: flex; align-items: center; gap: 8px; min-width: 120px; font-size: 12.5px; color: var(--mute); font-variant-numeric: tabular-nums; }
.progress i { flex: 1; height: 6px; border-radius: 6px; background: #e3e8ee; overflow: hidden; }
.progress i u { display: block; height: 100%; background: var(--acc); border-radius: 6px; }
.abn-count { color: var(--bad); font-weight: 650; font-size: 12.5px; }

.steps { list-style: none; display: flex; flex-wrap: wrap; gap: 0; padding: 0; margin: 0; }
.steps li { flex: 1; min-width: 150px; display: flex; align-items: center; gap: 10px; position: relative; padding: 4px 14px 4px 0; color: var(--mute); }
.steps li::after { content: ""; flex: 1; height: 2px; background: var(--line); margin-left: 6px; min-width: 14px; }
.steps li:last-child::after { display: none; }
.steps .dot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: #e9edf2; flex-shrink: 0; }
.steps .dot .icon { width: 16px; height: 16px; }
.steps li div { display: flex; flex-direction: column; line-height: 1.25; }
.steps li b { font-size: 13.5px; }
.steps li small { font-size: 12px; }
.steps li.done { color: var(--ink); }
.steps li.done .dot { background: var(--ok-soft); color: var(--ok); }
.steps li.done::after { background: var(--ok); }
.steps li.now { color: var(--ink); }
.steps li.now .dot { background: var(--acc); color: #fff; box-shadow: 0 0 0 4px #0b7a7526; }

.patient-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.patient-bar .name { font-size: 19px; font-weight: 650; }
.patient-bar dl { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; }
.patient-bar dl div { display: flex; flex-direction: column; }
.patient-bar dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); }
.patient-bar dd { margin: 0; font-weight: 550; }

.results td.result { width: 190px; }
.results .result input, .results .result select { width: 100%; font-weight: 600; font-variant-numeric: tabular-nums; }
.results .result textarea { min-width: 420px; }
.results .result input.calc { font-style: italic; } /* filled by its formula */
.results .result input.calc.typed { font-style: normal; text-decoration: underline dotted; } /* typed over by hand */
.results td.flag { font-weight: 700; width: 76px; white-space: nowrap; font-size: 12.5px; }
.results td.prev { color: var(--mute); font-size: 13px; white-space: nowrap; }
.results td.remark input { width: 100%; min-width: 120px; }
.results tr.sub td { background: #f6f8fa; font-weight: 650; font-size: 12.5px; color: var(--mute); padding: 5px 9px; }
.flag-high .result input, .flag-low .result input, .flag-abnormal .result select { color: var(--bad); border-color: var(--bad); background: var(--bad-soft); }
.flag-high .flag, .flag-low .flag, .flag-abnormal .flag { color: var(--bad); }
.action-bar { position: sticky; bottom: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; box-shadow: 0 -4px 18px #0d1b2a14; z-index: 5; }
.dirty { color: var(--warn); font-weight: 650; font-size: 13px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 12px 18px; border-left: 2px solid var(--line); margin-left: 5px; font-size: 13px; }
.timeline li:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 3px; width: 10px; height: 10px; border-radius: 50%; background: var(--acc); }
.timeline b { display: block; }
.timeline small { color: var(--mute); }

/* ---------- printed documents ---------- */
.paper { background: #fff; color: #000; max-width: 800px; margin: 0 auto; padding: 28px 32px; border: 1px solid var(--line); font-size: 14px; box-shadow: var(--shadow); }
.letterhead { text-align: center; border-bottom: 2px solid #000; padding-bottom: 8px; margin-bottom: 10px; }
.letterhead h1 { font-size: 22px; }
.letterhead p { margin: 2px 0; }
.patient-box { width: 100%; border: 1px solid #000; border-collapse: collapse; margin: 8px 0; }
.patient-box td { padding: 3px 8px; }
.patient-box td:nth-child(odd) { color: #444; width: 14%; }
.dept { text-align: center; font-size: 15px; margin: 16px 0 6px; text-decoration: underline; }
.paper h4 { color: #000; text-transform: none; letter-spacing: 0; font-size: 14px; }
.report-table { width: 100%; border-collapse: collapse; }
.report-table th { text-align: left; border-top: 1px solid #000; border-bottom: 1px solid #000; padding: 4px 6px; }
.report-table th.num { text-align: right; }
.report-table td { padding: 3px 6px; vertical-align: top; }
.report-table .sub { font-weight: 700; padding-top: 8px; text-decoration: underline; }
.report-table .sec { font-weight: 700; padding-top: 8px; font-size: 13px; }
.report-table td.choice { font-weight: 600; } /* NEGATIVE / POSITIVE, blood group */
.report-table tr.in-sec > td:first-child, .results tr.in-sec > td:first-child { padding-left: 22px; } /* tests under a sub-heading (D.L.C) */
.report-table .interp { white-space: pre-wrap; font-size: 12px; padding: 2px 6px 8px; }
.report-table .para { white-space: pre-wrap; margin: 2px 0 6px; }
.results tr.sec td { font-weight: 650; font-size: 12.5px; padding: 5px 9px; }
.report-table thead { border: 1px solid #000; }
.report-table .dept-row th { text-align: center; border: 0; padding-bottom: 0; }
.report-table .cols th { border: 0; }
.report-table th:nth-child(1) { width: 40%; }
.report-table { margin-top: 12px; }
.abn { font-weight: 700; }
/* lab report sheet: the head and foot rows hold the blank space of a pre-printed page and repeat on every printed sheet */
.sheet { width: 100%; border-collapse: collapse; }
.sheet > * > tr > td { padding: 0; }
.sheet-gap { box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 1px dashed #bbb; color: #888; font-size: 12px; margin: 0 0 8px; }
.sheet tfoot .sheet-gap { margin: 8px 0 0; }
.report .patient-box td:nth-child(odd) { width: 1%; white-space: nowrap; padding-right: 14px; }
.report .sign { display: flex; justify-content: flex-end; gap: 40px; margin-top: 30px; }
.report .end { margin-top: 10px; }
.para { white-space: pre-line; margin: 4px 0 12px; }
.sign { text-align: right; margin-top: 34px; font-weight: 600; }
.end { text-align: center; margin-top: 18px; }
.paper footer { border-top: 1px solid #999; margin-top: 14px; padding-top: 6px; font-size: 12px; color: #444; }
.provisional { text-align: center; border: 1px dashed #000; padding: 4px; font-weight: 700; }
.totals.print { max-width: 280px; }
.receipts { font-size: 12px; color: #444; }
/* bill / receipt: A5 portrait sheet (148 mm wide, 210 mm high), shown at paper width on screen */
.paper.bill { max-width: 148mm; padding: 8mm; font-size: 12.5px; }
.paper.bill.wide { max-width: 210mm; } /* A5 sheet fed sideways */
.bill .letterhead { display: flex; align-items: center; justify-content: center; gap: 5mm; }
.bill .letterhead h1 { font-size: 18px; }
.org-logo { height: 16mm; max-width: 45mm; object-fit: contain; flex: none; }
.logo-pick { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.bill .dept { font-size: 13.5px; margin: 8px 0 4px; }
.bill .patient-box td { padding: 2px 6px; }
.bill .patient-box td:nth-child(odd) { width: 1%; white-space: nowrap; }
.bill .report-table { margin-top: 6px; }
.bill .report-table th:nth-child(1) { width: auto; }
.bill .totals.print { max-width: 62mm; }
.bill .totals > div { padding: 2px 0; }
.bill .totals .grand { font-size: 15px; }
.bill .sign { margin-top: 22px; }
/* discharge papers (DischargePapersPage.razor): A4 letterhead pages worded like the hospital's own */
.papers { font-size: 14.5px; line-height: 1.5; }
.papers .dept { font-size: 17px; margin: 10px 0 8px; }
.papers .center { text-align: center; margin: 2px 0 10px; }
.papers .split { display: flex; justify-content: space-between; margin: 0 0 6px; }
.papers .just { text-align: justify; }
.papers .indent { text-indent: 3em; line-height: 1.9; }
.paper-info { border-collapse: collapse; margin: 6px 0 10px; }
.paper-info td { padding: 2px 10px 2px 0; vertical-align: top; }
.paper-info td:first-child { white-space: nowrap; }
.paper-info td:nth-child(3) { padding-left: 30px; white-space: nowrap; }
.treatment { margin: 0; padding-left: 22px; }
.grid-table { width: 100%; border-collapse: collapse; margin: 8px 0 12px; }
.grid-table th, .grid-table td { border: 1px solid #000; padding: 5px 8px; vertical-align: top; }
.grid-table th { text-align: left; text-decoration: underline; }
.grid-table th.num { text-align: right; }
.grid-table .sno { width: 6%; }
.grid-table tr.total td { font-weight: 700; }
.paper-sign { display: flex; flex-direction: column; align-items: flex-end; text-align: right; margin-top: 40px; }
.paper-sign b:first-child { margin-bottom: 26px; }
/* day end report: label / figure tables, and the lines that only show on paper */
.table.kv td:first-child small { color: var(--mute); margin-left: 6px; }
.print-only { display: none; }
.sign-row { justify-content: space-between; gap: 20px; margin-top: 16mm; font-weight: 600; }
/* ---------- report sections (OPD / Lab / Scan / Other) and payment modes: daily summary, receipts, booking ---------- */
.sec-opd { --c: var(--info); --s: var(--info-soft); }
.sec-lab { --c: var(--ok); --s: var(--ok-soft); }
.sec-scan { --c: var(--vio); --s: var(--vio-soft); }
.sec-other { --c: var(--warn); --s: var(--warn-soft); }
.badge[class*="sec-"] { background: var(--s); color: var(--c); }
.badge .icon, .rtype .icon { width: 14px; height: 14px; }
.mode-cash { background: var(--ok-soft); color: var(--ok); }
.mode-upi { background: var(--vio-soft); color: var(--vio); }
.mode-card, .mode-banktransfer, .mode-cheque { background: var(--info-soft); color: var(--info); }
.mode-due { background: var(--bad-soft); color: var(--bad); }
.mode-mixed, .mode-advance { background: var(--warn-soft); color: var(--warn); }

/* report type cards and the filter bar (Reports) */
.report-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; margin: 4px 0 12px; }
.chip.rtype { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border-radius: var(--r); padding: 12px 8px; font-weight: 650; text-align: center; min-height: 78px; box-shadow: var(--shadow); }
.chip.rtype .icon { width: 24px; height: 24px; color: var(--acc); }
.chip.rtype.on .icon { color: #fff; }
.report-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; margin-bottom: 14px; box-shadow: var(--shadow); }
.report-filters label { display: flex; align-items: center; gap: 6px; font-weight: 600; }

/* end of day billing summary */
.eod-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.eod-org { display: flex; align-items: center; gap: 12px; }
.eod-org h1 { margin: 0; font-size: 22px; color: var(--bad); letter-spacing: .3px; }
.eod-org p { margin: 2px 0 0; color: var(--mute); font-size: 12.5px; }
.eod-org .org-logo { height: 54px; }
.eod-title { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.eod-title b { display: flex; align-items: center; gap: 8px; background: var(--nav); color: #fff; border-radius: 22px; padding: 8px 20px; font-size: 16px; }
.eod-title span { background: var(--info-soft); color: var(--nav); border-radius: 14px; padding: 3px 14px; font-weight: 650; }
.eod-section { border: 1px solid var(--line); border-left: 4px solid var(--c); border-radius: var(--r); background: var(--card); padding: 10px 12px; margin-bottom: 12px; box-shadow: var(--shadow); break-inside: avoid; }
.eod-section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.eod-section-head h4 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; }
.sec-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 9px; background: var(--c); color: #fff; }
.eod-count { background: var(--s); border-radius: 16px; padding: 4px 14px; font-size: 13px; }
.eod-count i { color: var(--mute); font-style: normal; margin: 0 6px; }
.eod-section .table thead th { background: var(--s); }
.eod-overall { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 10px; }
.eod-overall > div { display: flex; flex-direction: column; justify-content: center; padding: 10px 18px; }
.eod-overall-title { flex-direction: row !important; align-items: center; gap: 8px; background: var(--nav); color: #fff; font-weight: 700; font-size: 16px; }
.eod-figure { flex: 1; align-items: center; border-left: 1px solid var(--line); min-width: 120px; }
.eod-figure span { color: var(--mute); font-weight: 600; font-size: 13px; }
.eod-figure b { font-size: 20px; font-variant-numeric: tabular-nums; }
.eod-grand { background: var(--nav); color: #fff; align-items: center; min-width: 150px; }
.eod-grand b { font-size: 22px; color: #ffd166; font-variant-numeric: tabular-nums; }
.eod-net, .eod-modes { color: var(--mute); margin: 4px 0; }
/* End of OP: one bill copy per section (OP, Lab, Scan); in print each copy starts a new sheet */
.op-copy { border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: var(--r); background: var(--card); padding: 10px 14px; margin-bottom: 16px; box-shadow: var(--shadow); }
.op-copy-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.op-copy-head h1 { margin: 0; font-size: 20px; color: var(--bad); }
.op-copy-head p { margin: 2px 0 0; color: var(--mute); font-size: 12.5px; }
.op-copy-title { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.op-copy-title b { display: flex; align-items: center; gap: 8px; font-size: 16px; color: var(--nav); }
.op-copy .table thead th { background: var(--s); }
.op-copy .sno { width: 56px; }
.op-copy td.num .badge { margin-right: 6px; font-size: 11px; }
.op-copy-split { color: var(--mute); margin: 6px 0 0; text-align: right; }
.op-copy-split i { font-style: normal; margin: 0 6px; }
@media print {
  .op-copy { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .op-copy + .op-copy { break-before: page; }
}
.eod-modes > span { margin-right: 14px; white-space: nowrap; }

/* scan uploads (ScanFiles on the result screen) and the pictures printed under a scan report */
.scan-files h4 { display: flex; align-items: center; gap: 8px; }
.upload-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; }
.file-pick { position: relative; overflow: hidden; }
.file-pick input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-pick.busy { opacity: .7; pointer-events: none; }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.file-card { margin: 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); overflow: hidden; display: flex; flex-direction: column; }
.file-card.on-report { border-color: var(--acc); box-shadow: 0 0 0 1px var(--acc); }
.file-thumb { display: flex; align-items: center; justify-content: center; height: 130px; background: #0d1b2a; border: 0; padding: 0; cursor: zoom-in; }
.file-thumb img { max-width: 100%; max-height: 130px; object-fit: contain; }
.file-thumb .pdf { color: #fff; font-weight: 800; font-size: 22px; letter-spacing: 1px; background: var(--bad); border-radius: 8px; padding: 10px 14px; }
.file-card figcaption { display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; font-size: 13px; }
.file-card figcaption b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card figcaption small { color: var(--mute); }
.file-actions { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.file-actions label { display: flex; align-items: center; gap: 4px; font-size: 12.5px; }
.report-images-title { margin: 12px 0 6px; }
.report-images { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.report-images figure { margin: 0; break-inside: avoid; text-align: center; }
.report-images img { width: 100%; max-height: 95mm; object-fit: contain; border: 1px solid var(--line); }
.report-images figcaption { font-size: 11.5px; color: var(--mute); }

@media print {
  .no-print { display: none !important; }
  .print-only { display: block; }
  .sign-row.print-only { display: flex; }
  .card { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
  main { padding: 0; max-width: none; }
  .paper { border: 0; max-width: none; padding: 0; box-shadow: none; }
  .table { border: 0; box-shadow: none; }
  html, body { margin: 0; }
  .sheet > * > tr > td { padding: 0 var(--side, 10mm); }
  .sheet-gap, .sheet tfoot .sheet-gap { border: 0; margin: 0; }
  .paper.report { font-size: 12.5px; line-height: 1.3; }
  .report .patient-box td { padding: 2px 8px; }
  .report .sign { margin-top: 18px; }
  .report .provisional { margin: 6px 0; padding: 2px; }
  .report .report-table td { padding: 2px 6px; }
  .report .report-table .sub, .report .report-table .sec { padding-top: 6px; }
  .report .patient-box, .report .report-table { margin-top: 0; }
  .report .report-table { margin-top: 8px; }
  .report-table tr, .patient-box, .sign { break-inside: avoid; }
  .paper.bill { font-size: 11.5px; line-height: 1.3; max-width: none; padding: 0; } /* fill the sheet; the page margin is the only edge */
  .bill .totals.print { break-inside: avoid; }
  .paper.papers { font-size: 13.5px; line-height: 1.5; }
  .grid-table tr, .paper-sign { break-inside: avoid; }
}
td .muted, h2 + .muted { margin-left: 6px; }

/* ---------- fine tuning ---------- */
.nav a .logo { flex: none; }
.results { table-layout: fixed; }
.results th:nth-child(1) { width: 26%; }
.results th:nth-child(2) { width: 170px; }
.results th:nth-child(3) { width: 78px; }
.results th:nth-child(4) { width: 9%; }
.results th:nth-child(5) { width: 15%; }
.results th:nth-child(6) { width: 13%; }
.results td.result { width: auto; }
.results .result textarea { min-width: 0; }
.timeline span { display: block; }
.toast { top: 12px; bottom: auto; right: auto; left: 50%; transform: translateX(-50%); } /* top centre: never covers page buttons */
.search { min-width: 300px; }
.help { margin: 0 2px 12px; }
.nav { width: 244px; scrollbar-width: thin; scrollbar-color: #2b4157 transparent; }
.nav a span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.page-head > input:not([type]) { min-width: 280px; }
.totals > .note { margin: 8px 0 0; font-size: 13px; }

/* Roles & Access: role x screen ticks */
.table.access th.tick, .table.access td.tick { text-align: center; width: 1%; white-space: nowrap; }
.table.access tr.group td { background: #f6f8fa; font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--mute); font-weight: 650; padding-top: 7px; padding-bottom: 7px; }
.table.access input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }
.table.access input[type=checkbox]:disabled { cursor: default; }
.licence-note { margin: 12px 24px 0; }
.licence-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.licence-table th, .licence-table td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.licence-table th { width: 190px; color: var(--mute); font-weight: 500; }
.mono { font-family: Consolas, "Cascadia Mono", monospace; }
.error-log td:nth-child(5) { word-break: break-word; }
.error-log tr.clickable { cursor: pointer; }
.error-detail { white-space: pre-wrap; word-break: break-word; font-size: 12px; max-height: 420px; overflow: auto; background: #f6f8fa; border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 0; }
.error-search { display: block; margin: 0 0 12px; }

/* Paged lists (Pager, SortTh), row picking by keyboard, detailed report - 18-Nov-2026 */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 10px 0 4px; }
.pager .btn.small { min-width: 32px; justify-content: center; }
.pager .btn:disabled { opacity: .4; cursor: default; }
.pager label { display: flex; align-items: center; gap: 6px; margin-left: 10px; font-size: 13px; }
.pager select { padding: 3px 6px; }
.table th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
.table th.sortable:hover { color: var(--ink); }
.table th.sorted { color: var(--acc); }
.sort-mark { font-size: 9px; margin-left: 4px; display: inline-block; min-width: 8px; }
.table.rows-nav tbody tr.picked td { background: var(--soft); box-shadow: inset 0 0 0 0 transparent; }
.table.rows-nav tbody tr.picked td:first-child { box-shadow: inset 3px 0 0 var(--acc); }
.scroll-x { overflow-x: auto; border-radius: var(--r); }
.table.detail { font-size: 13px; }
.table.detail td { white-space: nowrap; }
.table.detail td.items { white-space: normal; min-width: 180px; max-width: 320px; }
.table.keys td:first-child { width: 170px; }
.table.keys kbd { opacity: 1; margin: 0; }
@media print {
  .scroll-x { overflow: visible; }
  .table.detail { font-size: 9.5pt; }
  .table.detail td, .table.detail th { padding: 3px 5px; }
}

/* Bill and lab report print design (owner's pictures, 18-Nov-2026). Printed colours are kept: print-color-adjust exact. */
.paper { --p-red: #c8102e; --p-navy: #1b2f6e; --p-blue: #1f4fa3; --p-band: #dceafb; --p-band-2: #eaf2fd; --p-hi: #fff6cc; }
.paper.bill, .paper.report { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.lh { display: flex; align-items: center; justify-content: center; gap: 5mm; padding-bottom: 3mm; margin-bottom: 3mm; border-bottom: 2px solid var(--p-navy); }
.lh-logo { height: 20mm; max-width: 55mm; object-fit: contain; flex: none; }
.lh-bar { align-self: stretch; width: 1.5px; background: var(--p-navy); margin: 2mm 0; }
.lh-text { text-align: center; }
.lh h1 { color: var(--p-red); font-size: 30px; font-weight: 800; letter-spacing: .5px; line-height: 1.1; margin: 0; }
/* owner, 19-Nov-2026: the hospital name in the printed heading (bill, report header) in Times New Roman */
.lh h1, .bill.wide .lh h1 { font-family: "Times New Roman", Times, serif; font-weight: 700; letter-spacing: .3px; }
.lh p { color: var(--p-navy); font-size: 13.5px; margin: 3px 0 0; }
.bill .lh h1 { font-size: 24px; }
.bill .lh p { font-size: 11.5px; }
.bill .lh-logo { height: 17mm; }
.paper .pill { display: block; width: fit-content; margin: 2mm auto 3mm; padding: 3px 26px; border: 1.5px solid var(--p-blue); border-radius: 10px;
  background: var(--p-band); color: var(--p-navy); font-size: 15px; font-weight: 800; letter-spacing: .5px; }
.pt-box { display: flex; align-items: stretch; gap: 4mm; border: 1.5px solid #333; border-radius: 6px; padding: 2mm 4mm; margin: 2mm 0 3mm; }
.pt-box table { border-collapse: collapse; flex: 1; }
.pt-box td { padding: 1.5px 4px; vertical-align: middle; }
.pt-box td:first-child { white-space: nowrap; color: #333; width: 1%; }
.pt-box td:nth-child(2) { width: 1%; padding: 0 6px; }
.pt-box .pt-key { color: var(--p-navy); font-weight: 700; }
.pt-bar { width: 1.5px; background: #333; margin: 1.5mm 0; flex: none; }
.pt-no { display: inline-block; font-size: 1.6em; font-weight: 800; letter-spacing: 1px; padding: 0 12px; border: 1.5px solid var(--p-red); border-radius: 7px; background: var(--p-hi); }
.bill-lines { width: 100%; border-collapse: collapse; margin-top: 2mm; }
.bill-lines thead th { background: var(--p-band); color: var(--p-navy); text-align: left; padding: 4px 6px; border-top: 1.5px solid var(--p-blue); border-bottom: 1.5px solid var(--p-blue); }
.bill-lines th.num, .bill-lines td.num { text-align: right; }
.bill-lines td { padding: 4px 6px; }
.bill .totals .grand { border-top: 1.5px solid var(--p-navy); }
.bill-end { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 3mm; }
.bill-end .receipts { margin: 0; }
.bill-sum { display: flex; align-items: last baseline; gap: 6mm; break-inside: avoid; }
.bill-sum .receipts { flex: 1; margin: 0; }
.bill-sum .totals { flex: none; width: 62mm; margin-left: auto; }
.bill-end:has(> .sign:only-child) { justify-content: flex-end; }
.bill-end .sign { margin: 0; font-weight: 700; color: var(--p-navy); white-space: nowrap; }
.timings { display: grid; grid-template-columns: auto repeat(var(--n, 4), minmax(0, 1fr)); align-items: center; gap: 2mm; border: 1px solid #c9d8ef; border-radius: 10px; padding: 2mm 3mm; margin-top: 4mm; border-top: 2px solid var(--p-navy); }
.timings .icon { width: 20px; height: 20px; flex: none; }
.timings-title { display: inline-flex; align-items: center; gap: 6px; background: var(--p-navy); color: #fff; font-weight: 700; border-radius: 16px; padding: 4px 12px; }
.timing { display: flex; align-items: center; gap: 5px; padding-left: 2mm; border-left: 1.5px solid #999; }
.timing > span { display: flex; flex-direction: column; line-height: 1.2; }
.timing b { color: var(--p-navy); }
.timing .off { color: var(--p-red); font-weight: 800; }
.timing:nth-of-type(2) .icon { color: #e8a317; }
.timing .icon { color: var(--p-navy); }
.op-valid { display: flex; align-items: center; gap: 3mm; margin-top: 2mm; padding: 2mm 4mm; border-radius: 10px; background: var(--p-band-2); color: var(--p-blue); font-weight: 700; }
.op-valid .icon { width: 20px; height: 20px; flex: none; }
.op-valid b { margin-left: auto; background: var(--p-navy); color: #ffd84d; padding: 3px 14px; border-radius: 14px; white-space: nowrap; }
/* owner's picture of the bill, 19-Nov-2026: same weights - name in bold capitals, a big heavy OP No. box, bold navy titles,
   each time on one line, bold red Holiday, heavy validity line with the yellow "Valid Till" pill */
.bill .pt-name { font-weight: 800; text-transform: uppercase; letter-spacing: .3px; }
/* patient box as in the picture: larger even text, navy rounded frame, rows at their own height (not stretched),
   the divider in the middle, labels the same size as the values with the colons in one line */
.bill .pt-box { font-size: 1.18em; border: 1.5px solid var(--p-navy); border-radius: 8px; padding: 2.5mm 5mm; gap: 5mm; align-items: center; }
.bill .pt-box table { align-self: center; }
.bill .pt-box .pt-left { flex: 1.15; }
.bill .pt-box .pt-right { flex: 1; }
.bill .pt-box td { padding: 1.5px 5px; line-height: 1.5; }
.bill .pt-box td:first-child { color: #222; padding-left: 0; }
.bill .pt-box td:nth-child(2) { padding: 0 8px 0 4px; }
.bill .pt-bar { align-self: stretch; margin: 0; background: var(--p-navy); }
.bill .pt-box .pt-key { font-size: 1.08em; font-weight: 800; }
.bill .pt-no { font-size: 1.75em; font-weight: 900; padding: 0 18px; line-height: 1.3; border-width: 2px; border-radius: 8px; letter-spacing: 1.5px; margin: 1px 0 3px; }
.bill .pt-box td.when b { font-weight: 800; }
.bill .bill-lines thead th { font-weight: 800; }
.bill .totals .grand { font-weight: 800; }
/* each timing takes the width of its text and may shrink below it, so a short entry stays on one line and a long one
   (production, 19-Nov-2026: "Morning 10.00 AM - 1.30 PM, Evening 5.30 PM - 8.30 PM." typed as one entry) wraps inside
   the band instead of running past the sheet */
.timings { grid-template-columns: auto repeat(var(--n, 4), minmax(0, max-content)); justify-content: space-between; }
.timing { min-width: 0; }
.timing > span { min-width: 0; overflow-wrap: break-word; }
.bill.wide .timings-title { white-space: nowrap; }
.timing b { font-weight: 800; }
.timings-title { font-weight: 800; }
.op-valid { font-weight: 800; }
.op-valid b { font-weight: 900; }
/* lab report = the hospital's own pre-printed report (owner's picture, 19-Nov-2026): Times type in blue ink, no rules between
   rows; a thin patient box, one boxed row of column titles, departments centred, ranges in brackets. Column widths were
   measured on the picture (Result starts 73 mm, Units 111 mm, Normal Range 140 mm from the left edge of the sheet). */
.paper.report.rp { --p-ink: #1b2a9a; color: var(--p-ink); font-family: "Times New Roman", Times, serif; font-size: 15px; line-height: 1.3; }
.rp .rp-pt, .rp .rp-cols, .rp .rp-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.rp col.c1 { width: 33%; } .rp col.c2 { width: 20%; } .rp col.c3 { width: 15%; } .rp col.c4 { width: 32%; }
.rp .rp-pt { border: 1px solid var(--p-ink); margin: 1mm 0 4mm; font-size: .9em; }
.rp .rp-pt col.k { width: 27mm; } .rp .rp-pt col.v2 { width: 45mm; }
.rp .rp-pt td { padding: 1mm 3mm; vertical-align: top; }
.rp .rp-pt td:nth-child(odd) { font-size: .9em; padding-top: 1.3mm; }
.rp .rp-name { font-weight: 700; }
.rp .rp-cols { border: 1.5px solid var(--p-ink); margin-bottom: 1mm; }
.rp .rp-cols th { text-align: left; font-weight: 700; padding: 1.2mm 3mm; }
.rp .rp-cols th:last-child { text-align: left; }
.rp .rp-dept { color: var(--p-ink); text-align: center; font-size: 1.12em; font-weight: 700; text-decoration: none; margin: 3mm 0 1mm; letter-spacing: .2px; }
.rp .rp-table td { padding: .8mm 3mm; vertical-align: top; }
.rp .rp-table .rp-group td { font-weight: 700; padding-top: 1.5mm; }
.rp .rp-table tr.in-sec > td:first-child { padding-left: 8mm; }
.rp .rp-table td.abn { font-weight: 700; }
.rp .rp-table .flag { font-weight: 700; }
.rp .rp-table .para { white-space: pre-wrap; margin: 1px 0 4px; }
.rp .rp-table .interp { white-space: pre-wrap; font-size: .85em; padding: 0 3mm 2mm; }
.rp h4 { color: var(--p-ink); }
.rp .provisional { border-color: var(--p-ink); margin: 0 0 2mm; }
.report .sign-row { display: flex; justify-content: flex-end; margin-top: 10mm; padding-right: 8mm; break-inside: avoid; }
.report .sign-in { display: flex; align-items: flex-start; gap: 6px; }
.report .sign-label { color: var(--p-navy); font-weight: 800; white-space: nowrap; padding-top: 4mm; }
.report .sign-box { display: inline-flex; flex-direction: column; align-items: center; min-width: 50mm; }
.report .sign-line { display: block; width: 100%; height: 8mm; border-bottom: 1.5px solid #333; }
.report .sign-box small { font-size: 11px; margin-top: 2px; }
.report .end { text-align: center; font-weight: 600; border-top: 2px solid #333; padding-top: 2mm; margin-top: 4mm; }
@media print {
  .lh h1 { font-size: 26pt; }
  .bill .lh h1 { font-size: 18pt; }
  .paper.report.rp { font-size: 12.5pt; line-height: 1.3; }
  .rp .rp-table td { padding: .7mm 3mm; }
  .rp .rp-table tr { break-inside: avoid; }
}
.pt-box td.when { white-space: nowrap; }
.bill:not(.wide) .timings { font-size: 9.5px; }
.bill:not(.wide) .timings .icon { width: 15px; height: 15px; }
.bill:not(.wide) .timings-title { padding: 3px 7px; gap: 4px; }
.bill:not(.wide) .op-valid { font-size: 10.5px; }
.bill.wide .lh h1 { font-size: 30px; }
.bill.wide .lh p { font-size: 13.5px; }

/* Patient number (P00001) highlighted the same way everywhere: a yellow chip on screens, the boxed number on bills and reports */
.uhid { display: inline-block; font: 650 12px ui-monospace, Consolas, monospace; letter-spacing: .3px; padding: 0 6px; border: 1px solid #e0b400; border-radius: 5px; background: #fff6cc; color: #5a4300; white-space: nowrap; vertical-align: 1px; }
.report .pt-no { font-size: 1.3em; padding: 0 10px; }

/* Profiles form: search over the "Add tests" ticks */
.checks-head { display: flex; align-items: center; gap: 10px; margin: 14px 0 6px; }
.checks-head h4 { margin: 0; white-space: nowrap; }
.esc-hint { display: inline-flex; align-items: center; gap: 4px; color: var(--mute); font-size: 12.5px; white-space: nowrap; }
.esc-hint kbd { margin: 0; opacity: 1; }

.nowrap { white-space: nowrap; }
/* End of OP Summary: the counter's own closing summary, made to fill one A5 sheet (148 x 210 mm, 7 mm margin) */
.ops { max-width: 148mm; margin: 0 auto; background: #fff; color: #000; border: 1px solid var(--line); border-radius: var(--r); padding: 7mm; font-size: 11.5px; box-shadow: var(--shadow); }
.ops-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 3mm; border-bottom: 2px solid #1b2f6e; padding-bottom: 2mm; margin-bottom: 2mm; }
.ops-head h1 { margin: 0; font-size: 17px; color: #c8102e; line-height: 1.15; }
.ops-head p { margin: 1px 0 0; font-size: 10px; color: #444; }
.ops-title { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.ops-title b { background: #1b2f6e; color: #fff; border-radius: 12px; padding: 2px 10px; font-size: 12.5px; white-space: nowrap; }
.ops-title span { font-size: 10.5px; white-space: nowrap; }
.ops h4 { margin: 3mm 0 1mm; font-size: 12px; color: #1b2f6e; text-transform: none; letter-spacing: 0; }
.ops-count { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ops-count td { border: 1px solid #999; text-align: center; padding: 1.5mm 1mm; }
.ops-count span { display: block; font-size: 9.5px; color: #444; }
.ops-count b { font-size: 15px; }
.ops-table { width: 100%; border-collapse: collapse; }
.ops-table th, .ops-table td { border: 1px solid #999; padding: 1mm 1.5mm; }
.ops-table thead th { background: #dceafb; text-align: left; font-size: 10.5px; }
.ops-table th.num, .ops-table td.num { text-align: right; white-space: nowrap; }
.ops-table tfoot th { background: #f2f4f7; text-align: left; }
.ops-table .sno { width: 6mm; }
.ops-table tr.strong td { font-weight: 700; }
.ops-full { display: grid; grid-template-columns: 1fr 1fr; gap: 3mm; align-items: start; }
.ops-sign { display: flex; justify-content: space-between; gap: 3mm; margin: 6mm 0 0; font-size: 10px; }
.ops { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
@media print {
  .ops { max-width: none; border: 0; box-shadow: none; padding: 0; font-size: 9.5pt; }
  .ops-table tr, .ops-count, .ops-full, .ops-sign { break-inside: avoid; }
}
/* End of OP Summary: Overall Summary band (as on the Daily Summary), compact for A5 */
.ops-overall { display: flex; align-items: stretch; border: 1px solid #999; border-radius: 6px; overflow: hidden; margin-top: 3mm; }
.ops-overall > div { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 1.5mm 1mm; text-align: center; }
.ops-overall-title { flex-direction: row !important; gap: 4px; background: #0f1b2d; color: #fff; font-weight: 700; font-size: 11px; max-width: 24mm; }
.ops-overall-title .icon { width: 14px; height: 14px; flex: none; }
.ops-figure { flex: 1; border-left: 1px solid #ccc; }
.ops-figure span, .ops-grand span { font-size: 9px; color: #444; }
.ops-figure b { font-size: 12px; white-space: nowrap; }
.ops-grand { flex: 1.2; background: #0f1b2d; }
.ops-grand span { color: #fff; }
.ops-grand b { color: #ffc93c; font-size: 13.5px; white-space: nowrap; }
.ops-modes { font-size: 10.5px; color: #333; margin: 1.5mm 0 0; }
.ops-modes > span { margin-right: 8px; }
/* End of OP Summary fitted to one A5 sheet: the same compact size on screen and on paper (measured: 4 sections fit in 196 mm) */
.ops { font-size: 10px; line-height: 1.25; }
.ops h4 { margin: 2mm 0 .7mm; font-size: 10.5px; }
.ops-head { padding-bottom: 1.5mm; margin-bottom: 1mm; }
.ops-head h1 { font-size: 15px; }
.ops-count td { padding: .8mm .5mm; }
.ops-count b { font-size: 12.5px; }
.ops-table th, .ops-table td { padding: .55mm 1.2mm; }
.ops-table thead th { font-size: 9.5px; }
.ops-overall { margin-top: 2mm; }
.ops-overall > div { padding: 1mm .8mm; }
.ops-sign { margin-top: 4mm; }
@media print { .ops { font-size: 10px; } }

/* ---------- Premium sideways bill (owner's picture, 19-Nov-2026: "this format has a premium look but not our print") ----------
   The sideways A5 sheet (210 x 148 mm, Settings "Sideways") printed everything at 11.5px with an 18pt name, so paper looked
   smaller and flatter than the screen. These sizes are the SAME on screen and on paper (the print block below repeats them).
   Measured to fit one sheet (132 mm of height between the margins) with a few bill lines; a long bill continues on a second sheet. */
.paper.bill.wide { font-size: 14px; line-height: 1.25; }
.bill.wide .lh { gap: 6mm; padding-bottom: 1.5mm; margin-bottom: 1.5mm; border-bottom: 2px solid var(--p-navy); }
.bill.wide .lh-logo { height: 16mm; max-width: 52mm; }
.bill.wide .lh-bar { margin: 1mm 0; }
.bill.wide .lh h1 { font-size: 31px; font-weight: 900; text-transform: uppercase; letter-spacing: .6px; line-height: 1.05; }
.bill.wide .lh p { font-size: 14px; font-weight: 500; color: var(--p-navy); margin-top: 3px; }
.bill.wide .pill { font-size: 15.5px; font-weight: 900; padding: 2px 40px; border-radius: 12px; margin: 0 auto 1.8mm; letter-spacing: .8px; }
.bill.wide .pt-box { font-size: 1.1em; border-radius: 10px; padding: 1.5mm 6mm; margin: 0 0 2mm; }
.bill.wide .pt-box td { line-height: 1.32; padding-top: 0; padding-bottom: 0; }
.bill.wide .pt-no { line-height: 1.2; margin: 0 0 2px; }
.bill.wide .bill-lines { font-size: 1.06em; margin-top: 0; }
.bill.wide .bill-lines thead th { font-size: 1.04em; font-weight: 800; padding: 3px 8px; }
.bill.wide .bill-lines td { padding: 2px 8px; }
/* totals on the right with the receipts line at their left (as in the picture there is nothing else beside them) */
.bill.wide .totals { font-size: 1.06em; margin-top: 1mm; }
.bill.wide .totals > div { padding: 0; line-height: 1.38; }
.bill.wide .totals > div > b { font-weight: 700; }
.bill.wide .totals .grand { font-size: 1.2em; font-weight: 800; padding-top: 2px; margin-top: 1px; }
.bill.wide .bill-end { margin-top: 1mm; padding-bottom: 1.5mm; border-bottom: 1.5px solid var(--p-navy); }
.bill.wide .bill-sum .totals { width: 70mm; }
.bill.wide .bill-sum .receipts { font-size: 1em; color: #222; }
.bill.wide .bill-end .sign { font-size: 1.1em; font-weight: 800; color: #111; }
.bill.wide .timings { font-size: 11.5px; border: 1.5px solid #bcd3f0; border-radius: 12px; padding: 1.3mm 3mm 1.3mm 2mm; margin-top: 2mm; gap: 2mm; }
.bill.wide .timings-title { font-size: 12.5px; padding: 4px 12px 4px 4px; gap: 6px; border-radius: 20px; }
.bill.wide .timings-title .icon { width: 22px; height: 22px; padding: 2px; background: #fff; color: var(--p-navy); border-radius: 50%; stroke-width: 2.2; }
.bill.wide .timing { gap: 6px; padding-left: 2.5mm; border-left-color: #333; }
.bill.wide .timing .icon { width: 24px; height: 24px; stroke-width: 2.1; }
.bill.wide .timing b { font-size: 1.06em; }
.bill.wide .timing .off { font-size: 1.12em; }
.bill .timing .icon.tone-sun { color: #f2a900; }
.bill .timing .icon.tone-moon { color: var(--p-navy); }
.bill .timing .icon.tone-siren, .bill .timing .icon.tone-cal { color: var(--p-red); }
.bill.wide .op-valid { font-size: 13px; font-weight: 800; padding: 1.3mm 2.5mm 1.3mm 5mm; margin-top: 1.8mm; border-radius: 14px; gap: 3mm;
  white-space: nowrap; background: linear-gradient(90deg, #dceafb, #eef5fe 60%, #dceafb); color: var(--p-blue); }
.bill.wide .op-valid .icon { width: 22px; height: 22px; padding-right: 3mm; border-right: 1.5px solid var(--p-navy); box-sizing: content-box; color: var(--p-navy); }
.bill.wide .op-valid b { font-size: 1.06em; font-weight: 900; padding: 3px 16px; border-radius: 16px; }
@media print {
  .paper.bill.wide { font-size: 14px; line-height: 1.25; }
  .bill.wide .lh h1 { font-size: 31px; }
  .bill.wide .lh p { font-size: 14px; }
}

/* Doctor Wise Details: one heading per doctor above their table (19-Nov-2026) */
.report-sub { margin: 18px 0 6px; font-size: 15px; }
.report-sub small { font-weight: 500; margin-left: 4px; }
.report-sub:first-child { margin-top: 4px; }
/* Full Details (Doctor Wise): summary table, one block per type under each doctor, doctor and grand totals */
.full-sum { margin-bottom: 10px; }
.full-block { margin-top: 6px; }
.full-block .full-type th { background: var(--soft, #eef3fb); text-transform: none; font-size: 13px; letter-spacing: 0; }
.full-block .full-type .icon { width: 15px; height: 15px; vertical-align: -2px; }
.full-block .full-type small { font-weight: 500; }
.full-doctor-total { display: flex; justify-content: space-between; margin: 6px 0 14px; padding: 6px 10px; border-top: 2px solid var(--ink, #222); font-weight: 700; }
.full-doctor-total.grand { font-size: 15px; border-top-width: 3px; }

/* Bill / receipt in Times New Roman (owner, 19-Nov-2026: "in the billing also need font Times New Roman and proper size").
   Times looks about a size smaller than the screen font, so the sideways bill base went from 12.5 to 14px (screen = paper);
   measured to still fit one sideways A5 sheet with a few lines. The upright A5 bill gets the same type at its own size. */
.paper.bill, .paper.bill .pt-box, .paper.bill .bill-lines, .paper.bill .totals, .paper.bill .timings, .paper.bill .op-valid,
.paper.bill .pill, .paper.bill .lh p { font-family: "Times New Roman", Times, serif; }
.paper.bill:not(.wide) { font-size: 13.5px; }
.bill .uhid { font-family: inherit; }
@media print { .paper.bill:not(.wide) { font-size: 12.5px; } }
/* Times on the sideways bill: footer text a step larger, rows a little tighter so a 3-line bill still fits one sheet */
.bill.wide .pt-box td { line-height: 1.22; }
.bill.wide .bill-lines td { padding: 1px 8px; }
.bill.wide .totals > div { line-height: 1.28; }
.bill.wide .timings { font-size: 12.5px; }
.bill.wide .timings-title { font-size: 13px; }
.bill.wide .op-valid { font-size: 14px; }
.bill.wide .timings { font-size: 12px; gap: 1.5mm; padding-left: 1.5mm; padding-right: 2mm; }
.bill.wide .timing { gap: 4px; padding-left: 2mm; }
.bill.wide .timing .icon { width: 22px; height: 22px; }
.bill.wide .timings-title { padding-right: 9px; }
.bill.wide .lh-logo { height: 15mm; }

/* Print with Date page and the screen-only banner on a print opened from it (19-Nov-2026) */
.print-date-form { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; padding: 12px; margin-bottom: 12px; }
.print-date-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.print-date-form label.grow { flex: 1 1 220px; }
.print-date-banner { margin: 0 0 8px; padding: 8px 12px; border-radius: 8px; background: #fff6cc; border: 1px solid #e0b400; color: #5a4300; font-weight: 600; }

/* Bill: room to sign above "Authorised signatory" (owner, 19-Nov-2026: "Authorised signatory needed some space") */
.bill.wide .bill-end { padding-top: 8mm; }
.bill:not(.wide) .bill-end { padding-top: 10mm; }
/* ...won back from the heading and the foot so a 3-line sideways bill still fits one sheet */
.bill.wide .lh-logo { height: 13mm; }
.bill.wide .lh { padding-bottom: 1mm; margin-bottom: 1mm; }
.bill.wide .pill { margin-bottom: 1.2mm; }
.bill.wide .timings { margin-top: 1.5mm; padding-top: 1mm; padding-bottom: 1mm; }
.bill.wide .op-valid { margin-top: 1.2mm; padding-top: 1mm; padding-bottom: 1mm; }

/* Lab report (owner's photo, 19-Nov-2026): a wider Test Name column so names like BLOOD SUGAR ( RANDOM ) stay on one line,
   and a gap before Result. Was 33 / 20 / 15 / 32 %. */
.rp col.c1 { width: 41%; } .rp col.c2 { width: 17%; } .rp col.c3 { width: 13%; } .rp col.c4 { width: 29%; }
.rp .rp-table td:nth-child(2), .rp .rp-cols th:nth-child(2) { padding-left: 6mm; }

/* Lab report columns (owner's photo, 21-Nov-2026: "Test Name and Result a little closer"; "a little more gap between Result and
   Units, some results take more letters, e.g. Weakly positive"). Result moves left and gets a wider column, Units start a little
   further from it. Was 41 / 17 / 13 / 29 % with a 6 mm gap before Result. */
.rp col.c1 { width: 35%; } .rp col.c2 { width: 23%; } .rp col.c3 { width: 13%; } .rp col.c4 { width: 29%; }
.rp .rp-table td:nth-child(2), .rp .rp-cols th:nth-child(2) { padding-left: 3mm; }
.rp .rp-table td:nth-child(3), .rp .rp-cols th:nth-child(3) { padding-left: 5mm; }

/* "Remarks :" at the end of every lab report (owner, 21-Nov-2026): the order's note or blank. On plain paper it sits left of
   the Lab Incharge line, as on the hospital's own report. */
.rp .rp-remarks { margin-top: 6mm; font-size: 11pt; white-space: pre-wrap; break-inside: avoid; }
.rp .rp-remarks b { font-weight: 700; margin-right: 2mm; }
.report .sign-row:has(.rp-remarks) { justify-content: space-between; align-items: flex-start; gap: 10mm; }
.report .sign-row .rp-remarks { margin-top: 4mm; flex: 1; font-weight: 400; }
.report-remarks textarea { width: 100%; }

/* Lab report type sizes (owner, 19-Nov-2026: "header and side headings font size 11, results font size 10"), Times New Roman,
   the same on screen and on paper (was 15px on screen, 12.5pt on paper for everything) */
.paper.report.rp { font-size: 10pt; line-height: 1.35; }
.rp .rp-pt, .rp .rp-pt td, .rp .rp-pt td:nth-child(odd) { font-size: 11pt; }
.rp .rp-cols th { font-size: 11pt; }
.rp .rp-dept { font-size: 11pt; }
.rp .rp-table .rp-group td { font-size: 11pt; }
@media print {
  .paper.report.rp { font-size: 10pt; line-height: 1.35; }
}

/* Bill footer made simple (owner's photo, 19-Nov-2026: "too large space is occupied ... reduce the content, give simple way"):
   timings and OP validity are two plain text lines, no icons, no coloured pills or bands. Same on screen and paper. */
.bill .timings, .bill.wide .timings { display: block; border: 0; border-top: 1px solid var(--p-navy); border-radius: 0; padding: 1mm 0 0;
  margin-top: 1.5mm; font-size: 11px; line-height: 1.3; }
.bill.wide .timings { font-size: 12px; }
.bill .timings .icon, .bill .op-valid .icon { display: none; }
.bill .timings-title, .bill.wide .timings-title { display: inline; background: none; color: var(--p-navy); padding: 0; border-radius: 0;
  font-size: 1em; font-weight: 800; }
.bill .timings-title::after { content: ":"; }
.bill .timing, .bill.wide .timing { display: inline; padding: 0; border: 0; }
.bill .timing + .timing::before { content: "|"; color: #888; margin: 0 3px 0 1px; }
.bill .timing > span, .bill .timing b, .bill .timing .off { display: inline; font-size: 1em; }
.bill .timing b { color: inherit; font-weight: 700; margin: 0 3px 0 4px; }
.bill .op-valid, .bill.wide .op-valid { display: block; background: none; color: inherit; padding: .5mm 0 0; margin-top: 0; border-radius: 0;
  font-size: 11px; font-weight: 400; line-height: 1.3; }
.bill.wide .op-valid { font-size: 12px; }
.bill .op-valid b, .bill.wide .op-valid b { background: none; color: var(--p-navy); padding: 0; margin-left: 4px; border-radius: 0;
  font-size: 1em; font-weight: 800; }
.bill .timings { white-space: nowrap; overflow: hidden; } /* always one line (owner, 19-Nov-2026) */
.bill .timing b { margin: 0 2px 0 0; }
/* receipts on the signatory line (owner's drawing, 19-Nov-2026), same text line as "Authorised signatory" */
.bill .bill-end { align-items: last baseline; }
.bill .bill-end .receipts { flex: 1; min-width: 0; }
.bill.wide .bill-end .receipts { font-size: 1em; color: #222; }
.bill:not(.wide) .timings { font-size: 9.2px; } /* leaves about 4 mm spare on the upright A5 line */
/* Owner, 19-Nov-2026: "before OP give icon and align first and second line": the two footer lines start at the same left edge,
   each with a small icon in the same 12 px column (clock / stethoscope), same type size; timing icons stay hidden. */
.bill .timings-title, .bill:not(.wide) .timings-title, .bill.wide .timings-title { padding: 0; gap: 0; }
.bill .timings-title .icon, .bill.wide .timings-title .icon, .bill .op-valid .icon, .bill.wide .op-valid .icon {
  display: inline-block; width: 12px; height: 12px; padding: 0; margin: 0 4px 0 0; border: 0; background: none;
  color: var(--p-navy); vertical-align: -2px; box-sizing: content-box; }
.bill .timing .icon { display: none; }
.bill:not(.wide) .timings, .bill:not(.wide) .op-valid { font-size: 9px; }
.bill.wide .timings, .bill.wide .op-valid { font-size: 12px; }
.bill .timings, .bill.wide .timings, .bill .op-valid, .bill.wide .op-valid { position: relative; padding-left: 16px; }
.bill:not(.wide) .timings-title .icon, .bill.wide .timings-title .icon, .bill .op-valid .icon, .bill.wide .op-valid .icon {
  position: absolute; left: 0; width: 12px; height: 12px; margin: 0; }
.bill .timings-title .icon { top: calc(1mm + .15em); }
.bill .op-valid .icon { top: calc(.5mm + .15em); }
.bill .timings-title::after { content: ":"; margin-right: 5px; }
.bill .timings-title .icon, .bill .op-valid .icon { stroke-width: 2; }

/* OP No. (owner, 19-Nov-2026: "make it small and properly align"): label like UHID / Date, a small highlighted number box that
   keeps the row the same height as the others */
.bill .pt-box .pt-key, .bill.wide .pt-box .pt-key { font-size: 1em; }
.bill .pt-no, .bill.wide .pt-no { font-size: 1.15em; font-weight: 800; padding: 0 6px; line-height: 1.1; border-width: 1.5px;
  border-radius: 5px; letter-spacing: .5px; margin: 0; vertical-align: middle; }
/* Patient box rows line up across the two sides (owner, 19-Nov-2026: "give properly aligned"): both tables start at the top,
   so OP No. sits level with Name, UHID with Age / Sex, Date with Referred by; the OP box is no taller than a row. */
.bill .pt-box { align-items: flex-start; }
.bill .pt-box table { align-self: flex-start; }
.bill .pt-box .pt-bar { align-self: stretch; }
.bill .pt-no, .bill.wide .pt-no { line-height: 1.05; padding: 0 6px; }
.bill.wide .pt-no { margin: -3px 0; } /* the box does not make its row taller on the sideways sheet */
/* Patient box text the same font and size as the bill lines (owner, 19-Nov-2026): Times, 1em upright, 1.06em sideways */
.bill .pt-box { font-size: 1em; }
.bill.wide .pt-box { font-size: 1.06em; }
/* One type size for the whole bill body (owner, 19-Nov-2026: "give this [bill lines] complete for all"): pill, patient box,
   column titles, OP box, totals (Net amount too), receipts and signatory are all the bill-line size, Times; bold stays bold.
   Not the letterhead (hospital name / address) and not the one-line timings / OP validity footer. */
.bill { --bl: 1em; }
.bill.wide { --bl: 1.06em; }
.bill .bill-lines thead th, .bill.wide .bill-lines thead th { font-size: 1em; }
.bill .pt-no, .bill.wide .pt-no { font-size: 1em; }
.bill .pill, .bill.wide .pill { font-size: var(--bl); }
.bill .totals, .bill.wide .totals { font-size: var(--bl); }
.bill .totals .grand, .bill.wide .totals .grand { font-size: 1em; }
.bill .bill-end .receipts, .bill.wide .bill-end .receipts, .bill .bill-end .sign, .bill.wide .bill-end .sign { font-size: var(--bl); }
/* Footer one size bigger (owner, 19-Nov-2026: "increase one font size"), still one line each: sideways 13px (10 mm spare;
   14px does not fit), upright 10px with the clock icon standing for the word "Timings:" (3 mm spare). */
.bill.wide .timings, .bill.wide .op-valid { font-size: 13px; }
.bill:not(.wide) .timings, .bill:not(.wide) .op-valid { font-size: 10px; }
.bill:not(.wide) .timings-title { font-size: 0; }
.bill:not(.wide) .timings-title::after { content: none; }

/* ---------- Bill type sizes (owner, 19-Nov-2026, from a bill type guide: header 14-18pt bold, totals 12-14pt with the payable
   amount bold, body 10-12pt uniform, fine print 8-10pt, never below 8pt). Same on screen and paper, both sheets:
   hospital name 18pt, address 10pt, everything in the body 10.5pt (pill, patient box, lines, totals, receipts, signatory),
   Net amount and Balance 12pt bold, footer 9.5pt sideways (one line each) / 8pt upright (timings wrap between entries). ---------- */
.paper.bill, .paper.bill.wide, .paper.bill:not(.wide) { font-size: 10.5pt; }
.bill, .bill.wide { --bl: 1em; }
.bill .lh h1, .bill.wide .lh h1 { font-size: 18pt; }
.bill .lh p, .bill.wide .lh p { font-size: 10pt; }
/* totals: every row the same size and spacing (owner, 19-Nov-2026: "give same size and align"); Net amount and Balance bold */
.bill .totals > div, .bill.wide .totals > div { font-size: 1em; line-height: 1.3; padding-top: 2px; padding-bottom: 2px; margin-top: 0; }
.bill .totals .grand, .bill.wide .totals .grand,
.bill .totals > div:last-child, .bill.wide .totals > div:last-child { font-weight: 800; }
.bill .totals > div:last-child b, .bill.wide .totals > div:last-child b { font-weight: 800; }
.bill.wide .timings, .bill.wide .op-valid { font-size: 9.5pt; }
.bill:not(.wide) .timings, .bill:not(.wide) .op-valid { font-size: 8pt; }
.bill:not(.wide) .timings { white-space: normal; }
.bill:not(.wide) .timing { white-space: nowrap; }
.bill:not(.wide) .timings-title { font-size: 1em; }
.bill:not(.wide) .timings-title::after { content: ":"; }
/* the separator follows an entry, so a wrapped line never starts with "|" */
.bill .timing + .timing::before { content: none; }
.bill .timing:not(:last-child)::after { content: "|"; color: #888; margin: 0 3px 0 1px; }
.bill:not(.wide) .timing { display: inline-block; }
.bill.wide .pt-box, .bill.wide .bill-lines, .bill.wide .bill-lines thead th, .bill.wide .totals { font-size: 1em; }
.bill.wide .bill-end { border-bottom: 0; padding-bottom: 0; } /* the timings line's top rule is the only rule (no double line) */
.bill.wide .timing .off { font-size: 1em; }
/* Upright A5: the timings cannot fit one line at 8pt, so they sit as an even 2 x 2 grid beside the title (owner's photo of the
   ragged wrap, 19-Nov-2026): title | first column | second column, a thin upright line before the second column. */
.bill:not(.wide) .timings { display: grid; grid-template-columns: max-content max-content 1fr; column-gap: 0; row-gap: .3mm; }
.bill:not(.wide) .timings-title { grid-row: span 2; align-self: start; padding-right: 6px; }
.bill:not(.wide) .timing::after { content: none; }
.bill:not(.wide) .timing:nth-child(odd) { border-left: 1px solid #999; padding-left: 6px; margin-left: 6px; }
/* Totals and the receipts / signatory line keep the bill lines' cell padding (owner's photo, 19-Nov-2026: "not properly
   aligned"), so every amount ends under the Amount column and Receipts starts under the # column. */
.bill .totals > div, .bill .bill-end { padding-left: 6px; padding-right: 6px; }
.bill.wide .totals > div, .bill.wide .bill-end { padding-left: 8px; padding-right: 8px; }
/* one blank line between the last bill line and Sub total (owner, 19-Nov-2026) */
.bill .bill-sum .totals, .bill.wide .bill-sum .totals { margin-top: 1.3em; }
@media print {
  .paper.bill, .paper.bill.wide, .paper.bill:not(.wide) { font-size: 10.5pt; }
  .bill .lh h1, .bill.wide .lh h1 { font-size: 18pt; }
  .bill .lh p, .bill.wide .lh p { font-size: 10pt; }
}

/* "Remarks :" and "Lab Incharge :" on ONE line (owner's picture, 21-Nov-2026): the row lines up on the first line of text, so
   Remarks (left) and the Lab Incharge label (right, pushed down to its sign line) share a baseline. */
.report .sign-row, .report .sign-row:has(.rp-remarks) { justify-content: space-between; align-items: baseline; gap: 10mm; }
.report .sign-row .rp-remarks { flex: 1; margin: 0; text-align: left; }
.report .sign-row .sign-in { align-items: baseline; }

/* Lab report layout (owner, 21-Nov-2026: "order, what is bold, alignment, size, flow - complete customisation").
   Setup > Report Layout stores the choices; ReportSheet.razor puts them on the sheet as CSS variables and these rules use them:
   --rp-font / --rp-lh / --rp-gap (space above and below a result line) / --rp-indent / --g1 (space before the first column),
   and per kind of text --<key>-fs size, -fw weight, -fi italic, -td underline, -tt capitals, -ta alignment, -c colour
   (keys: pl pv pn patient box, ct column titles, dp department, pf profile, sh sub heading, tn test name, rs result,
   ab abnormal result, un units, rg range, ip interpretation, rm remarks, li Lab Incharge, er End of Report).
   The fallbacks are the hospital's own report, so a sheet without variables prints as before. Column widths, alignment and
   the space before each column are set on the cells themselves. */
.paper.report.rp { font-family: var(--rp-font, "Times New Roman"), "Times New Roman", Times, serif; line-height: var(--rp-lh, 1.35); }
.paper.report.rp .rp-pt.no-box, .paper.report.rp .rp-cols.no-box { border: 0; }
.paper.report.rp .rp-pt td.k { font-size: var(--pl-fs, 11pt); font-weight: var(--pl-fw, 400); font-style: var(--pl-fi, normal); text-decoration: var(--pl-td, none); text-transform: var(--pl-tt, none); color: var(--pl-c, inherit); }
.paper.report.rp .rp-pt td.v { font-size: var(--pv-fs, 11pt); font-weight: var(--pv-fw, 400); font-style: var(--pv-fi, normal); text-decoration: var(--pv-td, none); text-transform: var(--pv-tt, none); color: var(--pv-c, inherit); }
.paper.report.rp .rp-pt td.v.nm { font-size: var(--pn-fs, 11pt); font-weight: var(--pn-fw, 700); font-style: var(--pn-fi, normal); text-decoration: var(--pn-td, none); text-transform: var(--pn-tt, uppercase); color: var(--pn-c, inherit); }
.paper.report.rp .rp-cols th { font-size: var(--ct-fs, 11pt); font-weight: var(--ct-fw, 700); font-style: var(--ct-fi, normal); text-decoration: var(--ct-td, none); text-transform: var(--ct-tt, none); color: var(--ct-c, inherit); }
.paper.report.rp .rp-dept { font-size: var(--dp-fs, 11pt); font-weight: var(--dp-fw, 700); font-style: var(--dp-fi, normal); text-decoration: var(--dp-td, none); text-transform: var(--dp-tt, uppercase); color: var(--dp-c, var(--p-ink)); text-align: var(--dp-ta, center); }
.paper.report.rp .rp-table td { padding-top: var(--rp-gap, .7mm); padding-bottom: var(--rp-gap, .7mm); }
.paper.report.rp .rp-table td[colspan] { padding-left: var(--g1, 3mm); }
.paper.report.rp .rp-table tr.in-sec > td[colspan] { padding-left: calc(var(--g1, 3mm) + var(--rp-indent, 5mm)); }
.paper.report.rp .rp-table .rp-group td { padding-top: calc(var(--rp-gap, .7mm) + .8mm); }
.paper.report.rp .rp-table .rp-group.pf td { font-size: var(--pf-fs, 11pt); font-weight: var(--pf-fw, 700); font-style: var(--pf-fi, normal); text-decoration: var(--pf-td, none); text-transform: var(--pf-tt, uppercase); color: var(--pf-c, inherit); text-align: var(--pf-ta, left); }
.paper.report.rp .rp-table .rp-group.sh td { font-size: var(--sh-fs, 11pt); font-weight: var(--sh-fw, 700); font-style: var(--sh-fi, normal); text-decoration: var(--sh-td, none); text-transform: var(--sh-tt, uppercase); color: var(--sh-c, inherit); text-align: var(--sh-ta, left); }
.paper.report.rp .rp-table td.tn { font-size: var(--tn-fs, 10pt); font-weight: var(--tn-fw, 400); font-style: var(--tn-fi, normal); text-decoration: var(--tn-td, none); text-transform: var(--tn-tt, uppercase); color: var(--tn-c, inherit); }
.paper.report.rp .rp-table td.tn small { text-transform: none; font-weight: 400; }
.paper.report.rp .rs { font-size: var(--rs-fs, 10pt); font-weight: var(--rs-fw, 400); font-style: var(--rs-fi, normal); text-decoration: var(--rs-td, none); text-transform: var(--rs-tt, none); color: var(--rs-c, inherit); }
.paper.report.rp .rp-table td.ab { font-size: var(--ab-fs, 10pt); font-weight: var(--ab-fw, 700); font-style: var(--ab-fi, normal); text-decoration: var(--ab-td, none); text-transform: var(--ab-tt, none); color: var(--ab-c, inherit); }
.paper.report.rp .rp-table td.un { font-size: var(--un-fs, 10pt); font-weight: var(--un-fw, 400); font-style: var(--un-fi, normal); text-decoration: var(--un-td, none); text-transform: var(--un-tt, none); color: var(--un-c, inherit); }
.paper.report.rp .rp-table td.rg { font-size: var(--rg-fs, 10pt); font-weight: var(--rg-fw, 400); font-style: var(--rg-fi, normal); text-decoration: var(--rg-td, none); text-transform: var(--rg-tt, none); color: var(--rg-c, inherit); white-space: pre-line; }
.paper.report.rp .rp-table td.interp { padding-top: 0; padding-bottom: 2mm; font-size: var(--ip-fs, 8.5pt); font-weight: var(--ip-fw, 400); font-style: var(--ip-fi, normal); text-decoration: var(--ip-td, none); text-transform: var(--ip-tt, none); color: var(--ip-c, inherit); }
.paper.report.rp .rp-remarks { font-size: var(--rm-fs, 11pt); font-weight: var(--rm-fw, 400); font-style: var(--rm-fi, normal); text-decoration: var(--rm-td, none); text-transform: var(--rm-tt, none); color: var(--rm-c, inherit); }
.paper.report.rp .sign-label { font-size: var(--li-fs, 10pt); font-weight: var(--li-fw, 700); font-style: var(--li-fi, normal); text-decoration: var(--li-td, none); text-transform: var(--li-tt, none); color: var(--li-c, var(--p-navy)); }
.paper.report.rp .end { font-size: var(--er-fs, 10pt); font-weight: var(--er-fw, 700); font-style: var(--er-fi, normal); text-decoration: var(--er-td, none); text-transform: var(--er-tt, none); color: var(--er-c, inherit); text-align: var(--er-ta, center); }
/* page flow: a department on its own sheet, a profile kept on one sheet when it fits */
.rp .rp-sec.new-page { break-before: page; }
.rp .rp-table tbody.keep { break-inside: avoid; }

/* Setup > Report Layout: the settings on the left, the sample report (the real sheet, made smaller) on the right */
.layout-edit { display: grid; grid-template-columns: minmax(430px, 1fr) minmax(0, 620px); gap: 18px; align-items: start; }
.layout-form label:not(.field) { display: flex; align-items: center; gap: 7px; font-size: 14px; }
.layout-table { margin-top: 6px; }
.layout-table th, .layout-table td { padding: 5px 8px; }
.layout-table th.tick, .layout-table td.tick { text-align: center; }
.layout-table td.move { white-space: nowrap; width: 76px; }
.layout-table input:not([type]), .layout-table select { width: 100%; min-width: 86px; }
.layout-table input.short { width: 70px; }
.layout-table td.colour { white-space: nowrap; }
.layout-table input[type=color], .layout-form input[type=color] { width: 44px; height: 28px; padding: 1px; }
.layout-preview { position: sticky; top: 10px; max-height: calc(100vh - 20px); overflow: auto; }
.layout-preview > h4 { margin: 0 0 6px; }
.layout-zoom { zoom: .76; }
@media (max-width: 1250px) { .layout-edit { grid-template-columns: 1fr; } .layout-preview { position: static; max-height: none; } }
@media print {
  .layout-edit { display: block; }
  .layout-preview { position: static; max-height: none; overflow: visible; }
  .layout-zoom { zoom: 1; }
}

/* Lab report layout, second part (owner, 21-Nov-2026: "add all of these options"): the Method column, the plain-paper heading
   and footer note (keys hn ha fn), the name under a sign line (sn), one or two sign lines with an optional signature picture,
   and the page number (pg; on paper it is a page margin box written by ReportSheet, on screen the .rp-pageno line). */
.paper.report.rp .rp-table td.mt { font-size: var(--mt-fs, 9pt); font-weight: var(--mt-fw, 400); font-style: var(--mt-fi, normal); text-decoration: var(--mt-td, none); text-transform: var(--mt-tt, none); color: var(--mt-c, inherit); }
.paper.report.rp .lh { justify-content: var(--hn-jc, center); }
.paper.report.rp .lh-text { text-align: var(--hn-ta, center); }
.paper.report.rp .lh h1 { font-family: inherit; font-size: var(--hn-fs, 26pt); font-weight: var(--hn-fw, 700); font-style: var(--hn-fi, normal); text-decoration: var(--hn-td, none); text-transform: var(--hn-tt, none); color: var(--hn-c, var(--p-red)); }
.paper.report.rp .lh p { font-size: var(--ha-fs, 10pt); font-weight: var(--ha-fw, 400); font-style: var(--ha-fi, normal); text-decoration: var(--ha-td, none); text-transform: var(--ha-tt, none); color: var(--ha-c, var(--p-navy)); }
.paper.report.rp footer { font-size: var(--fn-fs, 9pt); font-weight: var(--fn-fw, 400); font-style: var(--fn-fi, normal); text-decoration: var(--fn-td, none); text-transform: var(--fn-tt, none); color: var(--fn-c, #444); text-align: var(--fn-ta, left); }
.paper.report.rp .sign-box small { font-size: var(--sn-fs, 8.5pt); font-weight: var(--sn-fw, 400); font-style: var(--sn-fi, normal); text-decoration: var(--sn-td, none); text-transform: var(--sn-tt, none); color: var(--sn-c, inherit); }
.paper.report.rp .rp-pageno { margin-top: 2mm; text-align: var(--pg-side, right); font-size: var(--pg-fs, 9pt); font-weight: var(--pg-fw, 400); font-style: var(--pg-fi, normal); color: var(--pg-c, inherit); }
.paper.report.rp .rp-remarks.alone { margin-top: 6mm; }
.paper.report.rp .sign-row.one-left { justify-content: flex-start; padding-right: 0; }
.paper.report.rp .sign-row.one-center { justify-content: center; padding-right: 0; }
.paper.report.rp .sign-row.two { justify-content: space-between; padding-right: 0; }
.report .sign-line { position: relative; }
.report .sign-img { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); max-height: 14mm; max-width: 48mm; object-fit: contain; }
@media print {
  /* on paper the blank space for the letterhead and the footer band is the page margin (see ReportSheet); the gaps are for the screen */
  .rp .sheet .sheet-gap { display: none; }
}
/* report print page: the "Layout" picker; Setup > Report Layout: the saved-layouts bar and signature pictures */
.layout-pick { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--mute); }
.layout-book { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; }
.layout-book .field { min-width: 170px; }
.layout-sign-pick { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.layout-sign-pick img { max-height: 34px; max-width: 120px; border: 1px solid var(--line); border-radius: 4px; background: #fff; }
