/* Pulsi – Clinic Admin · plain CSS, no build step.
   Look: calm mint and teal on a soft gradient, floating rounded panels, a side panel that stands free on the canvas.
   Sections: fonts · tokens · base · canvas + side · top bar · menus · blister switch · layout · today · schedule ·
   patients · lab · billing · staff · settings · forms · overlays · login · responsive · print */

/* fonts (SIL Open Font License, see assets/fonts/OFL.txt) */
@font-face { font-family: "Nunito Sans"; font-weight: 400; font-display: swap; src: url("../fonts/nunito-sans-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BE, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "Nunito Sans"; font-weight: 700; font-display: swap; src: url("../fonts/nunito-sans-latin-700-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+20BE, U+2122, U+2212, U+FEFF; }
@font-face { font-family: "Nunito Sans"; font-weight: 400; font-display: swap; src: url("../fonts/nunito-sans-latin-ext-400-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito Sans"; font-weight: 700; font-display: swap; src: url("../fonts/nunito-sans-latin-ext-700-normal.woff2") format("woff2"); unicode-range: U+0100-02AF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Nunito Sans"; font-weight: 400; font-display: swap; src: url("../fonts/nunito-sans-cyrillic-400-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Nunito Sans"; font-weight: 700; font-display: swap; src: url("../fonts/nunito-sans-cyrillic-700-normal.woff2") format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 400; font-display: swap; src: url("../fonts/noto-sans-georgian-georgian-400-normal.woff2") format("woff2"); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+2D00-2D2F; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 600; font-display: swap; src: url("../fonts/noto-sans-georgian-georgian-600-normal.woff2") format("woff2"); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+2D00-2D2F; }
@font-face { font-family: "Noto Sans Georgian"; font-weight: 700; font-display: swap; src: url("../fonts/noto-sans-georgian-georgian-700-normal.woff2") format("woff2"); unicode-range: U+0589, U+10A0-10FF, U+1C90-1CBA, U+1CBD-1CBF, U+2D00-2D2F; }

/* tokens */
:root {
    --font: "Nunito Sans", "Noto Sans Georgian", system-ui, sans-serif;
    --r-xl: 28px; --r: 20px; --r-s: 12px;
    --ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme="light"] {
    color-scheme: light;
    --bg-a: #e3f3f0; --bg-b: #eceffc; --panel: rgba(255, 255, 255, .78); --card: #fff; --soft: #f1f7f6; --line: #e0eae8;
    --text: #17302d; --muted: #5d716e; --faint: #94a6a3;
    --teal: #0f9d8f; --teal-soft: #dff3f0; --teal-ink: #0b7a6f; --violet: #6c7cf5; --violet-soft: #e9ebfe; --orange: #e98a35; --orange-soft: #fdf0e3; --coral: #e05d75; --coral-soft: #fde8ec; --green: #2f9e5b;
    --shadow: 0 20px 50px -28px rgba(23, 60, 56, .35), 0 2px 6px -2px rgba(23, 60, 56, .06);
}
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg-a: #0c1716; --bg-b: #111426; --panel: rgba(22, 32, 33, .82); --card: #18221f; --soft: #1e2b28; --line: #2a3936;
    --text: #e3efec; --muted: #9db2ae; --faint: #6c807c;
    --teal: #3cc4b4; --teal-soft: rgba(60, 196, 180, .14); --teal-ink: #7fe0d4; --violet: #9aa6ff; --violet-soft: rgba(154, 166, 255, .14); --orange: #f2a95f; --orange-soft: rgba(242, 169, 95, .14); --coral: #f27e93; --coral-soft: rgba(242, 126, 147, .14); --green: #5fd18f;
    --shadow: 0 20px 50px -24px rgba(0, 0, 0, .7);
}

/* base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.i18n-wait body { visibility: hidden; }
body { margin: 0; min-height: 100vh; font: 400 15.5px/1.55 var(--font); color: var(--text); background: linear-gradient(135deg, var(--bg-a), var(--bg-b)) fixed; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.flag { stroke: none; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 12px; background: var(--teal); color: #fff; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--teal) 55%, transparent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* canvas + side panel */
.canvas { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 18px; min-height: 100vh; padding: 18px; }
.side { position: sticky; top: 18px; display: flex; flex-direction: column; gap: 22px; height: calc(100vh - 36px); padding: 22px 16px; border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(140deg, var(--teal), #3fc7b3); color: #fff; box-shadow: 0 10px 20px -10px var(--teal); }
.brand-mark svg { width: 26px; height: 26px; stroke-width: 2.4; }
.brand b { display: block; font-size: 20px; }
.brand small { color: var(--muted); font-size: 12.5px; }
.side-nav { display: grid; gap: 4px; }
.side-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 14px; color: var(--muted); font-weight: 700; text-decoration: none; transition: background .2s, color .2s; }
.side-nav a:hover { background: var(--soft); color: var(--text); }
.side-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--soft); transition: background .2s, color .2s; }
.side-nav a[aria-current="page"] { background: var(--teal-soft); color: var(--teal-ink); }
.side-nav a[aria-current="page"] .side-ico { background: var(--teal); color: #fff; }
.side-badge { margin-left: auto; min-width: 22px; padding: 0 7px; border-radius: 11px; background: var(--coral); color: #fff; font-size: 12px; line-height: 22px; text-align: center; }
.duty { margin-top: auto; padding: 14px; border-radius: var(--r); background: var(--soft); }
.duty p { margin-bottom: 10px; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.duty ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.duty li { display: flex; align-items: center; gap: 10px; }
.duty li i { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 25%, transparent); }
.side .side-close, .side-scrim { display: none; }
.sheet { display: flex; flex-direction: column; min-width: 0; border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }

/* top bar */
.top { display: flex; align-items: center; gap: 12px; padding: 16px clamp(16px, 2.6vw, 30px); border-bottom: 1px solid var(--line); }
.menu-btn { display: none !important; }
.search { display: flex; align-items: center; gap: 10px; flex: 1; max-width: 460px; min-width: 0; padding: 10px 16px; border: 0; border-radius: 30px; background: var(--soft); color: var(--faint); text-align: left; }
.search span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { padding: 0 7px; border-radius: 6px; background: var(--card); font: 700 12px var(--font); color: var(--muted); }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 50%; background: var(--soft); color: var(--muted); }
.icon-btn:hover { color: var(--teal-ink); background: var(--teal-soft); }
.dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border: 2px solid var(--card); border-radius: 50%; background: var(--coral); }
[data-theme="dark"] .t-sun, [data-theme="light"] .t-moon { display: none; }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 14px 4px 4px; border: 0; border-radius: 30px; background: var(--soft); text-align: left; }
.me-name b { display: block; font-size: 14px; line-height: 1.2; }
.me-name small { color: var(--muted); font-size: 12px; }
.avatar { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: hsl(var(--h, 172) 55% 88%); color: hsl(var(--h, 172) 50% 28%); font-weight: 700; font-size: 13px; flex: none; }
[data-theme="dark"] .avatar { background: hsl(var(--h, 172) 35% 26%); color: hsl(var(--h, 172) 60% 82%); }
.avatar.sm { width: 30px; height: 30px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 20px; }

