:root {
  /* "Clinical Teal & Crisp Neutral" design system (owner, Nov 2026) */
  --bg: #F3F5F7; --card: #FFFFFF; --ink: #1E293B; --muted: #64748B; --line: #DCE2E6;
  --brand: #0F766E; --brand-2: #E6F4F1; --nav: #0B463D; --danger: #B91C1C; --warn: #B45309; --ok: #067647;
  --warn-bg: #FEF3C7; --alert-bg: #FEE2E2; --info-bg: #DBEAFE; --info-fg: #1E3A8A; --neutral-bg: #F1F5F9; --neutral-fg: #475569;
  --radius: 6px; --side: 220px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Gujarati", sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.35rem; margin: 0 0 .9rem; }
h2 { font-size: 1.05rem; margin: 0 0 .6rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* layout */
.layout { display: flex; min-height: 100vh; }
.side { width: var(--side); background: var(--nav); color: #d7e6e8; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.side .brand { padding: 1rem; font-weight: 700; color: #fff; border-bottom: 1px solid #ffffff1f; line-height: 1.2; }
.side .brand small { display: block; font-weight: 400; color: #9fc3c6; font-size: .75rem; margin-top: .2rem; }
.side nav a { display: block; padding: .55rem 1rem; color: #d7e6e8; border-left: 3px solid transparent; }
.side nav a:hover { background: #ffffff12; text-decoration: none; }
.side nav a.active { background: #ffffff1a; border-left-color: #5fd0c8; color: #fff; }
.side nav .sep { padding: .9rem 1rem .3rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em; color: #8fb2b5; }
.main { flex: 1; min-width: 0; }
.topbar { display: flex; align-items: center; gap: 1rem; padding: .6rem 1.2rem; background: var(--card); border-bottom: 1px solid var(--line); }
.topbar form.search { flex: 1; max-width: 420px; }
.topbar .user { margin-left: auto; font-size: .9rem; }
.content { padding: 1.2rem; max-width: 1280px; }
.menu-btn { display: none; background: none; border: 0; font-size: 1.4rem; cursor: pointer; }

/* cards & grid */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; margin-bottom: 1rem; }
.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid > * { min-width: 0; }
.grid-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.stat { text-align: left; }
.stat .num { font-size: 1.8rem; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: .85rem; }
.row { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* patient strip */
.pstrip { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; background: var(--brand-2); border: 1px solid #cfe5e5; border-radius: var(--radius); padding: .7rem 1rem; margin-bottom: 1rem; }
.pstrip b { font-size: 1.05rem; }
.pstrip .warn { color: var(--danger); font-weight: 600; }

/* forms */
.input, select.input, textarea.input { width: 100%; padding: .5rem .6rem; border: 1px solid #c5ced6; border-radius: 6px; font: inherit; background: #fff; }
.input:focus { outline: 2px solid #5fd0c8; border-color: var(--brand); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .7rem 1rem; }
.fields .wide { grid-column: 1 / -1; }
.field label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .2rem; }
.field .req { color: var(--danger); }
.field .help { font-size: .78rem; color: var(--muted); }
.field .err, .errorlist { color: var(--danger); font-size: .82rem; margin: .2rem 0 0; padding: 0; list-style: none; }
.field.check label { display: flex; gap: .4rem; align-items: center; font-weight: 500; }
.field ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
.btn { display: inline-block; padding: .5rem .95rem; border-radius: 6px; border: 1px solid var(--brand); background: var(--brand); color: #fff; font: inherit; cursor: pointer; }
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.light { background: #fff; color: var(--brand); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.small { padding: .25rem .6rem; font-size: .85rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }

/* tables */
table.list { width: 100%; border-collapse: collapse; background: #fff; }
table.list th, table.list td { padding: .5rem .6rem; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.list th { font-size: .8rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #fafbfc; }
table.list tr:hover td { background: #f7fbfb; }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }

/* badges */
.badge { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 600; background: #eef1f4; color: #344054; }
.badge.WAITING { background: #fef0c7; color: var(--warn); }
.badge.IN_CONSULT { background: #d1e9ff; color: #175cd3; }
.badge.COMPLETED, .badge.FINAL, .badge.DISCHARGED { background: #d1fadf; color: var(--ok); }
.badge.CANCELLED { background: #fee4e2; color: var(--danger); }
.badge.OPEN, .badge.ADMITTED { background: #e0eaff; color: #3538cd; }

/* messages */
.msgs { list-style: none; padding: 0; margin: 0 0 1rem; }
.msgs li { padding: .6rem .9rem; border-radius: 6px; margin-bottom: .4rem; background: #e6f4ea; color: #0b5d2a; }
.msgs li.error { background: #fde8e7; color: var(--danger); }
.msgs li.info { background: #e8f1fd; color: #175cd3; }

/* bed board */
.beds { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; }
.bed { border: 1px solid var(--line); border-radius: 6px; padding: .55rem; background: #f0fbf4; min-height: 70px; }
.bed.busy { background: #fff4ed; border-color: #f9dbaf; }
.bed .no { font-weight: 700; }

/* tabs */
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; flex-wrap: wrap; }
.tabs a { padding: .45rem .9rem; border: 1px solid transparent; border-bottom: 0; border-radius: 6px 6px 0 0; }
.tabs a.active { background: #fff; border-color: var(--line); margin-bottom: -1px; font-weight: 600; }

/* login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #12333a, #0f6e6e); }
.login-card { background: #fff; padding: 2rem; border-radius: 12px; width: min(380px, 92vw); }

/* print */
.print-page { max-width: 800px; margin: 0 auto; padding: 1.5rem; background: #fff; font-size: 14px; }
.print-head { display: flex; gap: 1rem; align-items: center; border-bottom: 2px solid var(--ink); padding-bottom: .6rem; margin-bottom: .8rem; }
.print-head img { max-height: 70px; }
.print-head h1 { margin: 0; font-size: 1.4rem; }
.print-meta { display: grid; grid-template-columns: 1fr 1fr; gap: .2rem 1rem; border-bottom: 1px solid #999; padding-bottom: .6rem; margin-bottom: .8rem; }
.print-foot { margin-top: 2rem; display: flex; justify-content: space-between; align-items: flex-end; }
.no-print { margin: 1rem auto; max-width: 800px; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  .print-page { padding: 0; max-width: none; }
}

/* mobile */
@media (max-width: 900px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-main { grid-template-columns: 1fr; }
  .side { position: fixed; left: -100%; z-index: 20; transition: left .2s; }
  .side.open { left: 0; }
  .menu-btn { display: block; }
  .content { padding: .8rem; }
}
@media (max-width: 560px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .topbar .user span { display: none; }
}
#rx-table td.med .input { min-width: 220px; }
#rx-table .input { min-width: 70px; }
#rx-table td { padding: .3rem; }
#rx-table .input { padding: .35rem .45rem; }

/* quick search (top bar) */
.topbar form.search { position: relative; }
#search-results { position: absolute; top: 42px; left: 0; right: 0; min-width: 520px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 28px #0003; max-height: 70vh; overflow: auto; display: none; z-index: 30; }
#search-results a { display: grid; grid-template-columns: 120px 1fr 90px 100px; gap: .5rem; padding: .5rem .8rem; border-bottom: 1px solid var(--line); color: var(--ink); }
#search-results a.sel, #search-results a:hover { background: var(--brand-2); text-decoration: none; }
#search-results .uhid { font-family: monospace; font-weight: 700; }
#search-results .empty { padding: .6rem .8rem; color: var(--muted); }
#search-results a.new { display: block; font-weight: 600; background: #fafbfc; }

/* photo */
.cam { display: flex; gap: .8rem; align-items: flex-start; flex-wrap: wrap; }
.cam video, .cam canvas, .cam img { width: 150px; height: 150px; object-fit: cover; border-radius: 8px; background: #222; }
.pcard { display: grid; grid-template-columns: 110px 1fr; gap: 1rem; align-items: start; }
.pcard .photo { width: 110px; height: 130px; object-fit: cover; border-radius: 8px; background: #e6ebf0; border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; }
.pstrip { align-items: center; }
.pstrip-photo { width: 42px; height: 42px; object-fit: cover; border-radius: 50%; border: 1px solid #cfe5e5; }

/* casualty triage */
.tri { display: inline-block; padding: .15rem .6rem; border-radius: 99px; font-weight: 700; font-size: .8rem; color: #fff; background: #888; }
.tri.RED { background: #c62828; } .tri.YELLOW { background: #f2b705; color: #222; } .tri.GREEN { background: #2e7d32; } .tri.BLACK { background: #222; }
tr.tri-RED td { background: #fff5f5; } tr.tri-YELLOW td { background: #fffbea; } tr.tri-PENDING td { background: #f5f5f5; }
.field ul li label { font-weight: 500; }

/* ---------- registration layout (photo top-right, sections) ---------- */
.reg .sec { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  border-bottom: 1px solid var(--line); padding-bottom: .25rem; margin: 1.1rem 0 .6rem; }
.reg .reg-top .sec { margin-top: 0; }
.reg-top { display: grid; grid-template-columns: minmax(0, 1fr) 170px; gap: 1.2rem; align-items: start; }
.fields.f4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.fields .span2 { grid-column: span 2; } .fields .span3 { grid-column: span 3; } .fields .span4 { grid-column: 1 / -1; }
.field.has-err .input { border-color: var(--danger); }
.photo-box { border: 1px dashed var(--line); border-radius: var(--radius); padding: .6rem; background: #fafbfc; }
.cam-compact { flex-direction: column; align-items: center; gap: .4rem; }
.cam-compact .cam-frame { width: 148px; height: 178px; border-radius: 6px; overflow: hidden; background: #eef2f5;
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.cam-compact .cam-frame video, .cam-compact .cam-frame canvas, .cam-compact .cam-frame img { width: 148px; height: 178px; object-fit: cover; border-radius: 0; }
.cam-empty { display: flex; flex-direction: column; align-items: center; color: #94a3b8; font-size: 3rem; line-height: 1; }
.cam-empty span { font-size: .75rem; margin-top: .3rem; }
.cam-btns { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: center; }
.cam-compact .hint { text-align: center; }
.ac-wrap { position: relative; }
.ac-list { position: absolute; z-index: 25; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line);
  border-radius: 6px; max-height: 260px; overflow: auto; display: none; min-width: 320px; }
.ac-list div { padding: .4rem .6rem; cursor: pointer; border-bottom: 1px solid #f1f5f9; font-size: .88rem; }
.ac-list div.sel, .ac-list div:hover { background: var(--brand-2); }
.ac-list small { color: var(--muted); }
.filled { background: #f6fbfa !important; }
.callout { background: var(--brand-2); border-left: 3px solid var(--brand); }
.warn-callout { background: #fffbeb; border-left: 3px solid var(--warn); }
.pill { display: inline-block; padding: .1rem .5rem; border-radius: 99px; font-size: .78rem; font-weight: 600; }
.pill.warn { background: var(--warn-bg); color: var(--warn); }
.pill.alert { background: var(--alert-bg); color: var(--danger); }
.pill.info { background: var(--info-bg); color: var(--info-fg); }
kbd { font: 600 .72rem/1 ui-monospace, monospace; padding: .12rem .35rem; border-radius: 4px; background: var(--neutral-bg); color: var(--neutral-fg); border: 1px solid #cbd5e1; }
.btn kbd { background: #ffffff2e; color: inherit; border-color: #ffffff66; }
.num, td.num { font-variant-numeric: tabular-nums; }
@media (max-width: 1100px) { .fields.f4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .reg-top { grid-template-columns: 1fr; } .fields .span3 { grid-column: 1 / -1; } }
.age-hint { color: var(--brand); font-weight: 600; }

/* ---------- compact one-screen registration (21 Nov 2026) ---------- */
.content.wide { max-width: none; }
.reg-compact { padding: .7rem .9rem; margin-bottom: .6rem; }
.reg-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: .45rem; }
.reg-head h1 { margin: 0; font-size: 1.15rem; }
.reg-grid { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)) 128px; gap: .4rem .6rem; align-items: start; }
.reg-grid .c1 { grid-column: span 1; } .reg-grid .c2 { grid-column: span 2; } .reg-grid .c3 { grid-column: span 3; } .reg-grid .c4 { grid-column: span 4; }
.reg-grid .photo-cell { grid-column: 9; grid-row: 1 / span 3; }
.reg-grid .field label { font-size: .74rem; font-weight: 600; color: var(--muted); margin-bottom: .1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reg-grid .input { padding: .32rem .45rem; font-size: .9rem; height: 2rem; }
.reg-grid select.input { padding: .2rem .35rem; }
.reg-grid .err { font-size: .72rem; }
.reg-grid .age-hint { font-size: .72rem; line-height: 1.1; margin-top: .1rem; white-space: nowrap; }
.reg-grid .age-hint:empty { display: none; }
.reg-grid .title-name { display: flex; }
.reg-grid .title-name select { flex: 0 0 4.4rem; width: 4.4rem; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; padding-right: .1rem; }
.reg-grid .title-name input { flex: 1 1 auto; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.reg-grid .joined { display: flex; }
.reg-grid .joined select { flex: 0 0 4.7rem; width: 4.7rem; padding: .2rem .15rem; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.reg-grid .joined input { flex: 1 1 auto; min-width: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.reg-foot .lang-field { display: flex; align-items: center; gap: .35rem; margin: 0; }
.reg-foot .lang-field label { margin: 0; font-size: .8rem; color: var(--muted); }
.reg-foot .lang-field select { height: 2rem; padding: .15rem .35rem; width: 9.5rem; }
.reg-foot .foot-sep { width: 1px; height: 1.4rem; background: var(--border, #DCE2E6); }
.reg-foot .consent { display: flex; align-items: center; gap: .2rem; }
.reg-foot .print-link { display: inline-flex; align-items: center; color: var(--brand, #0F766E); padding: .15rem .25rem; border-radius: 4px; border: 1px solid transparent; }
.reg-foot .print-link:hover { border-color: var(--brand, #0F766E); }
.reg-foot .print-link:hover { background: var(--bg, #F3F5F7); }
.reg-grid .abha-row { display: flex; }
.reg-grid .abha-row input { flex: 1 1 auto; min-width: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.reg-grid .abha-row .btn { height: 2rem; padding: 0 .55rem; font-size: .8rem; border-top-left-radius: 0; border-bottom-left-radius: 0; margin: 0; }
.reg-grid .abha-create { height: 2rem; width: 100%; padding: 0 .3rem; font-size: .8rem; white-space: nowrap; }
.abha-dialog { border: 1px solid var(--border, #DCE2E6); border-radius: 10px; max-width: 30rem; padding: 1rem 1.2rem; }
.abha-dialog::backdrop { background: rgba(11, 70, 61, .35); }
.abha-dialog h2 { margin: 0 0 .5rem; font-size: 1.05rem; }
.abha-dialog .right { text-align: right; margin-top: .6rem; }
.reg-compact .cam-compact .cam-frame { width: 120px; height: 140px; }
.reg-compact .cam-compact .cam-frame video, .reg-compact .cam-compact .cam-frame canvas, .reg-compact .cam-compact .cam-frame img { width: 120px; height: 140px; }
.reg-compact .cam-empty { font-size: 2.4rem; }
.reg-compact .cam-btns .btn { padding: .15rem .45rem; font-size: .78rem; }
.reg-compact .cam-compact .hint:empty { display: none; }
.reg-foot { display: flex; align-items: center; gap: .5rem .9rem; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: .6rem; padding-top: .55rem; }
.reg-foot .field { margin: 0; }
.reg-foot .spacer { flex: 1; }
.reg-foot .dup-ok { font-weight: 600; color: var(--warn); display: flex; gap: .3rem; align-items: center; }
.compact-callout { padding: .5rem .8rem; margin-bottom: .5rem; font-size: .88rem; }
.compact-callout .row { margin-top: .25rem; }
@media (max-width: 1250px) {
  .reg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) 128px; }
  .reg-grid .c3, .reg-grid .c4 { grid-column: span 2; }
  .reg-grid .photo-cell { grid-column: 5; grid-row: 1 / span 4; }
}

/* ABHA card QR scan */
.reg-head { justify-content: flex-start; align-items: center; }
.reg-head > * { white-space: nowrap; }
.reg-head .scan-btn { display: inline-flex; align-items: center; gap: .35rem; }
.reg-head .scan-btn { margin-left: .8rem; }
.reg-head .scan-btn kbd { font-size: .7rem; }
.reg-head .scan-note { color: var(--brand, #0F766E); font-weight: 600; margin-left: .5rem; }
.reg-head .req-line { margin-left: auto; }
.scan-dialog { width: 34rem; }
.scan-dialog #scan-input { width: 100%; height: 2.4rem; font-size: 1rem; }
.scan-cam video { width: 100%; max-height: 16rem; background: #000; border-radius: 6px; margin-top: .5rem; }
.scan-dialog .ok { color: var(--brand, #0F766E); } .scan-dialog .bad { color: #B42318; }

/* ---------- registration page fills the whole screen (21 Nov 2026) ----------
   Boxes grow with the screen height; today's registrations use the space left under the form. */
.layout:has(.reg-page) { height: 100vh; }
.main:has(.reg-page) { display: flex; flex-direction: column; min-height: 0; }
.content.reg-page { flex: 1; min-height: 0; display: flex; flex-direction: column; padding-top: .8rem; padding-bottom: .8rem; }
.reg-page .reg-compact { flex: 0 0 auto;
  --fh: clamp(2rem, 4.1vh, 2.6rem); --ff: clamp(.9rem, 1.65vh, 1.05rem); --lf: clamp(.74rem, 1.35vh, .86rem);
  --rg: clamp(.4rem, 1.4vh, .95rem); --ph: clamp(140px, 19vh, 210px); }
.reg-page .reg-grid { row-gap: var(--rg); grid-template-columns: repeat(8, minmax(0, 1fr)) calc(var(--ph) * .86 + 8px); }
.reg-page .reg-grid .input, .reg-page .reg-grid .abha-row .btn, .reg-page .reg-grid .abha-create,
.reg-page .reg-foot .lang-field select { height: var(--fh); font-size: var(--ff); }
.reg-page .reg-grid .field label { font-size: var(--lf); }
.reg-page .reg-compact .cam-compact .cam-frame,
.reg-page .reg-compact .cam-compact .cam-frame video, .reg-page .reg-compact .cam-compact .cam-frame canvas,
.reg-page .reg-compact .cam-compact .cam-frame img { width: calc(var(--ph) * .86); height: var(--ph); }
.reg-page .reg-foot { margin-top: var(--rg); }
.reg-page .reg-foot .btn { height: calc(var(--fh) + .3rem); }
.today-card { flex: 1 1 auto; min-height: 7rem; display: flex; flex-direction: column; padding: .55rem .9rem; margin: 0; }
.today-head { display: flex; align-items: center; gap: 1rem; margin-bottom: .35rem; }
.today-head h2 { margin: 0; font-size: 1rem; }
.today-head a { margin-left: auto; }
.today-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; }
.today-table { font-size: .88rem; }
.today-table thead th { position: sticky; top: 0; background: var(--card, #fff); z-index: 1; }
.today-table td, .today-table th { padding: .3rem .5rem; white-space: nowrap; }
.today-table .row-actions a { margin-right: .6rem; text-decoration: none; }
@media (max-width: 1250px) { .reg-page .reg-grid { grid-template-columns: repeat(4, minmax(0, 1fr)) calc(var(--ph) * .86 + 8px); } }
.today-head .pill { background: #E3F1EF; color: var(--brand, #0F766E); }

/* ---------- OPD counter (21 Nov 2026) ---------- */
.counter-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(380px, 40%) 1fr; gap: .8rem; }
.counter-left { display: flex; flex-direction: column; gap: .6rem; min-height: 0; }
.counter-left .card { margin: 0; }
.counter-search { display: flex; gap: .4rem; padding: .55rem; }
.counter-search .input { flex: 1; height: 2.4rem; font-size: 1rem; }
.counter-results { padding: .5rem .6rem; max-height: 45vh; overflow: auto; }
.result-row { display: flex; flex-direction: column; gap: .1rem; padding: .4rem .55rem; border-radius: 6px;
  border: 1px solid var(--line); margin-bottom: .3rem; text-decoration: none; color: inherit; }
.result-row:hover, .result-row:focus { border-color: var(--brand); background: #F0F8F6; outline: none; }
.pcard-counter { display: flex; gap: .7rem; padding: .6rem; }
.pc-photo { width: 76px; height: 92px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); flex: 0 0 auto; }
.pc-empty { display: flex; align-items: center; justify-content: center; font-size: 2rem; background: var(--bg); }
.pc-body { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.pc-name { font-size: 1.05rem; font-weight: 700; }
.pc-tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.pc-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: .1rem; }
.warn-text { color: var(--warn); font-weight: 600; }
.counter-queue { flex: 1; min-height: 6rem; display: flex; flex-direction: column; padding: .5rem .7rem; }
.cq-head { display: flex; gap: .5rem; align-items: center; margin-bottom: .3rem; }
.cq-head a { margin-left: auto; } .cq-head .pill { background: #E3F1EF; color: var(--brand); }
.cq-scroll { flex: 1; min-height: 0; overflow: auto; }
.counter-right { margin: 0; padding: .7rem .9rem; overflow: auto; min-height: 0; }
.step-label { font-weight: 700; color: var(--nav, #0B463D); margin: .2rem 0 .35rem; }
.step-label + .chips, .step-label + .doc-cards { margin-bottom: .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { border: 1px solid var(--line); border-radius: 99px; padding: .3rem .8rem; cursor: pointer; user-select: none; background: #fff; }
.chip input, .doc-card input, .seg input { position: absolute; opacity: 0; pointer-events: none; }
.chip:has(input:checked) { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip:has(input:focus-visible), .doc-card:has(input:focus-visible), .seg label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.doc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: .45rem; }
.doc-card { position: relative; display: flex; flex-direction: column; gap: .1rem; border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem .65rem; cursor: pointer; background: #fff; }
.doc-card[hidden] { display: none; }
.doc-card:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand) inset; background: #F0F8F6; }
.dc-name { font-weight: 700; } .dc-fee { font-weight: 600; color: var(--brand); }
.doc-cards.board .doc-card { cursor: default; }
.visit-row { display: flex; align-items: center; gap: .8rem; margin-bottom: .45rem; }
.seg { display: inline-flex; border: 1px solid var(--brand); border-radius: 8px; overflow: hidden; }
.seg label { position: relative; padding: .35rem 1rem; cursor: pointer; }
.seg label:has(input:checked) { background: var(--brand); color: #fff; }
.kind-note { color: var(--brand); font-weight: 600; }
.visit-fields { display: grid; grid-template-columns: 1fr 1.3fr 1.3fr .8fr; gap: .4rem .6rem; }
.visit-fields .field { margin: 0; }
.counter-foot { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; border-top: 1px solid var(--line); padding-top: .6rem; }
.counter-foot .field { margin: 0; } .counter-foot .spacer { flex: 1; }
@media (max-width: 1100px) { .counter-grid { grid-template-columns: 1fr; } .visit-fields { grid-template-columns: 1fr 1fr; } }
.reg-head .lock-note { color: var(--warn); font-weight: 600; margin-left: .5rem; }
.reg-grid .input:disabled { background: #F2F4F7; color: #475467; cursor: not-allowed; }
.result-row .r1 { display: flex; gap: .35rem; align-items: baseline; flex-wrap: wrap; } .result-row .r-uhid { margin-left: auto; }

/* ---------- doctors today (21 Nov 2026) ---------- */
.dstat { display: inline-block; padding: .12rem .55rem; border-radius: 99px; font-size: .8rem; font-weight: 600; background: #EEF1F4; color: #475467; }
.dstat.ok { background: #D1FADF; color: #067647; } .dstat.warn { background: #FEF0C7; color: #B54708; }
.dstat.bad { background: #FEE4E2; color: #B42318; } .dstat.idle { background: #EEF1F4; color: #475467; }
.status-btns { display: flex; flex-wrap: wrap; gap: .25rem; align-items: center; }
.status-btns .btn { padding: .15rem .45rem; font-size: .75rem; }
.small-input { height: 1.8rem; font-size: .8rem; width: 9rem; padding: .1rem .4rem; }
.doctors-today tr.row-warn td { background: #FFFBF5; }
.nowrap { white-space: nowrap; }
.tt-table .input { padding: .2rem .35rem; height: 2rem; }
.quick-session .fields { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.doc-card.dc-warn { border-color: #F04438; background: #FFF6F5; }
.dc-stat { margin-top: .1rem; }
.dc-warn-text { color: #B42318; font-weight: 600; }
.tt-grid { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.tt-grid .card { margin: 0; }
.tt-table { table-layout: fixed; width: 100%; }
.tt-table .input { width: 100%; min-width: 0; }
.tt-table td { padding: .25rem .3rem; }
.quick-session .field.wide ul, .quick-session ul { display: flex; flex-wrap: wrap; gap: .3rem 1rem; list-style: none; padding: 0; margin: 0; }
@media (max-width: 1100px) { .tt-grid { grid-template-columns: 1fr; } }
#id_q-days { display: flex; flex-wrap: wrap; gap: .3rem 1rem; }
#id_q-days > div { display: flex; }
.tt-table input[type=time] { padding: .2rem .25rem; font-size: .85rem; }
.tt-table th { font-size: .72rem; }

/* ---------- appointments (21 Nov 2026) ---------- */
.appt-grid { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(380px, 36%) 1fr; gap: .8rem; }
.appt-book { margin: 0; overflow: auto; padding: .7rem .9rem; }
.appt-book h2 { margin: 0 0 .4rem; font-size: 1.05rem; }
.appt-book .field { margin-bottom: .45rem; }
.appt-book .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .6rem; }
.appt-book .joined-row { display: flex; } .appt-book .joined-row select { flex: 0 0 4.7rem; width: 4.7rem; border-radius: 6px 0 0 6px; border-right: 0; padding: .2rem .15rem; }
.appt-book .joined-row input { flex: 1; min-width: 0; border-radius: 0 6px 6px 0; }
.appt-chosen { display: flex; gap: .5rem; align-items: center; margin-top: .3rem; padding: .35rem .5rem; background: #F0F8F6; border: 1px solid var(--brand); border-radius: 6px; }
.appt-chosen[hidden], .new-person[hidden] { display: none; }
.slot-grid { display: flex; flex-wrap: wrap; gap: .3rem; margin: .2rem 0 .6rem; }
.slot { border: 1px solid var(--brand); color: var(--brand); background: #fff; border-radius: 6px; padding: .2rem .45rem; font: 600 .82rem/1.2 inherit; cursor: pointer; }
.slot.full { border-color: #D0D5DD; color: #98A2B3; background: #F9FAFB; }
.slot.on { background: var(--brand); color: #fff; }
.appt-list { margin: 0; display: flex; flex-direction: column; min-height: 0; padding: .6rem .8rem; }
.appt-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-bottom: .4rem; }
.appt-head .input { height: 2.1rem; }
.appt-counts { margin-left: auto; }
.appt-table tr.row-off td { color: #98A2B3; }
.inline-menu { display: inline-block; position: relative; }
.inline-menu summary { cursor: pointer; color: var(--brand); list-style: none; display: inline; }
.inline-menu[open] form { position: absolute; right: 0; z-index: 5; background: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: .5rem; display: flex; gap: .3rem; box-shadow: 0 6px 18px rgba(16,24,40,.12); white-space: nowrap; }
@media (max-width: 1100px) { .appt-grid { grid-template-columns: 1fr; } }
.appt-banner { background: #EFF8FF; border: 1px solid #B2DDFF; color: #175CD3; border-radius: 8px; padding: .4rem .7rem; margin-bottom: .5rem; font-size: .9rem; }
.counter-foot .prio { display: flex; align-items: center; gap: .3rem; font-weight: 600; color: #B42318; }
.appt-filter { display: flex; gap: .4rem; align-items: center; }
.appt-filter input { width: 10.5rem; } .appt-filter select { width: 13rem; }
.appt-list .cq-scroll { overflow: auto; }
.appt-table td { white-space: normal; vertical-align: top; }
.appt-table .row-actions { white-space: nowrap; }
.appt-table td:nth-child(2) { min-width: 15rem; }
.counter-foot .btn { white-space: nowrap; }

/* ---------- OPD counter v2: search in the top bar, tabs, week timetable (21 Nov 2026) ---------- */
.counter-top { display: flex; gap: .45rem; flex: 1; max-width: 980px; }
.counter-top .input { flex: 1; height: 2.4rem; font-size: 1rem; }
.counter-top .btn { white-space: nowrap; }
.counter-top .btn.on { background: var(--brand); color: #fff; }
.result-row { flex-direction: row !important; align-items: center; gap: .6rem; }
.result-row .r-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .1rem; text-decoration: none; color: inherit; }
.result-row .r-acts { display: flex; gap: .3rem; white-space: nowrap; }
.tabs-head { display: flex; align-items: center; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: .4rem; }
.tabs-head .tab { border: 0; background: none; padding: .35rem .6rem; font: 600 .9rem/1.2 inherit; color: var(--muted); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs-head .tab.on { color: var(--nav, #0B463D); border-bottom-color: var(--brand); }
.tabs-head .tab .pill { background: #E3F1EF; color: var(--brand); }
.tabs-head a { margin-left: auto; }
.tabs-head a[hidden] { display: none; }
[data-tab-panel][hidden] { display: none !important; }
.right-tabs { margin: -.2rem 0 .6rem; }
.appt-book.in-counter { padding: 0; }
.appt-book.in-counter .new-person .two { grid-template-columns: 1fr 1fr; }
.right-head { display: flex; align-items: baseline; gap: .8rem; margin-bottom: .45rem; }
.right-head h2 { margin: 0; font-size: 1.02rem; }
.right-head a, .right-head > span { margin-left: auto; }
.week-table { font-size: .84rem; table-layout: fixed; width: 100%; }
.week-table th:first-child, .week-table td:first-child { width: 22%; }
.week-table td, .week-table th { padding: .35rem .4rem; text-align: center; vertical-align: top; }
.week-table td:first-child, .week-table th:first-child { text-align: left; }
.week-table td.wk.opd { background: #ECFDF3; color: #067647; font-weight: 600; }
.week-table td.wk.leave { background: #FEE4E2; color: #B42318; font-weight: 700; }
.week-table td.wk.off { color: #98A2B3; }
.week-table .wk-today { box-shadow: inset 0 0 0 2px var(--brand); }
.week-table .dstat { font-size: .7rem; margin-top: .15rem; }
.wk-key { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; vertical-align: -1px; }
.wk-key.opd { background: #ECFDF3; border: 1px solid #067647; } .wk-key.leave { background: #FEE4E2; border: 1px solid #B42318; }
.counter-queue [data-tab-panel="appts"] .today-table td { white-space: normal; }
.counter-queue [data-tab-panel="appts"] .today-table td:last-child { width: 1%; white-space: nowrap; }
.week-table a.wk-link { color: inherit; text-decoration: none; display: block; border-radius: 4px; }
.week-table a.wk-link:hover { text-decoration: underline; }
.week-table td.wk.opd:hover { background: #D1FADF; cursor: pointer; }
.week-table td.wk.opd { padding: 0; }
.week-table td.wk.opd a.wk-link { padding: .35rem .4rem; min-height: 2.4rem; }
/* ---------- OPD queue with doctors' availability (21 Nov 2026) ---------- */
.queue-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: .8rem; align-items: start; }
.queue-grid > .card { margin: 0; }
.queue-table td, .queue-table th { padding: .4rem .45rem; }
.queue-table tr.row-prio td { background: #FFF6F5; }
.queue-side { padding: .7rem .8rem; }
.qs-doc { border: 1px solid var(--line); border-radius: 8px; padding: .45rem .6rem; margin-bottom: .45rem; display: flex; flex-direction: column; gap: .1rem; }
.qs-top { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
@media (max-width: 1420px) { .queue-grid { grid-template-columns: 1fr !important; } .queue-side { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .45rem; } .queue-side .right-head, .queue-side > p { grid-column: 1 / -1; } .queue-side .qs-doc { margin: 0; } }
.queue-table td.num, .queue-table th { white-space: nowrap; }
.queue-table td:nth-child(3) { min-width: 12.5rem; }
@media (max-width: 1500px) { .queue-grid { grid-template-columns: minmax(0, 1fr) 260px; } }

/* ---------- ABHA wizard (ABDM M1, 21 Nov 2026) ---------- */
.abha-wizard { width: 36rem; max-width: 95vw; }
.aw-head { display: flex; align-items: center; gap: .6rem; margin-bottom: .4rem; }
.aw-head h2 { margin: 0; flex: 1; }
.aw-big { height: 2.6rem; font-size: 1.15rem; letter-spacing: .05em; }
.aw-consent { display: flex; gap: .5rem; align-items: flex-start; font-size: .82rem; line-height: 1.35; background: #F9FAFB;
  border: 1px solid var(--line); border-radius: 6px; padding: .5rem .6rem; margin: .4rem 0; }
.aw-actions { display: flex; gap: .5rem; margin-top: .6rem; }
.aw-msg { min-height: 1.2rem; margin-bottom: .3rem; }
.aw-msg.ok { color: var(--brand); } .aw-msg.bad { color: #B42318; font-weight: 600; }
.abha-wizard .two { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.aw-sugg { display: flex; flex-wrap: wrap; gap: .3rem; margin: .2rem 0 .4rem; }
.aw-addr { display: flex; align-items: center; gap: .3rem; } .aw-addr .input { flex: 1; }
.aw-via { margin-top: .4rem; }
.aw-accounts { display: flex; flex-direction: column; gap: .35rem; }
.aw-accounts .result-row { background: #fff; text-align: left; cursor: pointer; font: inherit; }
[data-flow][hidden], [data-step][hidden] { display: none !important; }
.aw-admin { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin: .6rem 0 .3rem; padding: .6rem; background: #F0FDF9; border: 1px solid var(--line); border-radius: 6px; }

/* ABHA consent (NHA text, CRT_ABHA_102) and Aadhaar masking – 21 Nov 2026 */
.aw-terms { max-height: 9.5rem; overflow-y: auto; border: 1px solid #DCE2E6; border-radius: 6px; padding: .5rem .65rem;
  font-size: .78rem; line-height: 1.4; background: #FFFFFF; margin-bottom: .4rem; }
.aw-terms p { margin: .25rem 0 0; }
.aw-decl { margin-top: .25rem; }
.aw-confirm { margin: .45rem 0 .2rem 1.1rem; display: grid; gap: .25rem; }
input.masked { -webkit-text-security: disc; letter-spacing: .12em; }
.abha-wizard [data-flow=create] [data-step=start] { max-height: 70vh; overflow-y: auto; padding-right: .25rem; }

/* ABHA verify / find / result screens (NHA M1 cases) – 21 Nov 2026 */
.aw-method { flex-wrap: wrap; margin-bottom: .4rem; }
.aw-rules { list-style: none; padding: 0; margin: .35rem 0 0; display: flex; flex-wrap: wrap; gap: .25rem .7rem; font-size: .74rem; color: #64748B; }
.aw-rules li::before { content: "○ "; }
.aw-rules li.ok { color: #0F766E; } .aw-rules li.ok::before { content: "✔ "; }
.aw-rules li.bad { color: #B91C1C; } .aw-rules li.bad::before { content: "✖ "; }
.aw-taken { background: #FEF3C7; color: #B45309; border-radius: 6px; padding: .45rem .6rem; margin: .4rem 0; font-size: .82rem; }
.aw-noabha { background: #FEE2E2; color: #B91C1C; border-radius: 6px; padding: .5rem .65rem; font-size: .85rem; }
.aw-pickrow { display: flex; gap: .5rem; align-items: center; cursor: pointer; }
.aw-profile { display: flex; gap: .7rem; align-items: flex-start; background: #E6F4F1; border-left: 3px solid #0F766E;
  border-radius: 6px; padding: .5rem .65rem; margin: .4rem 0; }
.aw-profile img { width: 64px; height: 80px; object-fit: cover; border-radius: 4px; border: 1px solid #DCE2E6; }
.aw-card { margin: .4rem 0; } .aw-card img { max-width: 100%; max-height: 220px; border: 1px solid #DCE2E6; border-radius: 6px; display: block; margin-bottom: .3rem; }
.aw-compare { width: 100%; border-collapse: collapse; font-size: .8rem; margin: .4rem 0; }
.aw-compare th, .aw-compare td { border: 1px solid #DCE2E6; padding: .25rem .4rem; text-align: left; vertical-align: top; }
.aw-compare thead th { color: #64748B; text-transform: uppercase; font-size: .68rem; letter-spacing: .03em; background: #F3F5F7; }
.aw-compare tr.diff td { background: #FEF3C7; }
.abha-lock { background: #F1F5F9 !important; color: #475569; cursor: not-allowed; }
