@font-face { font-family: "Hind"; src: url("../fonts/hind-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Hind"; src: url("../fonts/hind-latin-ext-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Hind"; src: url("../fonts/hind-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Hind"; src: url("../fonts/hind-latin-ext-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Hind"; src: url("../fonts/hind-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Hind"; src: url("../fonts/hind-latin-ext-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Hind"; src: url("../fonts/hind-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Hind"; src: url("../fonts/hind-latin-ext-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --wall: #F6F5F1; --plate: #FFFFFF; --ink: #1E2629; --ink-2: #4A5559; --rule: #D5D3CB; --rule-2: #E7E5DE; --edge: #7D8789;
  --sign: #1F4E6B; --sign-2: #173B52; --sign-tint: #E3ECF1;
  --ok: #2D6A3E; --ok-tint: #E2EFE4; --wait: #8A5A00; --wait-tint: #F7EDD8; --stop: #A33A2A; --stop-tint: #F6E3DF; --occ: #8C979A;
  --font: "Hind", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --r: 4px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--wall); color: var(--ink); font: 400 16px/1.5 var(--font); font-variant-numeric: lining-nums tabular-nums; }
.grid .num, .chart .tick, .wait, .next-t, .case-t, .tok, .ward-count, .list-count { font-variant-numeric: tabular-nums lining-nums; }
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 600; }
h1 { font-size: 28px; letter-spacing: -0.01em; }
h2 { font-size: 18px; }
h3 { font-size: 15px; margin: 18px 0 8px; }
p { margin: 0; }
a { color: var(--sign); text-underline-offset: 2px; }
a:hover { color: var(--sign-2); }
:focus-visible { outline: 3px solid var(--sign); outline-offset: 2px; border-radius: 2px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--sign); color: #fff; padding: 10px 14px; z-index: 50; }
.skip:focus { top: 8px; }
.muted { color: var(--ink-2); }
.uhid { color: var(--ink-2); font-size: 0.92em; letter-spacing: 0.01em; }
.is-stop { color: var(--stop); font-weight: 600; }
.is-wait { color: var(--wait); font-weight: 600; }

/* Bar and tabs */
.bar { display: flex; align-items: center; gap: 16px; padding: 10px 24px; background: var(--plate); border-bottom: 1px solid var(--rule); flex-wrap: wrap; }
.mark { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; margin-right: auto; }
.mark b { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
.mark span { color: var(--ink-2); border-left: 1px solid var(--rule); padding-left: 10px; font-size: 15px; }
.mark-icon { width: 26px; height: 26px; fill: none; stroke: var(--sign); stroke-width: 2; stroke-linecap: round; }
.bar-tools { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.clock { font-size: 14px; color: var(--ink-2); white-space: nowrap; }
.user-name { font-size: 14px; font-weight: 600; white-space: nowrap; }
.clock b { color: var(--ink); font-weight: 600; }
.clock .who-m { display: none; }
.tabs { background: var(--plate); border-bottom: 1px solid var(--rule); padding: 0 24px; overflow-x: auto; scrollbar-width: none; }
.tabs ul { display: flex; gap: 4px; margin: 0; padding: 0; list-style: none; }
.tabs a { display: block; padding: 12px 14px 11px; color: var(--ink-2); text-decoration: none; font-weight: 500; border-bottom: 3px solid transparent; white-space: nowrap; min-height: 44px; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--sign); border-bottom-color: var(--sign); }

/* Controls */
.btn { font: inherit; font-size: 15px; font-weight: 600; min-height: 40px; padding: 8px 14px; border: 1px solid var(--edge); border-radius: var(--r); background: var(--plate); color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; line-height: 1.2; }
.btn:hover { background: var(--wall); color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn-sm { min-height: 36px; padding: 6px 11px; font-size: 14px; }
.btn-primary { background: var(--sign); border-color: var(--sign); color: #fff; }
.btn-primary:hover { background: var(--sign-2); color: #fff; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--rule-2); }
.btn-link { border: 0; background: none; color: var(--sign); text-decoration: underline; text-underline-offset: 2px; padding: 6px 4px; min-height: 36px; font-weight: 500; }
.btn-link:hover { background: none; color: var(--sign-2); }
.btn-tab { border-color: var(--rule); background: var(--plate); color: var(--ink-2); font-weight: 500; }
.btn-tab[aria-pressed="true"] { border-color: var(--sign); background: var(--sign-tint); color: var(--sign-2); }
.btn-tab .n { color: var(--ink-2); font-weight: 500; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.field-inline { flex-direction: row; align-items: center; gap: 8px; }
.field-label { color: var(--ink-2); font-weight: 500; }
select, input[type="search"], input[type="text"], textarea { font: inherit; font-size: 15px; color: var(--ink); background: var(--plate); border: 1px solid var(--edge); border-radius: var(--r); min-height: 40px; padding: 7px 10px; max-width: 100%; }
select { padding-right: 28px; }
textarea { width: 100%; resize: vertical; }
input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--sign); margin: 0; }
.check { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; font-size: 15px; cursor: pointer; }
.field-error { color: var(--stop); font-size: 14px; min-height: 1em; }

/* Page */
main { display: block; outline: none; }
.page { padding: 24px; max-width: 1640px; margin: 0 auto; }
.page-head { display: flex; gap: 24px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { max-width: 820px; }
.standfirst { margin-top: 6px; color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.page-tools, .filters-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.panel { background: var(--plate); border: 1px solid var(--rule); border-radius: var(--r); padding: 16px 18px; }
.panel > h2 { margin-bottom: 10px; display: flex; align-items: baseline; gap: 10px; }
.panel-flush { padding: 0; overflow: hidden; }
.count { font-size: 14px; font-weight: 600; color: var(--ink-2); background: var(--wall); border: 1px solid var(--rule); border-radius: 20px; padding: 0 9px; }
.section-title { margin: 32px 0 12px; font-size: 20px; }
.empty, .refused { background: var(--plate); border: 1px dashed var(--edge); border-radius: var(--r); padding: 28px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.refused { border-style: solid; border-left: 4px solid var(--wait); max-width: 720px; margin-bottom: 16px; }
.pill { display: inline-block; font-size: 13px; font-weight: 600; padding: 1px 8px; border-radius: 3px; border: 1px solid; white-space: nowrap; }
.pill-ok, .pill-ready, .pill-done { color: var(--ok); border-color: #A9C7B0; background: var(--ok-tint); }
.pill-wait, .pill-cleaning { color: var(--wait); border-color: #DCC28E; background: var(--wait-tint); }
.pill-stop, .pill-blocked { color: var(--stop); border-color: #DDADA4; background: var(--stop-tint); }
.pill-sign, .pill-inroom, .pill-reserved { color: var(--sign-2); border-color: #A9C1D0; background: var(--sign-tint); }
.pill-plain, .pill-scheduled, .pill-occupied { color: var(--ink-2); border-color: var(--rule); background: var(--wall); }
.callout { padding: 10px 12px; border-radius: var(--r); border-left: 4px solid; margin: 12px 0; }
.callout-wait { border-color: var(--wait); background: var(--wait-tint); }
.callout-stop { border-color: var(--stop); background: var(--stop-tint); }

/* Tables */
.tablewrap { overflow-x: auto; max-width: 100%; }
.tablewrap:focus-visible { outline-offset: -3px; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; background: var(--plate); }
.grid th, .grid td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
.grid thead th { font-size: 13px; font-weight: 600; color: var(--ink-2); border-bottom: 1px solid var(--rule); white-space: nowrap; background: var(--plate); position: sticky; top: 0; }
.grid tbody th { font-weight: 500; }
.grid .num { text-align: right; white-space: nowrap; }
.grid tbody tr:hover { background: #FAFAF7; }
.grid tr.is-selected { background: var(--sign-tint); }
.grid tr.total th, .grid tr.total td { border-top: 1px solid var(--ink); font-weight: 600; border-bottom: 0; }
.grid-compact th, .grid-compact td { padding: 7px 8px; }
.grid tr.is-mine { box-shadow: inset 3px 0 var(--sign); }
.sort { font: inherit; font-weight: inherit; color: inherit; background: none; border: 0; padding: 4px 0; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.num .sort { flex-direction: row-reverse; }
.sort:hover { color: var(--ink); }
.sort-mark { width: 10px; color: var(--sign); }
.rowlink { white-space: nowrap; font: inherit; color: var(--sign); background: none; border: 0; padding: 4px 0; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: #A9C1D0; text-underline-offset: 3px; }
.rowlink:hover { text-decoration-color: currentColor; }
.col-check { width: 36px; }
.gap { color: var(--stop); }

/* List tools */
.list { display: flex; flex-direction: column; gap: 10px; }
.list-tools { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.field-search input { width: 280px; }
.list-actions { margin-left: auto; display: flex; gap: 8px; }
.views { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.views-label { font-size: 14px; color: var(--ink-2); font-weight: 500; margin-right: 4px; }
.view { display: inline-flex; align-items: center; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 2px; background: var(--sign-tint); color: var(--sign-2); border-radius: 3px; padding: 0 0 0 10px; font-size: 14px; font-weight: 500; }
.chip-x { font: inherit; font-size: 18px; line-height: 1; border: 0; background: none; color: inherit; cursor: pointer; min-width: 36px; min-height: 36px; }
.bulk { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 8px 12px; background: var(--sign-tint); border-radius: var(--r); }
.list-count { font-size: 14px; color: var(--ink-2); }
.pager { display: flex; gap: 12px; align-items: center; justify-content: flex-end; font-size: 14px; }

/* Drawer, modal, toast */
.scrim { position: fixed; inset: 0; background: rgba(30, 38, 41, 0.28); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--plate); z-index: 31; display: flex; flex-direction: column; border-left: 1px solid var(--rule); outline: none; }
.drawer-wide { width: min(720px, 100vw); }
.drawer-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 18px 20px 14px; border-bottom: 1px solid var(--rule); }
.drawer-head h2 { font-size: 22px; }
.drawer-kicker { color: var(--ink-2); font-size: 14px; margin-bottom: 2px; }
.drawer-body { padding: 16px 20px 32px; overflow-y: auto; flex: 1; }
.who { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 17px; margin-bottom: 12px; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0 18px; margin: 0; font-size: 15px; }
.facts > div { display: contents; }
.facts dt { color: var(--ink-2); padding: 6px 0; border-bottom: 1px solid var(--rule-2); }
.facts dd { margin: 0; padding: 6px 0; border-bottom: 1px solid var(--rule-2); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 18px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { border-bottom: 1px solid var(--rule-2); }
.mini-log { list-style: none; padding: 0; margin: 0; font-size: 14px; color: var(--ink-2); }
.mini-log li { padding: 4px 0; }
.mini-log time { color: var(--ink); }
.pick { list-style: none; margin: 0; padding: 0; }
.pick li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--rule-2); }
.match { color: var(--ok); font-size: 14px; }
.docs { list-style: none; padding: 0; margin: 0; }
.docs li { padding: 3px 0; }
.docs .missing { color: var(--stop); font-weight: 600; }
.scrim-modal { z-index: 40; }
.modal { position: fixed; z-index: 41; left: 50%; top: 18vh; transform: translateX(-50%); width: min(460px, calc(100vw - 32px)); background: var(--plate); border-radius: var(--r); padding: 20px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--rule); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
#toasts { position: fixed; bottom: 16px; left: 16px; z-index: 45; width: min(460px, calc(100vw - 32px)); }
.toast { display: flex; gap: 12px; align-items: center; background: var(--ink); color: #fff; padding: 10px 10px 10px 16px; border-radius: var(--r); font-size: 15px; }
.toast > span { flex: 1; }
.toast .btn { background: transparent; color: #fff; border-color: #8C979A; }
.toast .btn-quiet { border-color: transparent; color: #D5D3CB; }
.toast-refused { background: #5A2A21; }
.toast-error { background: var(--stop); }

/* Demo corner */
.demo { position: relative; }
.demo-toggle { border-style: dashed; }
.demo-panel { position: absolute; right: 0; top: calc(100% + 8px); width: 280px; background: var(--plate); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 10px; z-index: 25; font-size: 14px; color: var(--ink-2); }
.demo-panel[hidden] { display: none; }
.tour { position: fixed; left: 16px; bottom: 16px; width: min(400px, calc(100vw - 32px)); background: var(--plate); border: 1px solid var(--ink); border-top: 4px solid var(--sign); border-radius: var(--r); padding: 16px; z-index: 35; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.tour h2 { font-size: 18px; }
.tour-step { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.tour-result { background: var(--ok-tint); padding: 8px 10px; border-radius: 3px; }
.tour-actions { display: flex; gap: 8px; margin-top: 4px; }

/* Skeleton */
.skel { display: grid; gap: 12px; }
.skel i { display: block; height: 18px; background: var(--rule-2); border-radius: 3px; }
.skel .t { width: 40%; height: 30px; }
.skel .b { height: 160px; }

/* Discharge strip: four marker ticks */
.strip { display: inline-flex; gap: 3px; vertical-align: middle; }
.strip i { width: 11px; height: 11px; border: 1.5px solid var(--edge); border-radius: 2px; background: var(--plate); }
.strip i.on { background: var(--ok); border-color: var(--ok); }
.strip-big i { width: 16px; height: 16px; }

/* Bed board */
.find { position: relative; }
.find-hits { position: absolute; right: 0; top: 100%; z-index: 20; list-style: none; margin: 4px 0 0; padding: 4px; background: var(--plate); border: 1px solid var(--rule); border-radius: var(--r); min-width: 300px; }
.find-hits a { display: flex; flex-direction: column; padding: 8px; text-decoration: none; border-radius: 3px; }
.find-hits a:hover { background: var(--sign-tint); }
.find-hits a span { color: var(--ink-2); font-size: 14px; }
.find-hits .muted { padding: 8px; }
.beds-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.beds-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 12px; }
.beds-main { min-width: 0; }
.ward-select { display: none; }
.wards ul { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; margin: 0 0 18px; padding: 0; list-style: none; border: 1px solid var(--rule); border-radius: var(--r); background: var(--plate); overflow: hidden; }
.wards li { border-right: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); min-width: 0; }
.wards a { display: flex; flex-direction: column; padding: 8px 14px; text-decoration: none; color: var(--ink); min-height: 44px; }
.wards a:hover { background: var(--wall); }
.wards a[aria-current] { background: var(--sign); color: #fff; }
.ward-name { font-weight: 600; font-size: 14px; }
.ward-count { font-size: 13px; color: var(--ink-2); }
.wards a[aria-current] .ward-count { color: #D3E1EA; }
.plan-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.plan-head h2 { font-size: 22px; }
.show { display: flex; gap: 6px; flex-wrap: wrap; }
.swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.sw-all { background: var(--occ); } .sw-ready { background: var(--ok); } .sw-cleaning { background: var(--wait); } .sw-reserved { border: 2px dashed var(--sign); } .sw-blocked { background: repeating-linear-gradient(45deg, var(--edge) 0 2px, transparent 2px 4px); border: 1px solid var(--edge); } .sw-home { background: var(--sign); }
.plan { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.bay { border: 2px solid var(--ink-2); border-radius: 2px; background: #FBFBF8; padding: 10px; }
.bay h3 { margin: 0 0 8px; font-size: 14px; display: flex; justify-content: space-between; color: var(--ink); }
.bay h3 span { color: var(--ink-2); font-weight: 500; }
.bay ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.bay li { min-width: 0; }
.bay-rooms { grid-column: 1 / -1; }
.bay-rooms ul { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.plate { display: flex; flex-direction: column; gap: 4px; min-height: 84px; padding: 8px 10px 8px 12px; background: var(--plate); border: 1px solid var(--rule); border-left: 5px solid var(--occ); border-radius: 3px; color: var(--ink); text-decoration: none; position: relative; }
.plate:hover { border-color: var(--edge); border-left-color: inherit; background: #FDFDFB; color: var(--ink); }
.plate-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.bedno { font-size: 20px; font-weight: 700; letter-spacing: 0.01em; }
.plate-status { font-size: 13px; font-weight: 600; color: var(--ink-2); text-align: right; }
.plate-who { display: flex; flex-direction: column; font-size: 14px; line-height: 1.3; }
.plate-who .ini { font-weight: 600; }
.plate-who .svc { color: var(--ink-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plate.is-occupied { border-left-color: var(--occ); }
.plate.is-ready { border-left-color: var(--ok); background: var(--ok-tint); }
.plate.is-ready .plate-status { color: var(--ok); }
.plate.is-cleaning { border-left-color: var(--wait); background: var(--wait-tint); }
.plate.is-cleaning .plate-status { color: var(--wait); }
.plate.is-reserved { border: 2px dashed var(--sign); border-left: 5px solid var(--sign); }
.plate.is-reserved .plate-status { color: var(--sign); }
.plate.is-blocked { border-left-color: var(--edge); background: repeating-linear-gradient(135deg, #F1F0EB 0 6px, #FBFBF8 6px 12px); }
.plate.is-home { border-left-color: var(--sign); }
.plate.is-home .plate-status { color: var(--sign); }
.plate .strip { margin-top: auto; }
.plate.is-dim { opacity: 0.32; }
.plan-icu .bay-rooms ul { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.queue ol { list-style: none; margin: 0; padding: 0; }
.qrow { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--rule-2); }
.qrow.is-urgent { box-shadow: inset 3px 0 var(--stop); padding-left: 10px; }
.qmain { font-size: 15px; }
.qmeta { display: block; font-size: 13px; color: var(--ink-2); }
.wait { font-size: 14px; font-weight: 600; white-space: nowrap; }
.wait-wait { color: var(--wait); } .wait-stop { color: var(--stop); }

/* Patient flow */
.flow-top { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, 1fr); gap: 20px; align-items: stretch; }
.flow-mid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.notes { border-left: 3px solid var(--sign); padding: 4px 0 4px 18px; }
.notes ul { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 16px; }
.occ { display: inline-flex; align-items: center; gap: 8px; }
.occ-bar { width: 64px; height: 8px; background: var(--rule-2); border-radius: 1px; overflow: hidden; display: inline-block; }
.occ-bar i { display: block; height: 100%; background: var(--sign); }
.occ-bar i.hot { background: var(--stop); }

/* Charts */
.chart { margin: 0; background: var(--plate); border: 1px solid var(--rule); border-radius: var(--r); padding: 14px 16px 10px; min-width: 0; }
.chart figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-weight: 600; font-size: 16px; }
.chart-body { position: relative; margin-top: 6px; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--rule-2); stroke-width: 1; }
.chart .axis { stroke: var(--edge); stroke-width: 1; }
.chart .tick { fill: var(--ink-2); font-size: 12px; font-family: var(--font); }
.chart .row-label { fill: var(--ink); font-size: 13px; font-family: var(--font); }
.chart .hit { fill: transparent; }
.chart .col:hover .hit, .chart .col:focus .hit { fill: var(--sign-tint); }
.chart .col:focus { outline: none; }
.chart .col:focus-visible .hit { stroke: var(--sign); stroke-width: 2; }
.bar.s-adm { fill: var(--sign); } .bar.s-dis { fill: #7FA4BC; }
.bar.a0 { fill: #9DB8CA; } .bar.a1 { fill: #4F7F9E; } .bar.a2 { fill: var(--wait); } .bar.a3 { fill: var(--stop); }
.cmp-line { fill: none; stroke: var(--ink); stroke-width: 1.5; stroke-dasharray: 4 3; pointer-events: none; }
.marker { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; }
.marker-label { fill: var(--ink); font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--ink-2); margin: 6px 0 0; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 12px; height: 12px; display: inline-block; border-radius: 2px; }
.key.s-adm { background: var(--sign); } .key.s-dis { background: #7FA4BC; } .key-line { height: 0; border-top: 2px dashed var(--ink); width: 16px; border-radius: 0; }
.key.a0 { background: #9DB8CA; } .key.a1 { background: #4F7F9E; } .key.a2 { background: var(--wait); } .key.a3 { background: var(--stop); }
.tip { position: absolute; top: 0; z-index: 5; background: var(--ink); color: #fff; padding: 8px 10px; border-radius: 3px; font-size: 13px; display: flex; flex-direction: column; gap: 2px; pointer-events: none; min-width: 160px; }
.tip[hidden] { display: none; }
.tip-row { display: flex; align-items: center; gap: 6px; }
.tip .key-line { border-color: #fff; }

/* Theatres */
.alerts { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.alert { padding: 10px 14px; border-left: 4px solid; border-radius: 3px; background: var(--plate); font-size: 15px; }
.alert-stop { border-color: var(--stop); background: var(--stop-tint); }
.alert-wait { border-color: var(--wait); background: var(--wait-tint); }
.ot-legend { padding: 12px 16px; border-bottom: 1px solid var(--rule); margin: 0; }
.k-done { background: #C9D3D7; } .k-inroom { background: var(--sign); } .k-sched { background: var(--plate); border: 1.5px solid var(--sign); } .k-late { background: var(--plate); border: 1.5px solid var(--wait); border-left-width: 4px; } .k-over { background: var(--stop); } .k-ghost { border: 1.5px dashed var(--edge); }
.otgrid { overflow-x: auto; }
.ot-scale, .ot-row { display: grid; grid-template-columns: 110px minmax(1100px, 1fr); }
.ot-scale { border-bottom: 1px solid var(--rule); height: 30px; }
.ot-room { padding: 10px 14px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; justify-content: center; background: var(--plate); position: sticky; left: 0; z-index: 3; }
.ot-room b { font-size: 16px; }
.ot-room span { font-size: 13px; color: var(--ink-2); }
.ot-track { position: relative; }
.ot-row { border-bottom: 1px solid var(--rule-2); min-height: 74px; }
.ot-scale .hr { position: absolute; top: 7px; font-size: 12px; color: var(--ink-2); transform: translateX(-50%); }
.gl { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule-2); }
.sess-end { position: absolute; top: 0; bottom: 0; width: 0; border-left: 2px dotted var(--edge); }
.now-line { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--stop); z-index: 2; }
.plan-ghost { position: absolute; top: 6px; bottom: 6px; border: 1px dashed #B7C2C6; border-radius: 3px; }
.case { position: absolute; top: 10px; bottom: 10px; border-radius: 3px; padding: 4px 6px; overflow: hidden; display: flex; flex-direction: column; font-size: 12px; line-height: 1.25; text-decoration: none; color: var(--ink); background: var(--plate); border: 1.5px solid var(--sign); z-index: 1; min-width: 6px; }
.case:hover { z-index: 4; min-width: max-content; box-shadow: 0 2px 0 rgba(0,0,0,0.08); color: var(--ink); }
.case:focus-visible { z-index: 4; min-width: max-content; }
.case span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.case-t { font-weight: 700; }
.case-p { font-weight: 600; }
.case-w { color: var(--ink-2); }
.case.is-done { background: #E4E9EB; border-color: #B7C2C6; color: var(--ink-2); }
.case.is-inroom { background: var(--sign); border-color: var(--sign); color: #fff; }
.case.is-inroom .case-w { color: #D3E1EA; }
.case.is-late { border-color: var(--wait); border-left-width: 5px; background: var(--wait-tint); }
.case.is-over { background: var(--stop); border-color: var(--stop); color: #fff; }
.cancelled-list { list-style: none; margin: 12px 0 0; padding: 0; font-size: 14px; color: var(--ink-2); }
.cancelled-list a { color: var(--ink-2); }
.ot-bottom { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; margin-top: 20px; align-items: start; }
.next-list { list-style: none; margin: 0; padding: 0; }
.next-list a { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 9px 4px; border-bottom: 1px solid var(--rule-2); color: var(--ink); text-decoration: none; min-height: 44px; }
.next-list a:hover { background: var(--wall); }
.next-t { font-weight: 700; }

/* Clinics */
.queues { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; align-items: start; }
.queue-col { background: var(--plate); border: 1px solid var(--rule); border-top: 4px solid var(--sign); border-radius: var(--r); display: flex; flex-direction: column; }
.queue-col.q-wait { border-top-color: var(--wait); }
.queue-col.q-stop { border-top-color: var(--stop); }
.tok-who { display: flex; flex-direction: column; line-height: 1.25; padding: 4px 0; }
.tok-who .muted { font-size: 13px; }
.queue-col header { padding: 12px 14px 8px; }
.queue-col h2 { font-size: 17px; }
.queue-col header .muted { font-size: 14px; }
.late { color: var(--wait); font-weight: 600; font-size: 14px; margin-top: 2px; }
.serving { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 10px 14px; background: var(--wall); border-top: 1px solid var(--rule-2); border-bottom: 1px solid var(--rule-2); }
.serving-label { grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); font-weight: 600; }
.token { font-size: 34px; font-weight: 700; line-height: 1.1; color: var(--sign); }
.token-none { font-size: 20px; color: var(--ink-2); }
.serving .muted { font-size: 14px; }
.qline { display: flex; gap: 12px; flex-wrap: wrap; padding: 8px 14px; font-size: 14px; color: var(--ink-2); }
.qline b { color: var(--ink); }
.tokens { list-style: none; margin: 0; padding: 0 14px; }
.tokens li { display: grid; grid-template-columns: 34px 1fr auto auto; gap: 8px; align-items: center; border-bottom: 1px solid var(--rule-2); font-size: 14px; min-height: 44px; }
.tokens .tok { font-size: 16px; }
.tokens .more { display: block; padding: 10px 0; border: 0; }
.empty-q { padding: 12px 14px; font-size: 14px; }
.queue-col footer { display: flex; gap: 8px; align-items: center; padding: 10px 14px 12px; margin-top: auto; flex-wrap: wrap; }
.clear { font-size: 13px; margin-left: auto; }

/* Insurance */
.ins-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); gap: 20px; margin-bottom: 20px; align-items: start; }
.desk table { font-size: 15px; }
.stage-tabs ul { display: flex; gap: 0; list-style: none; margin: 0 0 14px; padding: 0; border-bottom: 1px solid var(--rule); overflow-x: auto; }
.stage-tabs a { display: flex; gap: 6px; align-items: baseline; padding: 10px 12px; color: var(--ink-2); text-decoration: none; border-bottom: 3px solid transparent; white-space: nowrap; font-weight: 500; font-size: 15px; min-height: 44px; }
.stage-tabs a[aria-current] { color: var(--sign); border-bottom-color: var(--sign); }
.stage-tabs .n { font-size: 13px; color: var(--ink-2); }

@media (max-width: 1180px) {
  .beds-layout { grid-template-columns: minmax(0, 1fr); }
  .beds-side { position: static; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .flow-top, .flow-mid, .ins-top, .ot-bottom { grid-template-columns: minmax(0, 1fr); }
  .panel, .chart { min-width: 0; }
}
@media (max-width: 760px) {
  body { font-size: 16px; }
  .bar { padding: 10px 16px; gap: 10px; }
  .mark span { display: none; }
  .mark { flex: 1; min-height: 44px; }
  .demo-toggle { min-height: 40px; }
  .tabs ul { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
  .tabs a { padding: 10px 6px 9px; text-align: center; font-size: 15px; }
  .grid th a, .grid td a { display: inline-flex; align-items: center; min-height: 44px; }
  .rowlink { min-height: 44px; }
  .user-name { display: none; }
  .bar-tools { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: 8px; }
  .bar-tools .field-inline .field-label { display: none; }
  .bar-tools .field, .bar-tools select { width: 100%; min-height: 44px; }
  .bar-tools .demo { position: absolute; top: 10px; right: 16px; }
  .bar { position: relative; }
  .clock { grid-column: 1 / -1; order: 5; font-size: 13px; }
  .clock .who-m { display: inline; }
  .wards { display: none; }
  .ward-select { display: flex; margin-bottom: 14px; }
  .ward-select select { width: 100%; }
  .tabs { padding: 0 8px; }
  .page { padding: 16px; }
  h1 { font-size: 24px; }
  .standfirst { font-size: 15px; }
  .beds-side { grid-template-columns: minmax(0, 1fr); }
  .plan { grid-template-columns: 1fr; }
  .bay-rooms ul { grid-template-columns: 1fr 1fr; }
  .field-search input { width: 100%; }
  .field-search, .list-tools .field-filter { flex: 1 1 100%; }
  .list-tools .field-filter select { width: 100%; }
  .list-actions { margin-left: 0; }
  .btn, .btn-sm, select, input[type="search"] { min-height: 44px; }
  .find-hits { left: 0; right: auto; min-width: 0; width: 100%; }
  .find, .find .field-search { width: 100%; }
  .ot-scale, .ot-row { grid-template-columns: 76px minmax(900px, 1fr); }
  .ot-room { padding: 8px; }
  .drawer-head h2 { font-size: 20px; }
  .facts { grid-template-columns: 1fr; }
  .facts dt { border-bottom: 0; padding-bottom: 0; font-size: 13px; }
  .tour { left: 8px; bottom: 8px; width: calc(100vw - 16px); padding: 10px 12px; gap: 4px; font-size: 14px; line-height: 1.35; }
  .tour h2 { font-size: 16px; }
  .tour-result { padding: 6px 8px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
.case.is-short .case-w { display: none; }
.ot-scale .hr-first { transform: translateX(4px); }
.touring #toasts { top: calc(76px + var(--concept-bar)); bottom: auto; left: 16px; width: min(420px, calc(100vw - 32px)); }