/* menus */
.dd { position: relative; }
.menu { position: absolute; z-index: 50; min-width: 200px; padding: 8px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow), 0 0 0 1px var(--line); animation: pop .18s var(--ease); }
.menu > a, .menu > button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 12px; border: 0; border-radius: 10px; background: none; text-align: left; text-decoration: none; }
.menu > a:hover, .menu > button:hover { background: var(--soft); }
.me-menu { right: 0; top: calc(100% + 8px); }
.me-theme { display: none !important; }
.bell-menu { right: 0; top: calc(100% + 8px); width: min(360px, calc(100vw - 28px)); padding: 0; }
.bell-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.bell-list { max-height: 360px; margin: 0; padding: 8px; list-style: none; overflow-y: auto; }
.bell-list li { display: grid; grid-template-columns: 36px 1fr; gap: 12px; padding: 10px; border-radius: 12px; font-size: 14.5px; }
.bell-list li.is-new { background: var(--teal-soft); }
.bell-list small { display: block; color: var(--muted); font-size: 12.5px; }
.bell-ico { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: var(--c, var(--teal-soft)); color: var(--ic, var(--teal-ink)); }
.bell-ico svg { width: 18px; height: 18px; }
.link { padding: 0; border: 0; background: none; color: var(--teal-ink); font-size: 13.5px; font-weight: 700; }
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }

