/* Divya Clinic app — Navy & Saffron theme */
:root {
  --p: #1F3A68; --pd: #14264A; --a: #E3902A; --a2: #F2B45C; --tint: #EEF2F8; --tint2: #C9D4E6;
  --ink: #18222C; --muted: #5b6773; --bg: #f3f5f8; --card: #ffffff; --line: #dde3ea;
  --ok: #2e9b55; --wa: #d99a11; --hi: #d23b3b;
  --display: "Poppins", system-ui, sans-serif; --body: "Hind", "Poppins", system-ui, sans-serif;
  --radius: 10px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.2; margin: 0; }
h1 { font-size: 1.35rem; } h2 { font-size: 1.1rem; } h3 { font-size: 1rem; }
a { color: var(--p); }
button, input, select, textarea { font: inherit; color: inherit; }
.boot { min-height: 100vh; display: grid; place-content: center; text-align: center; color: var(--muted); }

/* layout */
.appbar { position: sticky; top: 0; z-index: 10; background: var(--p); color: #fff; display: flex; align-items: center; gap: 10px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 3px solid var(--a); }
.appbar .back { background: none; border: 0; color: #fff; font-size: 1.4rem; padding: 2px 8px; cursor: pointer; }
.appbar .title { flex: 1; min-width: 0; font-family: var(--display); font-weight: 600; font-size: 1.05rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appbar .who { font-size: .8rem; opacity: .85; text-align: right; }
.appbar img { width: 30px; height: 36px; background: #fff; border-radius: 6px; padding: 2px; }
main { max-width: 1100px; margin: 0 auto; padding: 14px 16px 90px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card h2 { color: var(--p); margin-bottom: 8px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.hr { height: 1px; background: var(--line); margin: 8px 0; }
.demo-badge { display: inline-block; background: #fff4e5; color: #8a5300; border: 1px solid var(--a2); border-radius: 999px; padding: 1px 8px; font-size: .72rem; font-weight: 600; }

/* forms */
label.f { display: flex; flex-direction: column; gap: 4px; font-size: .85rem; color: var(--muted); font-weight: 500; }
label.f > span.req::after { content: " *"; color: var(--hi); }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; font-size: 16px; color: var(--ink); }
textarea { min-height: 70px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--p); outline-offset: 0; border-color: var(--p); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--p); background: var(--p); color: #fff; border-radius: 8px; padding: 10px 16px; font-family: var(--display); font-weight: 500; font-size: .95rem; cursor: pointer; min-height: 44px; text-decoration: none; }
.btn.alt { background: #fff; color: var(--p); }
.btn.sa { background: var(--a); border-color: var(--a); color: #fff; }
.btn.danger { background: #fff; color: var(--hi); border-color: var(--hi); }
.btn.small { min-height: 34px; padding: 5px 10px; font-size: .85rem; }
.btn:disabled { opacity: .55; cursor: default; }
.btn.block { width: 100%; }
.err { color: var(--hi); font-size: .9rem; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 12px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; font-family: var(--display); font-weight: 500; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px; cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--p); border-color: var(--a); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 20px 16px; background: linear-gradient(180deg, var(--p) 0 38%, var(--bg) 38%); }
.login .box { width: 100%; max-width: 420px; background: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(20, 38, 74, .18); overflow: hidden; }
.login .head { text-align: center; padding: 22px 20px 10px; }
.login .head img { width: 84px; height: 104px; }
.login .head h1 { color: var(--p); margin-top: 6px; }
.login .head p { margin: 2px 0 0; color: var(--a); font-family: var(--display); font-size: .8rem; letter-spacing: 1px; text-transform: uppercase; }
.login form { padding: 4px 20px 20px; display: flex; flex-direction: column; gap: 12px; }
.pin { letter-spacing: 12px; text-align: center; font-size: 1.5rem; font-family: var(--display); }

/* lists */
.list { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list .item { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; background: #fff; border-left: 0; border-right: 0; border-top: 0; width: 100%; }
.list .item:last-child { border-bottom: 0; }
.list .item:hover, .list .item:focus-visible { background: var(--tint); }
.avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--tint); color: var(--p); display: grid; place-items: center; font-family: var(--display); font-weight: 600; flex: none; }
.item .name { font-weight: 600; font-family: var(--display); font-size: .98rem; }
.item .meta { color: var(--muted); font-size: .85rem; }
.pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: .75rem; background: var(--tint); color: var(--p); font-weight: 600; }
.pill.sa { background: #fdf0e0; color: #9a5a0c; }

/* floating button */
.fab { position: fixed; right: 18px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 20; border-radius: 999px; box-shadow: 0 6px 18px rgba(20, 38, 74, .3); padding: 14px 20px; }

/* results */
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot.green { background: var(--ok); } .dot.yellow { background: var(--wa); } .dot.red { background: var(--hi); }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th { text-align: left; font-family: var(--display); font-weight: 500; color: var(--p); border-bottom: 2px solid var(--tint2); padding: 6px; font-size: .8rem; }
table.t td { border-bottom: 1px solid var(--line); padding: 7px 6px; vertical-align: top; }
.scroll-x { overflow-x: auto; }
.spark { width: 120px; height: 32px; }

/* medicine rows */
.medrow { display: grid; grid-template-columns: 1fr; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; }
.medrow .doses { display: grid; grid-template-columns: repeat(3, 1fr) 1.6fr 1fr auto; gap: 6px; align-items: end; }
@media (max-width: 520px) { .medrow .doses { grid-template-columns: repeat(3, 1fr); } }
.medrow input { padding: 8px; }

/* chips for quick picks */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--tint2); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .88rem; }
.chip[aria-pressed="true"] { background: var(--p); color: #fff; border-color: var(--p); }

/* toast and dialog */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 100; max-width: 90vw; }
#toast.show { opacity: 1; }
dialog { border: 0; border-radius: 12px; padding: 0; max-width: min(520px, 92vw); width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(20, 38, 74, .45); }
dialog .dh { background: var(--p); color: #fff; padding: 12px 16px; font-family: var(--display); font-weight: 600; }
dialog .db { padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* side menu on wide screens */
.shell { display: block; }
.sidenav { display: none; }
@media (min-width: 1100px) {
  .shell { display: grid; grid-template-columns: 220px 1fr; }
  .sidenav { display: flex; flex-direction: column; gap: 2px; background: #fff; border-right: 1px solid var(--line); min-height: calc(100vh - 56px); padding: 12px 8px; position: sticky; top: 56px; align-self: start; }
  .sidenav a { padding: 10px 12px; border-radius: 8px; text-decoration: none; color: var(--ink); font-family: var(--display); font-size: .92rem; }
  .sidenav a[aria-current="page"] { background: var(--tint); color: var(--p); font-weight: 600; }
}
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 15; padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { flex: 1; text-align: center; padding: 9px 4px; text-decoration: none; color: var(--muted); font-family: var(--display); font-size: .78rem; }
.bottomnav a[aria-current="page"] { color: var(--p); font-weight: 600; box-shadow: inset 0 3px 0 var(--a); }
@media (min-width: 1100px) { .bottomnav { display: none; } }

/* ---------- printing ---------- */
#print-root { display: none; }
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff; }
  #app, #toast, .rx-overlay, dialog { display: none !important; }
  #print-root { display: block; }
  .sheet { box-shadow: none !important; transform: none !important; }
}

/* ---------- visit form (4 steps, as in the demo) ---------- */
.hi { font-family: "Hind", var(--body); }
.tiny { font-size: .78rem; color: var(--muted); }
.nowrap { flex-wrap: nowrap; }
.row.top { align-items: flex-start; }
.vhead { margin-bottom: 8px; }
.prog { height: 6px; background: var(--tint2); border-radius: 999px; overflow: hidden; }
.prog i { display: block; height: 100%; background: var(--a); transition: width .2s; }
.steps { display: flex; justify-content: space-between; gap: 4px; margin: 8px 0 12px; }
.steps button { background: none; border: 0; padding: 6px 2px; font-family: var(--display); font-size: .82rem; color: var(--muted); text-decoration: underline; cursor: pointer; }
.steps button.on { color: var(--p); font-weight: 600; text-decoration: none; }
.ghead { font-family: var(--display); font-weight: 600; margin-bottom: 8px; }
.ghead .hi { font-weight: 400; color: var(--muted); }
h3.sub { color: var(--p); margin: 8px 0 2px; font-size: .95rem; }
.chip .hi { color: var(--muted); }
.chip[aria-pressed="true"] .hi { color: #e6ecf5; }
.chip.left { text-align: left; border-radius: 12px; }
.chip small { opacity: .7; }
.chip.pac { border-color: #b9a6dd; background: #f3eefb; }
.chip.pac[aria-pressed="true"] { background: #6a3fa0; border-color: #6a3fa0; }
.chip.grp { border-color: rgba(var(--g), .45); background: rgba(var(--g), .08); color: rgb(var(--g)); }
.chip.grp i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: rgb(var(--g)); margin-right: 6px; }
.chip.grp[aria-pressed="true"] { background: rgba(var(--g), .28); border-color: rgb(var(--g)); color: rgb(var(--g)); font-weight: 600; }
.chip.bundle { border-color: #0e7c72; color: #0e7c72; }
.chip.bundle2 { border-color: var(--p); color: var(--p); }
.chip.bundle2[aria-pressed="true"] { color: #fff; }
.chip.sS[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); }
.chip.sI[aria-pressed="true"] { background: var(--wa); border-color: var(--wa); }
.chip.sR[aria-pressed="true"] { background: var(--hi); border-color: var(--hi); }
.row.sens { gap: 6px; border-top: 1px solid var(--line); padding-top: 6px; }
.row.sens .chip { min-width: 44px; }
.lab { display: grid; grid-template-columns: 1fr 110px; gap: 4px 10px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.lab.one { grid-template-columns: 1fr; }
.lab .p { font-weight: 600; font-family: var(--display); font-size: .92rem; }
.lab .p .hi { font-weight: 400; color: var(--muted); }
.lab .p small { display: block; font-family: var(--body); font-weight: 400; color: var(--muted); font-size: .76rem; }
.lab input { text-align: center; font-weight: 600; }
.lab.one input { text-align: left; font-weight: 400; }
.lab .fb { grid-column: 1 / -1; font-size: .82rem; }
.lab .fb:empty { display: none; }
.bad { color: var(--hi); font-weight: 600; }
.pill.ok { background: #e3f4e8; color: #1f6e3a; }
.pill.wa { background: #fdf1d6; color: #8a5a00; }
.pill.hi { background: #fbe3e3; color: #a32323; }
.msg { border-radius: 10px; padding: 10px 12px; font-size: .9rem; border: 1px solid var(--line); background: var(--tint); }
.msg b { display: block; }
.msg.y { background: #fff6e0; border-color: #f2d48a; }
.msg.r { background: #fde9e9; border-color: #f0b4b4; }
.msg.g { background: #e7f6ec; border-color: #b4dfc2; }
.q { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.q .qt { font-weight: 600; }
.scale { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 8px; }
.scale button { min-height: 42px; border: 1px solid var(--tint2); border-radius: 8px; background: #fff; cursor: pointer; font-weight: 600; }
.scale button[aria-pressed="true"] { background: var(--p); color: #fff; border-color: var(--p); }
.pacbox { border-left: 5px solid #6a3fa0; padding-left: 10px; display: flex; flex-direction: column; gap: 8px; }
#vbody > .lab + .lab, .pacbox .lab + .lab { margin-top: 0; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.thumbs .th { position: relative; }
.thumbs img, .thumbs video { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; background: #000; }
.x { background: #fff; border: 1px solid var(--line); border-radius: 50%; width: 32px; height: 32px; cursor: pointer; flex: none; }
.thumbs .x { position: absolute; top: 4px; right: 4px; }
.card.onco { border-left: 6px solid #6d1b45; }
.card.plan { border-left: 6px solid var(--a); }
.card.edit { border: 2px solid var(--a); }
.medcard { display: flex; flex-direction: column; gap: 8px; }
.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(70px, 1fr)); gap: 6px; }
.seg .chip { border-radius: 8px; text-align: center; }
.pre { white-space: pre-line; font-weight: 400; margin-top: 4px; }
.btnrow { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 16px; }
table.review td.v { text-align: right; font-weight: 600; }
dialog.wide { max-width: min(760px, 96vw); }
dialog .db { max-height: 82vh; overflow: auto; }
.hxitem { border-top: 1px solid var(--line); padding-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.hxitem .row { align-items: flex-end; }

/* ---------- patient page (as in the demo) ---------- */
.pthead h1 { margin-bottom: 2px; }
.wchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.wchip { border-radius: 6px; padding: 2px 8px; font-size: .8rem; font-weight: 600; background: var(--tint); color: var(--p); }
.wchip.r { background: #fbe3e3; color: #a32323; }
.wchip.y { background: #fdf1d6; color: #8a5a00; }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tile { border: 0; border-radius: 12px; padding: 12px 10px; color: #fff; text-align: center; text-decoration: none; cursor: pointer; display: flex; flex-direction: column; justify-content: center; min-height: 70px; font-family: var(--display); }
.tile b { font-weight: 600; font-size: .95rem; } .tile span { font-family: "Hind", var(--body); font-size: .85rem; opacity: .9; }
.tile.green { background: #2e7d32; } .tile.purple { background: #6a3fa0; } .tile.violet { background: #5b3c8f; } .tile.dark { background: #263238; } .tile.teal { background: #0e7c72; } .tile.plum { background: #8a1e52; }
.timeline { position: relative; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--tint2); }
.ev { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.ev::before { content: ""; position: absolute; left: -19px; top: 14px; width: 12px; height: 12px; border-radius: 50%; background: #2e7d32; border: 2px solid #fff; }
.ev.media::before { background: #6a3fa0; } .ev.ot::before { background: #8a1e52; } .ev.device::before { background: #6a3fa0; } .ev.reg::before { background: var(--p); }
.ev .when { font-size: .78rem; color: var(--muted); font-family: ui-monospace, monospace; }
.ev .ttl { font-family: var(--display); font-weight: 600; }
.ev img, .ev video { width: 100%; max-height: 320px; object-fit: contain; background: #111; border-radius: 8px; margin-top: 6px; }
.ev .plan { color: #b35c00; }
.resline .dot { width: 8px; height: 8px; vertical-align: middle; }
.trow { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; text-decoration: none; color: var(--ink); }
.trow .val { font-family: var(--display); font-size: 1.05rem; }
table.kv td { padding: 4px 10px 4px 0; vertical-align: top; }

/* sticker 50 x 25 mm */
@page sticker { size: 50mm 25mm; margin: 0; }
.stk { page: sticker; width: 50mm; height: 25mm; box-sizing: border-box; padding: 1.2mm 2mm; font-family: Arial, sans-serif; color: #000; display: flex; flex-direction: column; align-items: center; overflow: hidden; break-after: page; }
.stk .n { font-weight: 700; font-size: 9pt; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.stk .m { font-size: 7pt; }
.stk svg { width: 44mm; height: 9mm; margin-top: .6mm; }
.stk .u { font-size: 7pt; letter-spacing: 1px; }
.stk-prev { display: flex; justify-content: center; padding: 10px; background: var(--bg, #f4f6f9); border-radius: 10px; }
.stk-prev .stk { background: #fff; border: 1px dashed #999; transform: scale(1.6); margin: 22px 0; }
.stk-a4 { width: 210mm; display: grid; grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37mm; }
.stk-a4 .cell { display: flex; align-items: center; justify-content: center; }
.stk-a4 .stk { page: auto; break-after: auto; }

/* diagrams */
.draw-overlay { position: fixed; inset: 0; z-index: 50; background: var(--bg, #f4f6f9); overflow: auto; }
.draw-overlay main { margin: 0 auto; padding: 12px 16px 40px; }
#drawcv { width: 100%; max-width: 640px; aspect-ratio: 1; display: block; margin: 0 auto; border: 1px solid #c9d1da; border-radius: 10px; background: #fff; touch-action: none; cursor: crosshair; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #9aa6b2; cursor: pointer; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--a); }

/* OT notes */
.res { display: flex; gap: 10px; align-items: center; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; }
.res .nm { font-weight: 600; }
.dot.navy { background: var(--p); }
.ev.ot { display: block; color: inherit; text-decoration: none; border-left-color: #8a1e52; }
.th.dia { padding: 0; border: 3px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; }
.th.dia[aria-pressed="true"] { border-color: var(--a); }
.th.dia img { height: 120px; object-fit: contain; background: #fff; }
/* malignancy registry */
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.strip > div { border-radius: 10px; padding: 10px 12px; font-size: .85rem; color: var(--muted); border: 1px solid var(--line); background: var(--card); }
.strip b { display: block; font-size: 1.5rem; font-family: var(--display); color: var(--ink, #18222d); }
.strip .s-g { border-left: 5px solid var(--ok); } .strip .s-y { border-left: 5px solid var(--wa); } .strip .s-r { border-left: 5px solid var(--hi); }
.res.top { align-items: flex-start; }
.chart { overflow: hidden; }
.bcgrow { padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; align-items: center; gap: 8px; }
.bcgrow.nx { border-color: var(--a); background: #fdf6ec; }
table.review th { text-align: left; font-size: .8rem; color: var(--muted); }
table.review td { vertical-align: top; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.ev.onco { border-left-color: #6a3fa0; }

/* bills, payments, pharmacy */
.tile.money { background: #1e6b34; }
.tile.pharm { background: #00796b; }
.catbox { border: 1px solid var(--line); border-left: 6px solid rgb(var(--c)); border-radius: 12px; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; background: #fff; }
.catbox input, .catbox select { min-height: 38px; padding: 4px 6px; }
.bline { border-top: 1px solid rgba(0,0,0,.08); padding-top: 6px; display: flex; flex-direction: column; gap: 4px; }
.chip.q { min-width: 38px; padding: 4px 0; text-align: center; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } }
.kpi { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--tint); }
.kpi span { display: block; font-size: .78rem; color: var(--muted); }
.kpi b { font-family: var(--display); font-size: 1.15rem; }
.hb { display: grid; grid-template-columns: minmax(90px, 32%) 1fr auto; gap: 8px; align-items: center; font-size: .85rem; }
.hb i { display: block; height: 10px; border-radius: 5px; background: var(--a); }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 140px; padding-top: 14px; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; min-width: 0; }
.bar i { display: block; width: 100%; background: var(--tint2); border-radius: 4px 4px 0 0; }
.bar.on i { background: var(--p); }
.bar small { font-size: .62rem; color: var(--muted); white-space: nowrap; }
.bar span { font-size: .62rem; color: var(--muted); white-space: nowrap; overflow: hidden; max-width: 100%; }
dialog .res { padding: 8px 10px; }

/* pathology */
.tile.lab { background: #0277BD; color: #fff; }
.tdot { display: inline-block; border-radius: 50%; vertical-align: middle; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.labsteps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.labsteps .lst { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border: 2px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--ink); cursor: pointer; }
.labsteps .lst[aria-pressed=true] { border-color: #0277BD; background: #E3F2FD; }
.labsteps .lst .n { width: 26px; height: 26px; border-radius: 50%; background: #0277BD; color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; }
.labsteps .lst .hi { font-size: .75rem; color: var(--muted, #56636f); }
.labsteps .lst .cnt { position: absolute; top: -8px; right: -6px; min-width: 22px; height: 22px; border-radius: 11px; background: var(--a, #E3902A); color: #fff; font-size: .75rem; font-weight: 700; display: grid; place-items: center; padding: 0 5px; }
.labrow { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 10px; }
.labrow .btn { width: auto; flex: none; }
.stepper { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.stepper .sp { text-align: center; font-size: .8rem; color: var(--muted, #56636f); }
.stepper .sp span { display: grid; place-items: center; width: 28px; height: 28px; margin: 0 auto 2px; border-radius: 50%; border: 2px solid var(--line); font-weight: 700; }
.stepper .sp.done span { background: var(--ok, #2E7D32); border-color: var(--ok, #2E7D32); color: #fff; }
.stepper .sp.now { color: var(--ink); font-weight: 700; }
.stepper .sp.now span { border-color: #0277BD; color: #0277BD; }
.card.cur { border: 2px solid #0277BD; }
.tube { display: flex; gap: 10px; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; }
.tube .cap { width: 18px; height: 34px; border-radius: 5px 5px 9px 9px; flex: none; }
.repbox { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--line); padding-top: 8px; }
/* vial sticker 50 x 25 mm */
.vstk { page: sticker; width: 50mm; height: 25mm; box-sizing: border-box; display: flex; font-family: Arial, sans-serif; color: #000; background: #fff; overflow: hidden; break-after: page; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.vstk .vbar { width: 4mm; flex: none; display: flex; align-items: center; justify-content: center; }
.vstk .vbar span { writing-mode: vertical-rl; transform: rotate(180deg); color: #fff; font-weight: 700; font-size: 4.6pt; white-space: nowrap; letter-spacing: .2px; }
.vstk .vb { flex: 1; min-width: 0; padding: .8mm 1.4mm .6mm; display: flex; flex-direction: column; }
.vstk .r1 { display: flex; justify-content: space-between; gap: 2mm; font-size: 6.5pt; }
.vstk .r1 b { font-size: 8pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vstk .t { font-size: 5.5pt; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vstk svg { width: 100%; height: 9.5mm; margin-top: .4mm; }
.vstk .u { font-size: 6pt; text-align: center; font-weight: 700; letter-spacing: .3px; }
.sheet.ot .labt .fl.hi { color: #a61b1b; } .sheet.ot .labt .fl.wa { color: #8a5a00; }
.sheet.ot .labt .rg { color: #56636f; font-size: 12px; }

/* calendar */
.calwrap { display: grid; grid-template-columns: 1fr; gap: 12px; }
@media (min-width: 900px) { .calwrap { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; } }
.calhead { display: flex; align-items: center; gap: 8px; }
.calgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.calgrid .wd { text-align: center; font-size: .72rem; color: var(--muted); font-weight: 600; }
.cd { position: relative; min-height: 54px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px 2px 8px; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; overflow: hidden; }
.cd.empty { border: 0; background: none; cursor: default; }
.cd .dn { font-size: .78rem; color: var(--muted); }
.cd .ct { font-family: var(--display); font-size: 1rem; color: var(--p); }
.cd .hl { font-size: .55rem; font-weight: 700; color: var(--hi); letter-spacing: .02em; }
.cd .ld { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--ok); border-radius: 0 2px 2px 0; }
.cd .ld.busy { background: var(--wa); } .cd .ld.full { background: var(--hi); }
.cd.off { background: #f1f3f6; }
.cd.hol { background: #fde9e9; border-color: #f0b4b4; }
.cd.past { opacity: .6; }
.cd.today { border-color: var(--a); border-width: 2px; }
.cd.sel { background: var(--p); border-color: var(--p); opacity: 1; }
.cd.sel .dn, .cd.sel .ct, .cd.sel .hl { color: #fff; }
.tdot2 { position: absolute; top: 4px; right: 4px; width: 7px; height: 7px; border-radius: 50%; background: var(--wa); }
.clegend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .75rem; color: var(--muted); align-items: center; }
.clegend span { display: inline-flex; align-items: center; gap: 4px; }
.clegend .ct { color: var(--p); font-family: var(--display); }
.lg { display: inline-block; width: 16px; height: 5px; border-radius: 2px; background: var(--ok); }
.lg.busy { background: var(--wa); } .lg.full { background: var(--hi); } .lg.hol { background: #fde9e9; border: 1px solid #f0b4b4; height: 10px; }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.slot { border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 6px 4px; display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.slot b { font-size: .9rem; } .slot span { font-size: .7rem; color: var(--muted); }
.slot.on { background: var(--p); border-color: var(--p); color: #fff; } .slot.on span { color: #dfe6f2; }
.slot.full, .slot:disabled { background: #f1f3f6; color: var(--muted); cursor: not-allowed; }
.slot.full { cursor: pointer; border-style: dashed; }
.aprow { display: flex; gap: 10px; align-items: flex-start; border-top: 1px solid var(--line); padding-top: 10px; }
.aprow:first-of-type { border-top: 0; padding-top: 0; }
.aprow .tm { width: 66px; flex: none; color: var(--p); font-family: var(--display); font-size: .9rem; }
.aprow.cx { opacity: .55; } .aprow.cx b { text-decoration: line-through; }
.calbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 10px; background: var(--tint); border: 1px solid var(--tint2); border-left: 5px solid var(--a); color: inherit; text-decoration: none; }
.calbar .grow { display: flex; flex-direction: column; }
.calbig { font-family: var(--display); font-size: 1.6rem; color: var(--p); }

/* Excel sheets */
.btn.xl { background: #1D6F42; border-color: #1D6F42; color: #fff; }
.res.on { border: 2px solid #1D6F42; }
.xlchk { flex: none; width: 24px; height: 24px; border-radius: 6px; background: #dfe5ea; color: #fff; display: flex; align-items: center; justify-content: center; font-style: normal; font-weight: 700; }
.res.on .xlchk { background: #1D6F42; }
.card.xlmaster { border: 2px solid #1D6F42; background: #F3FAF5; }
.xlprev { font-size: .78rem; white-space: nowrap; }
.sidenav .logout { margin-top: 12px; color: #a32323; }
.scanbtn { border: 1px solid rgba(255,255,255,.4); background: rgba(255,255,255,.12); color: #fff; border-radius: 8px; padding: 6px 10px; font-weight: 600; cursor: pointer; white-space: nowrap; }

/* "From the clinic" library */
.libstrip { background: transparent; border-style: dashed; margin-top: 10px; }
.libscroll { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.libtile { flex: 0 0 130px; display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); cursor: pointer; color: inherit; }
.libtile .lt { font-size: .85rem; font-weight: 600; line-height: 1.2; }
.libic { width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center; background: var(--tint); color: var(--p); flex: none; }
.libopen { display: flex; gap: 10px; align-items: center; border: 0; background: none; text-align: left; color: inherit; cursor: pointer; padding: 0; }

/* Referred patients: stages as small blue highlights (list and progress page) */
.stagehl { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.stagehl .sh { display: inline-flex; flex-direction: column; border-radius: 999px; padding: 3px 10px; font-size: .78rem; font-weight: 600; line-height: 1.25; background: #fff; color: #8a93a3; border: 1px solid var(--line); }
.stagehl .sh small { font-weight: 400; font-size: .7rem; opacity: .85; }
.stagehl .sh.done { background: var(--tint); color: var(--p); border-color: var(--tint2); }
.stagehl .sh.now { background: var(--p); color: #fff; border-color: var(--p); }
.stagehl.mini .sh { font-size: .7rem; padding: 2px 8px; }

/* Consent at registration (G-01 points, EN + HI) */
.cons { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); cursor: pointer; }
.cons input { width: 22px; height: 22px; flex: none; margin-top: 2px; accent-color: var(--p); }
dialog .consentbox { border: 0; padding: 0; box-shadow: none; }