/* language switch: capsules in a blister pack */
.pill-btn { padding: 4px; border: 0; border-radius: 30px; background: var(--soft); }
.capsule { display: inline-grid; grid-template-columns: 1fr 1fr; width: 76px; height: 34px; border-radius: 17px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06), 0 4px 10px -6px rgba(0, 0, 0, .3); }
.capsule.mini { width: 64px; height: 30px; }
.cap-flag { display: grid; overflow: hidden; }
.cap-flag .flag { width: 100%; height: 100%; transform: scale(1.4); }
.cap-half { display: grid; place-items: center; background: var(--pc, var(--teal)); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; position: relative; }
.cap-half::after { content: ""; position: absolute; left: 6px; right: 10px; top: 5px; height: 4px; border-radius: 3px; background: rgba(255, 255, 255, .35); }
.pill-btn .cap-half { background: var(--teal); }
.blister-pack { right: 0; top: calc(100% + 10px); width: 300px; padding: 16px; background: linear-gradient(160deg, #eef3f3, #dfe7e7); }
[data-theme="dark"] .blister-pack { background: linear-gradient(160deg, #26302f, #1b2423); }
.blister-head { margin: 0 0 12px 4px; color: var(--muted); font-size: 13px; font-weight: 700; }
.blister-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pill-opt { display: grid; justify-items: center; gap: 8px; padding: 14px 8px 10px; border: 0; border-radius: 22px; background: radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, .95), rgba(255, 255, 255, .55) 70%); box-shadow: inset 0 -3px 6px rgba(0, 0, 0, .06), 0 2px 6px rgba(0, 0, 0, .08); transition: transform .2s var(--ease); }
[data-theme="dark"] .pill-opt { background: radial-gradient(ellipse at 50% 30%, rgba(255, 255, 255, .14), rgba(255, 255, 255, .04) 70%); }
.pill-opt:hover { transform: translateY(-2px); }
.pill-opt:hover .capsule { transform: rotate(-8deg); }
.pill-opt .capsule { transition: transform .3s var(--ease); }
.pill-name { font-size: 13.5px; font-weight: 700; }
.pill-opt[aria-current="true"] { box-shadow: inset 0 0 0 2px var(--pc), 0 6px 14px -8px var(--pc); }

/* layout */
.main { flex: 1; width: 100%; padding: 26px clamp(16px, 2.6vw, 30px) 36px; outline: none; }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-bottom: 24px; }
.page-head h1 { font-size: clamp(26px, 3vw, 34px); }
.page-head p { margin-top: 6px; color: var(--muted); }
.head-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; }
.card { min-width: 0; padding: 22px; border-radius: var(--r); background: var(--card); box-shadow: 0 1px 0 var(--line), 0 10px 30px -24px rgba(23, 60, 56, .3); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 14px; margin-bottom: 16px; }
.card-head h2 { font-size: 17.5px; }
.card-head p { margin-top: 2px; color: var(--muted); font-size: 14px; }
.span-3 { grid-column: span 3; } .span-4 { grid-column: span 4; } .span-5 { grid-column: span 5; } .span-6 { grid-column: span 6; } .span-7 { grid-column: span 7; } .span-8 { grid-column: span 8; } .span-12 { grid-column: span 12; }
.stat { display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 14px; }
.stat-ico { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--c); color: var(--ic); }
.stat-ico svg { width: 24px; height: 24px; }
.stat small { display: block; color: var(--muted); font-size: 13.5px; font-weight: 700; }
.stat b { font-size: 28px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat em { display: block; color: var(--muted); font-style: normal; font-size: 13px; }

/* today: queue, rooms, agenda */
.queue { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.queue li { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 16px; background: var(--soft); }
.queue li.is-in { background: var(--teal-soft); }
.queue li > p:only-child { grid-column: 1 / -1; margin: 0; }
.queue .ticket { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--card); font-weight: 700; font-variant-numeric: tabular-nums; }
.queue .q-main b { display: block; }
.queue .q-main small { color: var(--muted); font-size: 13px; }
.wait { font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.wait.is-long { color: var(--coral); }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border-radius: 20px; background: var(--c, var(--soft)); color: var(--ic, var(--muted)); font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rooms { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.room { display: grid; gap: 4px; padding: 12px; border-radius: 16px; background: var(--soft); }
.room.is-busy { background: var(--violet-soft); }
.room.is-clean { background: var(--orange-soft); }
.room b { font-size: 15px; }
.room small { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ring-wrap { display: grid; grid-template-columns: 120px minmax(0, 1fr); align-items: center; gap: 18px; }
.ring { position: relative; width: 120px; height: 120px; }
.ring svg { width: 120px; height: 120px; transform: rotate(-90deg); stroke-width: 12; }
.ring .track { stroke: var(--soft); }
.ring .val { stroke: var(--teal); transition: stroke-dashoffset 1s var(--ease); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 24px; }
.legend { display: grid; gap: 8px; font-size: 14px; }
.legend span { display: flex; align-items: center; gap: 8px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.timeline { margin: 0; padding: 0; list-style: none; }
.timeline li { display: grid; grid-template-columns: 54px 14px minmax(0, 1fr); gap: 12px; padding-bottom: 14px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 72px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline time { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 14px; }
.timeline .tl-dot { width: 14px; height: 14px; margin-top: 4px; border-radius: 50%; border: 3px solid var(--c, var(--teal)); background: var(--card); z-index: 1; }
.timeline b { display: block; }
.timeline small { color: var(--muted); font-size: 13px; }

/* appointments: day schedule per doctor */
.sched-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.sched-tools h2 { margin-right: auto; font-size: 19px; }
.sched-wrap { overflow-x: auto; border-radius: var(--r); background: var(--card); box-shadow: 0 1px 0 var(--line); }
.sched { display: grid; min-width: 760px; }
.sched-head { display: contents; }
.sched-head > div { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--line); background: var(--card); }
.sched-head > div > span { min-width: 0; overflow-wrap: anywhere; }
.sched-head small { display: block; color: var(--muted); font-size: 12.5px; }
.sched-time { border-right: 1px solid var(--line); }
.sched-time span { display: block; height: 88px; padding: 4px 10px 0 0; text-align: right; color: var(--faint); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sched-col { position: relative; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(to bottom, transparent 0 43px, color-mix(in srgb, var(--line) 50%, transparent) 43px 44px, transparent 44px 87px, var(--line) 87px 88px); cursor: copy; }
.sched-col.is-off { background-color: var(--soft); cursor: default; }
.appt { position: absolute; left: 6px; right: 6px; z-index: 1; display: flex; flex-direction: column; gap: 0; padding: 4px 10px; overflow: hidden; line-height: 1.3; border: 0; border-radius: 12px; background: var(--c); color: var(--ic); text-align: left; font-size: 13px; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.appt.is-short { justify-content: center; padding: 0 10px; font-size: 12px; }
.appt:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.appt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt small { opacity: .8; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt.is-done { opacity: .55; }
.appt.is-noshow { text-decoration: line-through; opacity: .5; }
.now-line { position: absolute; left: 0; right: 0; height: 2px; z-index: 3; background: var(--coral); pointer-events: none; }

/* patients */
.split { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; align-items: start; }
.plist { display: grid; gap: 4px; max-height: 760px; margin: 0; padding: 8px; list-style: none; overflow-y: auto; }
.plist button { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: center; gap: 12px; width: 100%; padding: 10px; border: 0; border-radius: 14px; background: none; text-align: left; }
.plist button:hover { background: var(--soft); }
.plist button[aria-current="true"] { background: var(--teal-soft); }
.plist b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist small { color: var(--muted); font-size: 13px; }
.chart-card { padding: 0; overflow: hidden; }
.record-head { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; padding: 22px; background: linear-gradient(120deg, var(--teal-soft), var(--violet-soft)); }
.record-head h2 { font-size: 23px; }
.record-head p { color: var(--muted); }
.record-head .head-actions { margin-left: auto; }
.record-body { display: grid; gap: 20px; padding: 22px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.facts div { padding: 12px 14px; border-radius: 14px; background: var(--soft); }
.facts small { display: block; color: var(--muted); font-size: 12.5px; font-weight: 700; }
.facts b { font-size: 14.5px; font-variant-numeric: tabular-nums; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px; background: var(--coral-soft); color: var(--coral); font-size: 13.5px; font-weight: 700; }
.chip.is-info { background: var(--violet-soft); color: var(--violet); }
.vitals { position: relative; }
.vitals svg { display: block; width: 100%; height: auto; overflow: visible; stroke: none; }
.vitals .grid-line { stroke: var(--line); stroke-width: 1; }
.vitals .axis { fill: var(--faint); font: 700 11px var(--font); }
.vitals .band { fill: color-mix(in srgb, var(--green) 10%, transparent); }
.vitals .sys { fill: none; stroke: var(--coral); stroke-width: 2.5; }
.vitals .dia { fill: none; stroke: var(--violet); stroke-width: 2.5; }
.vitals .pul { fill: none; stroke: var(--teal); stroke-width: 2; stroke-dasharray: 4 4; }
.vitals circle { stroke: var(--card); stroke-width: 2; }
.tip { position: absolute; z-index: 5; padding: 8px 12px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow), 0 0 0 1px var(--line); font-size: 13px; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; }
.tip b { display: block; }
.keys { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 13.5px; color: var(--muted); }
.keys span { display: inline-flex; align-items: center; gap: 7px; }
.keys i { width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
.visits { margin: 0; padding: 0; list-style: none; }
.visits li { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.visits li:last-child { border-bottom: 0; }
.visits time { color: var(--muted); font-size: 13.5px; font-weight: 700; }
.visits small { display: block; color: var(--muted); font-size: 13.5px; }
.back-btn { display: none; }

/* lab */
.table-wrap { position: relative; overflow-x: auto; border-radius: var(--r); background: var(--card); box-shadow: 0 1px 0 var(--line); }
table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12.5px; font-weight: 700; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--soft); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.range { position: relative; display: inline-block; width: 120px; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--coral-soft) 0 20%, color-mix(in srgb, var(--green) 25%, transparent) 20% 80%, var(--coral-soft) 80%); vertical-align: middle; }
.range i { position: absolute; top: -4px; width: 4px; height: 16px; margin-left: -2px; border-radius: 2px; background: var(--text); left: var(--p); }
.flag-h, .flag-l { color: var(--coral); font-weight: 700; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; }
.tools .field-search { flex: 1 1 220px; max-width: 360px; }

/* billing */
.inv-items { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.inv-items li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--soft); }
.sum-box { display: grid; gap: 6px; padding: 14px; border-radius: 14px; background: var(--teal-soft); }
.sum-box div { display: flex; justify-content: space-between; gap: 10px; }
.sum-box .grand { font-size: 18px; font-weight: 700; }

/* staff */
.roster-wrap { overflow-x: auto; border-radius: var(--r); background: var(--card); box-shadow: 0 1px 0 var(--line); }
.roster { width: 100%; border-collapse: separate; border-spacing: 6px; font-size: 14px; }
.roster th { padding: 6px; color: var(--muted); font-weight: 700; font-size: 13px; text-align: center; border: 0; }
.roster th.is-today { color: var(--teal-ink); }
.roster td { padding: 0; border: 0; }
.roster td.who { padding-right: 10px; white-space: nowrap; }
.roster td.who span { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.roster td.who small { display: block; color: var(--muted); font-weight: 400; font-size: 12.5px; }
.shift { display: grid; place-items: center; width: 100%; min-width: 64px; height: 46px; border: 0; border-radius: 12px; background: var(--soft); color: var(--faint); font-size: 12.5px; font-weight: 700; }
.shift.s-day { background: var(--teal-soft); color: var(--teal-ink); }
.shift.s-late { background: var(--violet-soft); color: var(--violet); }
.shift.s-night { background: #23305f; color: #dfe4ff; }
.shift.s-off { background: var(--soft); color: var(--faint); }
.shift:hover { box-shadow: inset 0 0 0 2px var(--teal); }

/* settings */
.settings { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 24px; align-items: start; }
.set-nav { position: sticky; top: 20px; display: grid; gap: 4px; }
.set-nav button { padding: 10px 14px; border: 0; border-radius: 12px; background: none; color: var(--muted); font-weight: 700; text-align: left; }
.set-nav button[aria-selected="true"] { background: var(--teal-soft); color: var(--teal-ink); }
.set-panel { display: grid; gap: 18px; }
.price-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.price-list li { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; align-items: center; gap: 10px; }
.hours-grid { display: grid; gap: 8px; }
.hours-grid label.day { display: grid; grid-template-columns: 110px auto 1fr 1fr; align-items: center; gap: 10px; }

/* forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border: 0; border-radius: 30px; background: var(--soft); font-weight: 700; text-decoration: none; white-space: nowrap; transition: background .2s, box-shadow .2s, transform .1s; }
.btn:hover { background: var(--teal-soft); color: var(--teal-ink); }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: 0 10px 20px -12px var(--teal); }
.btn-primary:hover { background: var(--teal-ink); color: #fff; }
.btn-danger { background: var(--coral); color: #fff; }
.btn-danger:hover { background: var(--coral); color: #fff; filter: brightness(1.05); }
.btn-ghost { background: none; }
.btn-sm { min-height: 34px; padding: 5px 13px; font-size: 14px; }
.btn:disabled { opacity: .45; cursor: default; }
.field { display: grid; gap: 6px; min-width: 0; }
.field > span, .field > label, legend { color: var(--muted); font-size: 13.5px; font-weight: 700; }
.input, .select, .textarea { width: 100%; min-width: 0; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); outline: none; transition: border-color .2s, box-shadow .2s; }
.input[type="date"], .input[type="time"] { -webkit-appearance: none; appearance: none; display: block; max-width: 100%; min-height: 46px; }
.input[type="date"]::-webkit-date-and-time-value, .input[type="time"]::-webkit-date-and-time-value { min-height: 1.4em; text-align: left; }
.select { -webkit-appearance: none; appearance: none; padding-right: 36px; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 4px var(--teal-soft); }
.field.is-invalid .input, .field.is-invalid .select { border-color: var(--coral); }
.field-error { color: var(--coral); font-size: 13px; font-weight: 700; }
.field-search { position: relative; }
.field-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; color: var(--faint); pointer-events: none; }
.field-search .input { padding-left: 42px; border-radius: 30px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.seg { display: inline-flex; max-width: 100%; padding: 4px; overflow-x: auto; scrollbar-width: none; border-radius: 30px; background: var(--soft); }
.seg button { padding: 7px 14px; border: 0; border-radius: 30px; background: none; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--teal-ink); box-shadow: 0 2px 8px -4px rgba(0, 0, 0, .25); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.switch:last-child { border-bottom: 0; }
.switch b { display: block; }
.switch small { color: var(--muted); font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch i { position: relative; width: 46px; height: 26px; border-radius: 13px; background: var(--line); transition: background .2s; flex: none; }
.switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .25s var(--ease); }
.switch input:checked + i { background: var(--teal); }
.switch input:checked + i::after { transform: translateX(20px); }
.switch input:focus-visible + i { outline: 3px solid var(--teal-soft); outline-offset: 2px; }
.row-actions { display: flex; gap: 2px; justify-content: flex-end; }
.row-actions button { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.row-actions button:hover { background: var(--soft); color: var(--text); }
.row-actions svg { width: 17px; height: 17px; }

/* overlays */
dialog.modal { width: min(580px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 26px; background: var(--card); color: var(--text); box-shadow: var(--shadow); }
dialog.modal::backdrop { background: rgba(15, 40, 37, .35); backdrop-filter: blur(4px); }
dialog.modal[open] { animation: pop .22s var(--ease); }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 24px 0; }
.modal-head h2 { font-size: 20px; }
.modal-body { display: grid; gap: 14px; padding: 18px 24px; }
.modal-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 0 24px 22px; }
.modal-foot .btn-danger { margin-right: auto; }
.palette { position: fixed; inset: 0; z-index: 90; display: grid; justify-items: center; align-items: start; padding: 14vh 12px 12px; background: rgba(15, 40, 37, .3); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.palette-box { width: min(600px, 100%); border-radius: 24px; background: var(--card); box-shadow: var(--shadow); overflow: hidden; animation: pop .18s var(--ease); }
.palette-input { display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.palette-input input { flex: 1; min-width: 0; border: 0; background: none; outline: none; font-size: 17px; }
.palette-list { max-height: 52vh; margin: 0; padding: 8px; list-style: none; overflow-y: auto; }
.palette-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; }
.palette-list li[aria-selected="true"] { background: var(--teal-soft); color: var(--teal-ink); }
.palette-list li small { margin-left: auto; color: var(--muted); font-size: 13px; }
.palette-list .avatar { width: 26px; height: 26px; font-size: 10px; }
.palette-group { padding: 8px 12px 4px; color: var(--faint); font-size: 12.5px; font-weight: 700; cursor: default !important; }
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 95; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; background: var(--card); box-shadow: var(--shadow), 0 0 0 1px var(--line); font-size: 14.5px; animation: pop .25s var(--ease); }
.toast span { flex: 1; }
.toast svg { width: 18px; height: 18px; color: var(--teal); }
.toast button { padding: 4px 11px; border: 0; border-radius: 20px; background: var(--teal-soft); color: var(--teal-ink); font-weight: 700; font-size: 13.5px; }
.toast.is-out { opacity: 0; transform: translateY(10px); transition: .25s; }

/* login + 404 */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.auth-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); width: min(960px, 100%); overflow: hidden; border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow); }
.auth-form { display: grid; align-content: center; gap: 20px; padding: clamp(24px, 4vw, 48px); }
.auth-form h1 { font-size: 30px; }
.auth-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.auth-art { display: grid; align-content: end; gap: 12px; padding: 36px; background: linear-gradient(150deg, var(--teal), #6c7cf5); color: #fff; position: relative; overflow: hidden; }
.auth-art svg.art { position: absolute; inset: 0; width: 100%; height: 100%; stroke: none; }
.auth-art p { position: relative; font-size: 19px; font-weight: 700; line-height: 1.4; }
.auth-art small { position: relative; opacity: .85; }
.pw { position: relative; }
.pw .input { padding-right: 48px; }
.pw button { position: absolute; right: 6px; top: 50%; display: grid; place-items: center; width: 36px; height: 36px; margin-top: -18px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); }
.lost { display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; align-content: center; gap: 16px; min-height: 100vh; padding: 30px 16px; text-align: center; }
.lost-pulse { width: min(420px, 90vw); height: auto; stroke: var(--teal); stroke-width: 4; }
.lost-pulse path { stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.2s var(--ease) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.lost .btn { white-space: normal; }
.lost-lang { position: fixed; top: 16px; right: 16px; z-index: 5; }
.lost p { max-width: 420px; color: var(--muted); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 18px; padding: 16px clamp(16px, 2.6vw, 30px); border-top: 1px solid var(--line); color: var(--faint); font-size: 13px; }

/* responsive */
@media (max-width: 1260px) {
    .span-3 { grid-column: span 6; }
    .span-4, .span-5, .span-7, .span-8 { grid-column: span 12; }
    .me-name { display: none; }
    .me { padding: 0; background: none; }
    .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
    .canvas { grid-template-columns: minmax(0, 1fr); padding: 10px; }
    .side { position: fixed; inset: 10px auto 10px 10px; z-index: 60; width: min(290px, 86vw); height: auto; transform: translateX(-110%); transition: transform .3s var(--ease); }
    .side-open .side { transform: none; }
    .side .side-close { display: grid; position: absolute; top: 18px; right: 14px; }
    .side-scrim { display: block; position: fixed; inset: 0; z-index: 55; background: rgba(15, 40, 37, .35); }
    .side-scrim[hidden] { display: none; }
    .menu-btn { display: inline-grid !important; }
    .search kbd { display: none; }
    .span-6 { grid-column: span 12; }
    .split { grid-template-columns: minmax(0, 1fr); }
    .split .record { display: none; }
    .split.is-record .record { display: block; }
    .split.is-record .plist-card { display: none; }
    .back-btn { display: inline-flex; margin: 14px 14px 0; }
    .settings { grid-template-columns: minmax(0, 1fr); }
    .set-nav { position: static; display: flex; overflow-x: auto; }
    .set-nav button { white-space: nowrap; }
    .auth-card { grid-template-columns: minmax(0, 1fr); }
    .auth-art { display: none; }
}
@media (max-width: 640px) {
    .sched-tools h2 { flex-basis: 100%; }
    .sheet, .card { border-radius: 20px; }
    .top { gap: 8px; padding: 12px; }
    .search { flex: 0 0 42px; width: 42px; height: 42px; padding: 0; justify-content: center; }
    .search span { display: none; }
    .top-actions { gap: 6px; }
    .capsule.mini { width: 54px; }
    .icon-btn { width: 38px; height: 38px; }
    .avatar { width: 36px; height: 36px; }
    .main { padding: 18px 14px 30px; }
    .card { padding: 16px; }
    .span-3 { grid-column: span 12; }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .rooms { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ring-wrap { grid-template-columns: minmax(0, 1fr); justify-items: center; }
    .queue li { grid-template-columns: 40px minmax(0, 1fr) auto; }
    .queue li .wait { display: none; }
    .facts { grid-template-columns: minmax(0, 1fr); }
    .record-head .head-actions { margin-left: 0; width: 100%; }
    .page-head .head-actions { width: 100%; }
    .page-head .head-actions .btn { flex: 1; }
    .hours-grid label.day { grid-template-columns: 1fr auto; }
    .hours-grid label.day .input { grid-column: span 1; }
    .price-list li { grid-template-columns: minmax(0, 1fr) 90px auto; }
    .toasts { right: 12px; bottom: 12px; width: calc(100vw - 24px); }
}
@media (max-width: 380px) {
    .top-theme { display: none !important; }
    .me-theme { display: flex !important; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .lost-pulse path { stroke-dashoffset: 0; }
}
@media print {
    .side, .top, .foot, .toasts, .head-actions { display: none !important; }
    .canvas { display: block; padding: 0; }
    body { background: #fff; }
    .sheet { box-shadow: none; }
}
