/* Vaidyora: a working clinic management demo (concept project, made-up sample data only). */
:root {
  --bg: #f2f6f5; --surface: #ffffff; --surface-2: #f6faf9; --surface-3: #ecf3f1; --border: #e0e9e7; --border-2: #cad9d6;
  --text: #0e2a2d; --text-2: #2c474a; --muted: #5d7678; --faint: #94a9aa;
  --primary: #0f8b7e; --primary-2: #0b6e64; --primary-soft: #e0f3ef; --primary-ring: rgba(15, 139, 126, .22);
  --accent: #5b63e6; --accent-soft: #eceefd; --coral: #f0715a;
  --green: #15803d; --green-soft: #e3f6ea; --amber: #b45309; --amber-soft: #fdf1dc; --red: #d23439; --red-soft: #fdeaea;
  --blue: #2563eb; --blue-soft: #e7eefd; --violet: #7c3aed; --violet-soft: #f1ebfe; --gray-soft: #edf2f2;
  --side: #ffffff; --side-2: #eef6f4; --side-text: #2c474a; --side-muted: #7b9193;
  --hatch: rgba(14, 42, 45, .045);
  --shadow-sm: 0 1px 2px rgba(14, 42, 45, .05);
  --shadow: 0 1px 2px rgba(14, 42, 45, .04), 0 6px 20px rgba(14, 42, 45, .05);
  --shadow-lg: 0 28px 70px rgba(14, 42, 45, .22);
  --r: 16px; --r-sm: 11px;
  --font: "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Text", Roboto, "Helvetica Neue", Arial, sans-serif;
  --num: "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "SF Pro Display", Roboto, Arial, sans-serif;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0a1416; --surface: #101d20; --surface-2: #142427; --surface-3: #18292d; --border: #1e3236; --border-2: #2a4347;
  --text: #e7f1f0; --text-2: #c4d6d4; --muted: #8aa3a3; --faint: #5b7676;
  --primary: #2dd4bf; --primary-2: #5eead4; --primary-soft: rgba(45, 212, 191, .13); --primary-ring: rgba(45, 212, 191, .3);
  --accent: #8b93ff; --accent-soft: rgba(139, 147, 255, .15);
  --green: #4ade80; --green-soft: rgba(74, 222, 128, .12); --amber: #fbbf24; --amber-soft: rgba(251, 191, 36, .13);
  --red: #f87171; --red-soft: rgba(248, 113, 113, .14); --blue: #93b4ff; --blue-soft: rgba(96, 140, 255, .16);
  --violet: #c4a6ff; --violet-soft: rgba(167, 139, 250, .16); --gray-soft: #18292d;
  --side: #0c1719; --side-2: #142729; --side-text: #c4d6d4; --side-muted: #6f8a8a;
  --hatch: rgba(255, 255, 255, .035);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px rgba(0, 0, 0, .3);
  --shadow-lg: 0 30px 80px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; }
body.is-dragging, body.is-dragging * { cursor: grabbing !important; user-select: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }
.i { flex: none; display: block; }
.muted { color: var(--muted); }
.ls { display: none; }
.num { font-variant-numeric: tabular-nums; }
.serif { font-family: var(--serif); }
:focus-visible { outline: 3px solid var(--primary-ring); outline-offset: 2px; border-radius: 8px; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; background: var(--side); border-right: 1px solid var(--border); color: var(--side-text); display: flex; flex-direction: column; padding: 18px 14px 14px; gap: 16px; z-index: 40; }
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 8px; }
.brand svg { width: 38px; height: 38px; flex: none; }
.brand b { display: block; color: var(--text); font: 400 21px/1.05 var(--serif); letter-spacing: -.01em; }
.brand small { color: var(--side-muted); font-size: 12px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-g { font: 700 10.5px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--faint); padding: 12px 12px 6px; }
.nav-g:first-child { padding-top: 2px; }
.nav-i { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; color: var(--side-text); font-weight: 600; font-size: 14px; position: relative; }
.nav-i .i { color: var(--side-muted); }
.nav-i:hover { background: var(--side-2); }
.nav-i.on { background: var(--primary-soft); color: var(--primary-2); }
.nav-i.on .i { color: var(--primary); }
.nav-i.on::before { content: ""; position: absolute; left: -14px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.nb { margin-left: auto; min-width: 22px; height: 20px; padding: 0 7px; border-radius: 10px; background: var(--primary); color: #fff; font: 700 11px/20px var(--font); text-align: center; }
[data-theme="dark"] .nb { color: #062a27; }
.nb.warn { background: var(--amber-soft); color: var(--amber); }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.demo-card { border-radius: 14px; padding: 12px 13px; background: linear-gradient(150deg, var(--primary-soft), var(--surface-2)); border: 1px solid var(--border); font-size: 12px; color: var(--muted); line-height: 1.45; }
.demo-card b { display: flex; align-items: center; gap: 7px; color: var(--text); font-size: 12.5px; margin-bottom: 3px; }
.demo-card b .i { color: var(--primary); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; border: 1px solid var(--border); }
.me b { display: block; color: var(--text); font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me small { color: var(--side-muted); font-size: 12px; }
.me > div { min-width: 0; }
.me .icon-btn { margin-left: auto; width: 36px; height: 36px; border-color: transparent; box-shadow: none; background: transparent; color: var(--side-muted); }
.me .icon-btn:hover { background: var(--side-2); color: var(--text); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font: 700 13px var(--font); color: #fff; flex: none; letter-spacing: .02em; }
.avatar.sm { width: 28px; height: 28px; font-size: 11px; }
.avatar.lg { width: 64px; height: 64px; font-size: 22px; }
.avatar.ring { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px currentColor; }

.main { min-width: 0; display: flex; flex-direction: column; }
.top { position: sticky; top: 0; z-index: 30; height: 66px; display: flex; align-items: center; gap: 14px; padding: 0 28px; background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.top-brand { display: none; align-items: center; gap: 9px; font: 400 18px var(--serif); }
.top-brand svg { width: 30px; height: 30px; }
.search-trigger { flex: 1; max-width: 470px; height: 42px; display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); text-align: left; box-shadow: var(--shadow-sm); }
.search-trigger span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
kbd { font: 600 11px var(--font); padding: 3px 7px; border-radius: 6px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--muted); }
.top-r { margin-left: auto; display: flex; align-items: center; gap: 10px; position: relative; }
.clock { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 13px; padding: 0 6px; white-space: nowrap; }
.clock b { color: var(--text); font-weight: 700; }
.icon-btn { position: relative; width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); box-shadow: var(--shadow-sm); flex: none; }
.icon-btn:hover { border-color: var(--border-2); color: var(--text); }
.icon-btn.sm { width: 34px; height: 34px; border-radius: 10px; }
.dot-badge { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; border-radius: 10px; background: var(--coral); color: #fff; font: 700 10.5px/19px var(--font); font-style: normal; text-align: center; padding: 0 5px; border: 2px solid var(--bg); }
.page { padding: 26px 28px 48px; min-width: 0; }
.tabbar { display: none; }

/* ---------- common ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ph h1 { font: 400 31px/1.12 var(--serif); letter-spacing: -.015em; }
.ph p { color: var(--muted); margin-top: 7px; }
.ph-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 650; font-size: 13px; margin-bottom: 14px; }
.crumb:hover { color: var(--primary-2); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.card-h h3 { font: 650 15.5px var(--font); }
.card-h small { color: var(--muted); }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.mt { margin-top: 18px; }
.btn { height: 42px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 650; white-space: nowrap; box-shadow: var(--shadow-sm); }
.btn:hover { border-color: var(--border-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: linear-gradient(180deg, #14a090, #0f8b7e); border-color: #0d7e72; color: #fff; box-shadow: 0 8px 18px rgba(15, 139, 126, .26), inset 0 1px 0 rgba(255, 255, 255, .22); }
.btn-primary:hover { border-color: #0b6e64; background: linear-gradient(180deg, #17a796, #0d8175); }
[data-theme="dark"] .btn-primary { background: linear-gradient(180deg, #2dd4bf, #14b8a6); border-color: #14b8a6; color: #04302b; }
.btn-soft { background: var(--primary-soft); border-color: transparent; color: var(--primary-2); box-shadow: none; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: var(--red-soft); color: var(--red); border-color: transparent; box-shadow: none; }
.btn-sm { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 13px; }
.btn-xs { height: 28px; padding: 0 9px; border-radius: 8px; font-size: 12px; gap: 5px; }
.btn-lg { height: 52px; font-size: 15.5px; border-radius: 14px; }
.w100 { width: 100%; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { height: 36px; display: inline-flex; align-items: center; gap: 7px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.chip:hover { border-color: var(--border-2); }
.chip.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip b { font-weight: 700; opacity: .6; }
.chip .sw { width: 10px; height: 10px; border-radius: 50%; }
.chip.sm { height: 30px; padding: 0 11px; font-size: 12.5px; }
.seg { display: inline-flex; padding: 4px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--border); gap: 2px; }
.seg button { height: 33px; padding: 0 12px; border-radius: 9px; border: 0; background: transparent; color: var(--muted); font-weight: 650; display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }
.input, select.input, textarea.input { height: 42px; width: 100%; border-radius: 11px; border: 1px solid var(--border); background: var(--surface); padding: 0 13px; outline: none; min-width: 0; }
textarea.input { height: auto; padding: 11px 13px; resize: vertical; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-ring); }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label, .lbl-s { font-weight: 650; font-size: 13px; color: var(--text-2); }
.search { position: relative; }
.search .i { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.search .input { padding-left: 40px; }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 25px; padding: 0 10px; border-radius: 999px; font-weight: 700; font-size: 12px; white-space: nowrap; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.nodot::before { display: none; }
.p-green { background: var(--green-soft); color: var(--green); }
.p-amber { background: var(--amber-soft); color: var(--amber); }
.p-red { background: var(--red-soft); color: var(--red); }
.p-blue { background: var(--blue-soft); color: var(--blue); }
.p-violet { background: var(--violet-soft); color: var(--violet); }
.p-teal { background: var(--primary-soft); color: var(--primary-2); }
.p-gray { background: var(--gray-soft); color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border-radius: 7px; font-size: 12px; font-weight: 650; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.tag.allergy { background: var(--red-soft); color: var(--red); }
.switch { position: relative; width: 42px; height: 24px; border-radius: 12px; background: var(--border-2); border: 0; flex: none; transition: background .2s; padding: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
.empty { display: grid; place-items: center; gap: 8px; text-align: center; padding: 30px 16px; color: var(--muted); }
.empty .i { color: var(--faint); }
.bar { height: 8px; border-radius: 6px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #34c3b0, #0f8b7e); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* tables */
.tbl-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; }
table.t th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.t td { padding: 12px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: var(--surface-2); }
table.t td.r, table.t th.r { text-align: right; }
.cell-main { font-weight: 650; }
.cell-sub { color: var(--muted); font-size: 12.5px; }
.who { display: flex; align-items: center; gap: 11px; min-width: 0; }
.who b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.who small { color: var(--muted); font-size: 12.5px; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 14px; color: var(--muted); font-size: 13px; }
.pager .row { gap: 6px; }

/* ---------- KPIs and charts ---------- */
.kpi { position: relative; overflow: hidden; }
.kpi .lbl { display: flex; align-items: center; gap: 9px; color: var(--muted); font-weight: 650; font-size: 13px; }
.kpi .lbl .ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.kpi .lbl .ico.c2 { background: var(--amber-soft); color: var(--amber); }
.kpi .lbl .ico.c3 { background: var(--accent-soft); color: var(--accent); }
.kpi .lbl .ico.c4 { background: var(--blue-soft); color: var(--blue); }
.kpi .val { font: 700 29px/1.1 var(--num); letter-spacing: -.02em; margin-top: 14px; font-variant-numeric: tabular-nums; }
.kpi .val small { font: 600 15px var(--num); color: var(--muted); letter-spacing: 0; }
.kpi .foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 9px; font-size: 12.5px; color: var(--muted); min-height: 34px; }
.delta { font-weight: 700; font-size: 12.5px; display: inline-flex; align-items: center; gap: 4px; }
.delta.up { color: var(--green); } .delta.down { color: var(--red); }
.spark { width: 104px; height: 34px; flex: none; }
.chart { width: 100%; height: auto; display: block; }
.chart text { fill: var(--muted); font: 11px var(--font); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut-wrap svg { width: 148px; height: 148px; flex: none; }
.mix { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mix-row { display: flex; align-items: center; gap: 10px; }
.mix-row .sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.mix-row b { margin-left: auto; }
.hb { display: flex; flex-direction: column; gap: 13px; }
.hb-row { display: flex; align-items: center; gap: 12px; }
.hb-row .grow span { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.hb-row .grow span b { color: var(--text); font-weight: 650; }
.heat { display: grid; grid-template-columns: 40px repeat(12, minmax(0, 1fr)); gap: 4px; font-size: 11px; color: var(--muted); }
.heat span { text-align: center; }
.heat i { display: block; height: 28px; border-radius: 6px; }

/* dashboard bits */
.qmini { display: flex; flex-direction: column; gap: 4px; }
.qm-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.qm-row:last-child { border-bottom: 0; }
.tok { display: inline-grid; place-items: center; min-width: 58px; height: 38px; padding: 0 8px; border-radius: 10px; font: 750 15px var(--num); letter-spacing: .02em; color: #fff; background: var(--c, var(--primary)); font-variant-numeric: tabular-nums; flex: none; }
.tok.soft { background: color-mix(in srgb, var(--c, var(--primary)) 13%, var(--surface)); color: var(--c, var(--primary)); }
[data-theme="dark"] .tok.soft { color: color-mix(in srgb, var(--c) 55%, #fff); }
.tok.sm { min-width: 48px; height: 30px; font-size: 13px; border-radius: 8px; }
.tok.free { background: var(--surface-3); color: var(--faint); font-size: 12px; }
.doc-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.doc-row:last-child { border-bottom: 0; }
.doc-row .grow b { display: block; font-size: 13.5px; }
.time-badge { width: 60px; text-align: center; padding: 6px 0; border-radius: 10px; background: var(--primary-soft); color: var(--primary-2); font: 750 13.5px var(--num); flex: none; font-variant-numeric: tabular-nums; }
.time-badge small { display: block; font: 650 10.5px var(--font); opacity: .8; }
.up-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.up-row:last-child { border-bottom: 0; }
.up-row .grow b { display: block; font-size: 13.5px; }
.due-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: 12px; background: var(--amber-soft); color: var(--amber); font-weight: 650; font-size: 13px; }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: currentColor; }

/* ---------- calendar ---------- */
.cal-tools { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.cal-date { font: 400 20px var(--serif); margin: 0 6px; white-space: nowrap; }
.cal-tools .sp { flex: 1; }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 12px; align-items: center; }
.cal-legend span { display: inline-flex; align-items: center; gap: 7px; }
.cal-legend i { width: 12px; height: 12px; border-radius: 4px; border-left: 3px solid var(--c); background: color-mix(in srgb, var(--c) 18%, var(--surface)); }
.cal { padding: 0; overflow: hidden; }
.cal-scroll { height: calc(100vh - 262px); min-height: 520px; overflow: auto; position: relative; overscroll-behavior: contain; }
.cal-grid { display: grid; grid-template-columns: 62px repeat(var(--cols), minmax(var(--colw, 150px), 1fr)); position: relative; }
.cal-hd { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--border); padding: 10px 10px; min-height: 62px; display: flex; align-items: center; gap: 9px; border-left: 1px solid var(--border); min-width: 0; }
.cal-hd.corner { border-left: 0; left: 0; z-index: 8; }
.cal-hd b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-hd small { display: block; color: var(--muted); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-hd > div { min-width: 0; }
.cal-hd.today b { color: var(--primary-2); }
.cal-hd .dnum { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 700 15px var(--num); background: var(--surface-3); flex: none; }
.cal-hd.today .dnum { background: var(--primary); color: #fff; }
.cal-times { position: sticky; left: 0; z-index: 4; background: var(--surface); }
.cal-times span { position: absolute; right: 8px; transform: translateY(-50%); font-size: 11px; color: var(--muted); font-weight: 650; white-space: nowrap; }
.ccol { position: relative; border-left: 1px solid var(--border); background-image: linear-gradient(var(--border) 1px, transparent 1px), linear-gradient(color-mix(in srgb, var(--border) 55%, transparent) 1px, transparent 1px); background-size: 100% 120px, 100% 60px; background-position: 0 0, 0 0; cursor: copy; }
.ccol.closed { cursor: default; }
.off { position: absolute; left: 0; right: 0; background: repeating-linear-gradient(135deg, var(--hatch) 0 6px, transparent 6px 12px); pointer-events: none; }
.off.leave { display: grid; place-items: start center; padding-top: 30px; color: var(--faint); font: 700 11px var(--font); letter-spacing: .12em; text-transform: uppercase; background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--faint) 16%, transparent) 0 7px, transparent 7px 14px); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--coral); z-index: 3; pointer-events: none; }
.now-line::before { content: ""; position: absolute; left: -5px; top: -4px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); }
.now-tag { position: absolute; right: 6px; transform: translateY(-50%); z-index: 5; background: var(--coral); color: #fff; font: 700 10.5px var(--font); padding: 2px 6px; border-radius: 6px; pointer-events: none; }
.ev { --c: var(--blue); position: absolute; left: 4px; right: 4px; border-radius: 9px; padding: 4px 8px 4px 9px; overflow: hidden; text-align: left; background: color-mix(in srgb, var(--c) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); border-left: 3px solid var(--c); color: var(--text); font-size: 12px; line-height: 1.3; cursor: pointer; z-index: 2; transition: box-shadow .15s; }
.ev:hover { box-shadow: var(--shadow); z-index: 4; }
.ev[data-drag] { cursor: grab; }
.ev .t { color: color-mix(in srgb, var(--c) 75%, var(--text)); font-weight: 700; font-size: 11px; display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.ev b { display: block; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .r { display: block; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11.5px; }
.ev.tiny { padding-top: 2px; padding-bottom: 2px; }
.ev.tiny .r { display: none; }
.ev.tiny .t { display: none; }
.ev .tk { margin-left: auto; font: 750 10.5px var(--num); padding: 0 5px; border-radius: 5px; background: var(--c); color: #fff; }
.ev.st-booked { --c: #2563eb; }
.ev.st-waiting { --c: #d97706; }
.ev.st-consult { --c: #0f8b7e; }
.ev.st-done { --c: #16a34a; }
.ev.st-done b, .ev.st-done .r { opacity: .78; }
.ev.st-noshow { --c: #dc2626; }
.ev.st-noshow b { text-decoration: line-through; }
.ev.st-cancelled { --c: #94a3b8; background: repeating-linear-gradient(135deg, var(--surface-2) 0 6px, var(--surface) 6px 12px); border-style: dashed; border-left-style: solid; }
.ev.st-cancelled b { text-decoration: line-through; color: var(--muted); }
[data-theme="dark"] .ev.st-booked { --c: #6b9bff; } [data-theme="dark"] .ev.st-consult { --c: #2dd4bf; } [data-theme="dark"] .ev.st-done { --c: #4ade80; } [data-theme="dark"] .ev.st-waiting { --c: #fbbf24; }
.ev.lane { left: auto; right: auto; padding: 3px 4px 3px 5px; border-radius: 6px; font-size: 10.5px; }
.ev.lane b { font-size: 10.5px; }
.ev.dragging { opacity: .35; }
.ev.ghost { z-index: 9; pointer-events: none; border-style: dashed; border-left-style: solid; box-shadow: var(--shadow-lg); background: color-mix(in srgb, var(--c) 22%, var(--surface)); }
.ev.ghost.bad { --c: #dc2626; }
.ev.ghost b { font-size: 12.5px; }
.cal-foot { display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px; flex-wrap: wrap; }
.wk-tag { font: 700 10px var(--font); color: var(--amber); background: var(--amber-soft); border-radius: 6px; padding: 1px 6px; margin-left: 4px; }

/* booking window */
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 7px; max-height: 190px; overflow-y: auto; padding: 2px; }
.slots button { height: 36px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface); font: 650 12.5px var(--num); color: var(--text-2); font-variant-numeric: tabular-nums; }
.slots button:hover:not(:disabled) { border-color: var(--primary); color: var(--primary-2); }
.slots button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.slots button:disabled { background: var(--surface-2); color: var(--faint); text-decoration: line-through; cursor: not-allowed; }
.slot-g { font: 700 11px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); grid-column: 1 / -1; padding-top: 4px; }
.picked { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); }
.picked .grow b { display: block; }
.picked .grow small { color: var(--muted); font-size: 12.5px; }
.pick-res { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.pick-res button { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; border: 1px solid transparent; background: none; text-align: left; }
.pick-res button:hover { background: var(--surface-2); border-color: var(--border); }
.pick-res button small { color: var(--muted); font-size: 12px; display: block; }
.pick-res .new { color: var(--primary-2); font-weight: 650; }
.note-box { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; background: var(--blue-soft); color: var(--blue); font-size: 12.5px; font-weight: 600; }
.note-box.warn { background: var(--red-soft); color: var(--red); }
.note-box.amber { background: var(--amber-soft); color: var(--amber); }
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kv div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.kv small { display: block; color: var(--muted); font-size: 12px; font-weight: 600; }
.kv b { font-size: 14px; display: block; }

/* ---------- queue ---------- */
.q-stats { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.qs { display: inline-flex; align-items: center; gap: 9px; padding: 9px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-weight: 600; font-size: 13px; color: var(--muted); box-shadow: var(--shadow-sm); }
.qs b { color: var(--text); font: 700 15px var(--num); }
.qs .i { color: var(--primary); }
.qgrid { display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 16px; align-items: start; }
.qcol { padding: 0; overflow: hidden; }
.qcol-h { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.qcol-h b { display: block; font-size: 14px; }
.qcol-h small { color: var(--muted); font-size: 12px; }
.qcol-h .pill { margin-left: auto; }
.qcol-h > div { flex: 1; }
.qdot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 0%, var(--surface-3)); }
.st-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-top: 14px; }
.st-strip div { border-radius: 12px; padding: 9px 12px; background: color-mix(in srgb, var(--c) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 18%, transparent); }
.st-strip b { display: block; font: 700 19px var(--num); color: color-mix(in srgb, var(--c) 80%, var(--text)); font-variant-numeric: tabular-nums; }
.st-strip span { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.serving { margin: 14px; border-radius: 14px; padding: 16px; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 16%, var(--surface)), color-mix(in srgb, var(--c) 5%, var(--surface))); border: 1px solid color-mix(in srgb, var(--c) 28%, transparent); text-align: center; }
.serving small { display: block; font: 700 10.5px var(--font); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.serving .big { font: 750 46px/1.05 var(--num); letter-spacing: -.01em; color: color-mix(in srgb, var(--c) 80%, var(--text)); margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.serving .nm { font-weight: 650; }
.serving .tm { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.serving .acts { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 14px; }
.serving.free .big { color: var(--faint); font-size: 22px; padding: 14px 0 6px; }
.serving.flash { animation: flash 1.2s ease-out 2; }
@keyframes flash { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--c) 55%, transparent); } 100% { box-shadow: 0 0 0 18px transparent; } }
.q-sub { display: flex; align-items: center; justify-content: space-between; padding: 0 16px 6px; font: 700 11px var(--font); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.q-list { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.q-item { display: flex; align-items: center; gap: 9px; padding: 8px 7px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.q-item .grow b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .grow small { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.q-item .w { font-weight: 700; color: var(--amber); font-variant-numeric: tabular-nums; }
.q-item .w.long { color: var(--red); }
.q-item .acts { display: flex; gap: 4px; flex: none; }
.q-item .acts .btn { width: 30px; height: 30px; padding: 0; border-radius: 9px; }
.q-item .tok.sm { min-width: 46px; }
.q-foot { border-top: 1px solid var(--border); padding: 10px 16px; display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.q-later { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 13px; align-items: center; }

/* TV display */
.tv { position: fixed; inset: 0; z-index: 150; background: radial-gradient(circle at 85% 0%, rgba(94, 234, 212, .28), rgba(94, 234, 212, 0) 45%), linear-gradient(160deg, #06292c, #041a1c 70%); color: #eaf6f4; display: flex; flex-direction: column; padding: 34px 44px 26px; animation: fade .2s ease-out; overflow-y: auto; }
.tv-h { display: flex; align-items: center; gap: 16px; }
.tv-h svg { width: 50px; height: 50px; }
.tv-h b { font: 400 30px var(--serif); display: block; }
.tv-h small { color: #8fb9b4; font-size: 15px; }
.tv-h { padding-right: 50px; }
.tv-h .clk { white-space: nowrap; margin-left: auto; text-align: right; font: 700 40px var(--num); font-variant-numeric: tabular-nums; }
.tv-h .clk small { display: block; font: 500 15px var(--font); color: #8fb9b4; }
.tv-x { position: absolute; top: 18px; right: 18px; width: 40px; height: 40px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(255, 255, 255, .06); color: #fff; display: grid; place-items: center; }
.tv-g { flex: 1; display: grid; grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr)); gap: 20px; margin-top: 30px; align-content: start; }
.tv-c { border-radius: 24px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); padding: 24px; display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.tv-c::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 6px; background: var(--c); }
.tv-c .rm { font: 700 15px var(--font); letter-spacing: .14em; text-transform: uppercase; color: #8fb9b4; }
.tv-c .dn { font: 600 19px var(--font); }
.tv-c .now { font: 800 92px/1 var(--num); letter-spacing: -.02em; margin: 18px 0 6px; font-variant-numeric: tabular-nums; }
.tv-c .nm { font: 600 18px var(--font); color: #cde7e3; min-height: 24px; }
.tv-c .nx { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255, 255, 255, .12); color: #8fb9b4; font-size: 14px; }
.tv-c .nx b { display: inline-block; margin: 6px 8px 0 0; padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, .09); color: #fff; font: 700 16px var(--num); }
.tv-c.hot { box-shadow: 0 0 0 3px var(--c), 0 0 60px color-mix(in srgb, var(--c) 45%, transparent); }
.tv-f { margin-top: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; color: #8fb9b4; font-size: 15px; border-top: 1px solid rgba(255, 255, 255, .1); padding-top: 16px; }

/* ---------- patients ---------- */
.pt-tools { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.pt-tools .search { flex: 1; min-width: 240px; max-width: 420px; }
.pp-head { display: flex; gap: 20px; align-items: flex-start; flex-wrap: wrap; }
.pp-head .grow h1 { font: 400 30px/1.1 var(--serif); letter-spacing: -.015em; }
.pp-meta { display: flex; gap: 6px 16px; flex-wrap: wrap; color: var(--muted); margin-top: 8px; font-size: 13.5px; }
.pp-meta span { display: inline-flex; align-items: center; gap: 6px; }
.pp-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.pp-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.vt-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 16px; }
.vt { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; background: var(--surface-2); min-width: 0; }
.vt small { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.vt b { display: block; font: 700 18px var(--num); margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vt b em { font: 600 12px var(--font); font-style: normal; color: var(--muted); }
.visits { display: flex; flex-direction: column; }
.vs { display: flex; gap: 14px; position: relative; padding-bottom: 16px; }
.vs::before { content: ""; position: absolute; left: 6px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.vs:last-child::before { display: none; }
.vs > i { width: 14px; height: 14px; border-radius: 50%; margin-top: 3px; flex: none; background: var(--surface); border: 3px solid var(--c, var(--primary)); }
.vs .grow b { display: block; }
.vs .grow small { color: var(--muted); }
.vs .when { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.li:last-child { border-bottom: 0; }
.li .grow b { display: block; font-size: 13.5px; }
.li .grow small { color: var(--muted); font-size: 12.5px; }
.li.click { cursor: pointer; border-radius: 8px; }
.li.click:hover { background: var(--surface-2); }
.ic-box { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }

/* ---------- prescription writer ---------- */
.rx-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); gap: 22px; align-items: start; }
.rx-side { position: sticky; top: 86px; }
.med-head, .med-row { display: grid; grid-template-columns: minmax(0, 1.6fr) 126px 114px 66px 34px; gap: 8px; align-items: center; }
.med-head { font: 700 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); padding: 0 2px 6px; }
.med-row { padding: 6px 0; }
.med-row .input { height: 38px; padding: 0 10px; font-size: 13.5px; }
.med-row .icon-btn { width: 34px; height: 34px; border-radius: 10px; box-shadow: none; }
.formulary { display: flex; gap: 6px; flex-wrap: wrap; }
.formulary button { height: 30px; padding: 0 11px; border-radius: 999px; border: 1px dashed var(--border-2); background: var(--surface); font-size: 12.5px; font-weight: 600; color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.formulary button:hover { border-style: solid; border-color: var(--primary); color: var(--primary-2); }
.fine { font-size: 12px; color: var(--faint); }
.paper { background: #fff; color: #17282a; border-radius: 6px; box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 18px 50px rgba(14, 42, 45, .14); padding: 26px 26px 20px; font-size: 12.5px; line-height: 1.45; position: relative; border: 1px solid #e6eceb; }
.paper .lh { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 2px solid #0f8b7e; }
.paper .lh .cl { display: flex; gap: 10px; align-items: flex-start; }
.paper .lh svg { width: 34px; height: 34px; flex: none; }
.paper .lh b { font: 400 18px/1.1 var(--serif); display: block; color: #0b3b3a; }
.paper .lh small { display: block; color: #5b6f70; font-size: 11px; }
.paper .lh .dr { text-align: right; }
.paper .lh .dr b { font: 700 13.5px var(--font); }
.paper .pt { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 6px 14px; padding: 12px 0; border-bottom: 1px dashed #cfdcda; font-size: 12px; }
.paper .pt small { display: block; color: #7a8c8d; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.paper .pt b { font-weight: 650; }
.paper .dx { padding: 10px 0 4px; }
.paper .dx small { color: #7a8c8d; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.paper .rxs-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 4px; }
.paper .rxs { font: italic 400 34px/1 var(--serif); color: #0f8b7e; }
.paper table { width: 100%; border-collapse: collapse; }
.paper th { text-align: left; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #7a8c8d; padding: 6px 6px; border-bottom: 1px solid #dfe7e6; }
.paper td { padding: 8px 6px; border-bottom: 1px solid #eef3f2; vertical-align: top; }
.paper td b { display: block; }
.paper td small { color: #7a8c8d; }
.paper .empty-rx { color: #9aabab; padding: 16px 6px; font-style: italic; }
.paper .adv { margin-top: 12px; padding: 10px 12px; border-radius: 8px; background: #f2f8f7; white-space: pre-wrap; }
.paper .sig { display: flex; justify-content: space-between; align-items: flex-end; margin-top: 28px; gap: 16px; }
.paper .sig .ln { text-align: center; min-width: 170px; }
.paper .sig .ln span { display: block; font: italic 400 19px var(--serif); color: #24494a; padding-bottom: 4px; border-bottom: 1px solid #9fb3b2; }
.paper .sig .ln small { color: #7a8c8d; font-size: 10.5px; }
.paper .foot { margin-top: 18px; padding-top: 10px; border-top: 1px solid #e3eae9; color: #8a9b9c; font-size: 10px; text-align: center; }
.paper .stamp { transform: rotate(-6deg); border: 2px solid rgba(214, 54, 59, .5); color: rgba(214, 54, 59, .7); font: 800 11px var(--font); letter-spacing: .14em; padding: 3px 8px; border-radius: 6px; text-transform: uppercase; }

/* ---------- doctors ---------- */
.roster { display: grid; grid-template-columns: 190px minmax(0, 1fr) 128px; align-items: center; gap: 10px 14px; }
.roster .who b { font-size: 13.5px; }
.ro-row { display: contents; }
.ro-track { position: relative; height: 30px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); }
.ro-track .ses { position: absolute; top: 4px; bottom: 4px; border-radius: 6px; background: color-mix(in srgb, var(--c) 22%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 40%, transparent); }
.ro-track .ap { position: absolute; top: 9px; bottom: 9px; width: 3px; border-radius: 2px; background: var(--c); opacity: .7; }
.ro-track .nl { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--coral); z-index: 2; }
.ro-track.leave { background: repeating-linear-gradient(135deg, var(--hatch) 0 6px, transparent 6px 12px), var(--surface-2); }
.ro-axis { position: relative; height: 16px; font-size: 11px; color: var(--muted); }
.ro-axis span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.dcard .top-l { display: flex; gap: 14px; align-items: center; }
.dcard .top-l > div { min-width: 0; flex: 1; }
.dcard .top-l b { display: block; font-size: 15px; }
.dcard .top-l small { color: var(--muted); font-size: 12.5px; }
.dcard .kv { margin: 16px 0; }
.wkg { display: grid; grid-template-columns: 64px repeat(7, minmax(0, 1fr)); gap: 5px; font-size: 11px; color: var(--muted); align-items: center; }
.wkg span { text-align: center; font-weight: 650; }
.wkg span.l { text-align: left; }
.wkg i { height: 20px; border-radius: 6px; background: var(--surface-3); display: block; }
.wkg i.on { background: color-mix(in srgb, var(--c) 70%, var(--surface)); }
.wkg i.today { box-shadow: 0 0 0 2px var(--text); }
.dcard .acts { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.sched { display: grid; grid-template-columns: 70px 1fr 1fr; gap: 10px 14px; align-items: center; }
.sched .h { font: 700 11px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--faint); }
.sched label { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface); box-shadow: 0 0 0 1px var(--border); }
.swatches button.on { box-shadow: 0 0 0 2px var(--text); }

/* ---------- billing ---------- */
.items-list { display: flex; flex-direction: column; gap: 6px; }
.it-row { display: grid; grid-template-columns: minmax(0, 1fr) 104px 86px 30px; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--border); border-radius: 11px; }
.it-row b { font-size: 13.5px; }
.stepper { display: flex; align-items: center; justify-content: space-between; height: 32px; border: 1px solid var(--border); border-radius: 10px; padding: 0 3px; background: var(--surface); }
.stepper button { width: 24px; height: 24px; border-radius: 7px; border: 0; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); padding: 0; }
.stepper b { font-size: 13px; }
.sum { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13.5px; }
.sum.total { font: 700 19px var(--num); color: var(--text); padding-top: 8px; border-top: 1px dashed var(--border-2); margin-top: 2px; }
.pay-amt { text-align: center; padding: 4px 0 2px; }
.pay-amt small { color: var(--muted); font-weight: 650; }
.pay-amt div { font: 750 40px var(--num); letter-spacing: -.02em; }
.pay-panel { border: 1px solid var(--border); border-radius: 16px; padding: 18px; background: var(--surface-2); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.qr { width: 172px; height: 172px; padding: 10px; background: #fff; border-radius: 14px; box-shadow: var(--shadow-sm); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.change { font: 700 18px var(--num); color: var(--green); }
.card-art { width: 230px; height: 140px; border-radius: 16px; background: linear-gradient(135deg, #0b3b3a, #0f8b7e 70%, #34c3b0); color: #fff; padding: 16px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--shadow); }
.card-art .chip-art { width: 34px; height: 26px; border-radius: 6px; background: linear-gradient(135deg, #fde68a, #d4a017); }
.receipt { font-size: 13px; background: #fff; color: #17282a; border: 1px solid #e1e9e8; border-radius: 12px; padding: 20px; }
.receipt .rh { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding-bottom: 12px; border-bottom: 2px solid #0f8b7e; }
.receipt .rh b { font: 400 17px var(--serif); display: block; color: #0b3b3a; }
.receipt .rh small { color: #5b6f70; font-size: 11.5px; display: block; }
.receipt .rh .no { text-align: right; }
.receipt .rh .no b { font: 700 13px var(--font); }
.receipt .r { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; }
.receipt hr { border: 0; border-top: 1px dashed #cfdcda; margin: 8px 0; }
.receipt .tot { font-weight: 800; font-size: 15px; }
.receipt .paid { display: inline-flex; align-items: center; gap: 6px; color: #15803d; font-weight: 700; }
.receipt .c { text-align: center; color: #7a8c8d; font-size: 11.5px; margin-top: 10px; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 100; background: rgba(6, 26, 28, .42); backdrop-filter: blur(3px); display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 20px; animation: fade .15s ease-out; }
.modal { width: min(540px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); animation: pop .18s ease-out; }
.modal.wide { width: min(760px, 100%); }
.modal-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px 24px 8px; }
.modal-h h2 { font: 400 23px/1.2 var(--serif); letter-spacing: -.01em; }
.modal-h p { color: var(--muted); margin-top: 4px; font-size: 13.5px; }
.modal-b { padding: 14px 24px; display: flex; flex-direction: column; gap: 14px; }
.modal-f { padding: 14px 24px 22px; display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.modal-f .sp { flex: 1; }
.overlay.side-panel { place-items: stretch end; padding: 0; }
.overlay.side-panel .modal { width: min(470px, 100%); max-height: none; height: 100vh; border-radius: 22px 0 0 22px; animation: slide .2s ease-out; }
.overlay.top-panel { place-items: start center; padding-top: 12vh; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.pal-in input { flex: 1; border: 0; outline: none; background: none; font-size: 16px; height: 34px; min-width: 0; }
.pal-list { max-height: 400px; overflow-y: auto; padding: 8px; }
.pal-g { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--faint); padding: 10px 10px 6px; }
.pal-i { width: 100%; display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 11px; border: 0; background: none; text-align: left; }
.pal-i.on { background: var(--primary-soft); }
.pal-i .k { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.pal-i .ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); flex: none; }
.pal-i .ico .avatar { width: 30px; height: 30px; font-size: 11px; }
.pal-i .lab { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pop { position: absolute; top: 52px; right: 0; width: 370px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; animation: pop .15s ease-out; }
.pop-h { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.pop-h b { font: 400 18px var(--serif); }
.ntf { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.ntf:last-child { border-bottom: 0; }
.ntf .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex: none; }
.ntf.unread .ico { background: var(--primary-soft); color: var(--primary); }
.ntf small { color: var(--muted); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }
#toasts { position: fixed; right: 22px; bottom: 22px; z-index: 200; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; pointer-events: none; }
.toast { pointer-events: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 14px; background: #0e2a2d; color: #fff; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .18s ease-out; max-width: 380px; }
.toast .i { color: #5eead4; }
.toast.warn .i { color: #fbbf24; }
.toast.out { opacity: 0; transform: translateY(6px); transition: all .3s; }
[data-theme="dark"] .toast { background: #e7f1f0; color: #0e2a2d; }
[data-theme="dark"] .toast .i { color: #0f8b7e; }
[data-theme="dark"] .toast.warn .i { color: #b45309; }
.settings { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 24px; align-items: start; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.set-row:last-child { border-bottom: 0; }
.set-row b { display: block; }
.set-row small { color: var(--muted); }
.sc { display: grid; grid-template-columns: 1fr auto; gap: 10px 20px; font-size: 13.5px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { position: relative; overflow: hidden; background: linear-gradient(165deg, #07343a, #041d20 75%); color: #fff; padding: 46px 50px; display: flex; flex-direction: column; justify-content: space-between; }
.login-art::before { content: ""; position: absolute; width: 680px; height: 680px; right: -230px; top: -220px; border-radius: 50%; background: radial-gradient(circle, rgba(94, 234, 212, .38), rgba(94, 234, 212, 0) 66%); }
.login-art::after { content: ""; position: absolute; width: 540px; height: 540px; left: -200px; bottom: -260px; border-radius: 50%; background: radial-gradient(circle, rgba(129, 140, 248, .26), rgba(129, 140, 248, 0) 70%); }
.login-art > * { position: relative; z-index: 1; }
.login-art .brand b { color: #fff; font-size: 24px; }
.login-art h2 { font: 400 46px/1.1 var(--serif); letter-spacing: -.02em; max-width: 540px; }
.login-art h2 em { font-style: italic; color: #7ee8d6; }
.login-art p.lead { color: #b9d6d2; font-size: 16px; max-width: 470px; margin-top: 18px; }
.feat { display: flex; flex-direction: column; gap: 12px; margin-top: 26px; }
.feat div { display: flex; align-items: center; gap: 12px; color: #dcefec; font-weight: 600; }
.feat .i { color: #5eead4; }
.floaters { position: relative; height: 178px; margin-top: 30px; }
.fl { position: absolute; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(10px); border-radius: 16px; padding: 13px 16px; box-shadow: 0 20px 40px rgba(0, 0, 0, .3); }
.fl small { color: #a5c7c2; font-size: 12px; display: block; }
.fl b { display: block; font: 700 22px var(--num); }
.login-form { display: grid; place-items: center; padding: 40px 24px; background: var(--bg); }
.login-box { width: min(420px, 100%); display: flex; flex-direction: column; gap: 17px; }
.login-box h1 { font: 400 34px var(--serif); letter-spacing: -.02em; }
.login-box > p { color: var(--muted); margin-top: -8px; }
.role-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.role-chips button { border: 1px solid var(--border); background: var(--surface); border-radius: 12px; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 5px; font-weight: 650; font-size: 13px; color: var(--text-2); }
.role-chips button small { font-weight: 500; font-size: 11px; color: var(--muted); }
.role-chips button.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-2); box-shadow: 0 0 0 3px var(--primary-ring); }
.or { display: flex; align-items: center; gap: 12px; color: var(--faint); font-size: 12px; font-weight: 650; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.demo-note { font-size: 12.5px; color: var(--muted); text-align: center; }
.login-mb { display: none; }

/* ---------- responsive ---------- */
@media (max-width: 1320px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rx-wrap { grid-template-columns: minmax(0, 1fr) 420px; }
  .vt-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .g2-1, .g3, .g2, .settings, .rx-wrap { grid-template-columns: minmax(0, 1fr); }
  .rx-side { position: static; }
  .login { grid-template-columns: 1fr; }
  .login-art { display: none; }
  .login-mb { display: flex; }
  .tv-g { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .top { padding: 0 16px; height: 62px; gap: 8px; }
  .top-brand { display: flex; }
  .search-trigger, .clock { display: none; }
  .top .btn-primary span { display: none; }
  .top .btn-primary { width: 42px; padding: 0; }
  .page { padding: 18px 16px 110px; }
  .ph { margin-bottom: 18px; }
  .ph h1 { font-size: 26px; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid { gap: 14px; }
  .mt { margin-top: 14px; }
  .card { padding: 16px; }
  .kpi .val { font-size: 23px; }
  .kpi .foot { min-height: 0; }
  .spark { display: none; }
  .qgrid { grid-template-columns: minmax(0, 1fr); }
  .cal-scroll { height: calc(100vh - 330px); min-height: 430px; }
  .cal-tools .sp { display: none; }
  .cal-date { font-size: 17px; flex: 1; margin: 0; }
  .vt-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lf { display: none; } .ls { display: inline; }
  .card-h .seg { max-width: 100%; }
  .card-h .seg button { padding: 0 9px; }
  .card-h > div:first-child { min-width: 0; }
  .med-head { display: none; }
  .med-row select.input { padding: 0 6px; font-size: 13px; }
  .med-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) 54px 34px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
  .med-row .mname { grid-column: 1 / -1; }
  .roster { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ro-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 10px; align-items: center; }
  .ro-row .ro-track { grid-column: 1 / -1; order: 3; }
  .roster .rs-gap { display: none; }
  .pop { position: fixed; top: 70px; left: 12px; right: 12px; width: auto; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; background: var(--surface); border-top: 1px solid var(--border); padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 11px; font-weight: 650; color: var(--muted); border: 0; background: none; padding: 4px 0; position: relative; }
  .tabbar .on { color: var(--primary); }
  .tabbar em { position: absolute; top: 0; left: calc(50% + 6px); min-width: 17px; height: 17px; border-radius: 9px; background: var(--coral); color: #fff; font: 700 10px/17px var(--font); font-style: normal; padding: 0 4px; }
  .hide-m { display: none !important; }
  table.t td, table.t th { padding: 11px 8px; }
  .heat { grid-template-columns: 32px repeat(12, minmax(0, 1fr)); gap: 2px; }
  .heat i { height: 22px; }
  .two, .three { grid-template-columns: 1fr; }
  .kv.keep { grid-template-columns: 1fr 1fr; }
  .modal-h { padding: 18px 18px 6px; }
  .modal-b { padding: 12px 18px; }
  .modal-f { padding: 12px 18px 18px; }
  .overlay { padding: 10px; }
  .overlay.side-panel .modal { width: 100%; border-radius: 0; }
  .paper { padding: 18px 16px 16px; }
  .paper .pt { grid-template-columns: 1fr 1fr; }
  .paper .lh { flex-direction: column; gap: 8px; }
  .paper .lh .dr { text-align: left; }
  .it-row { grid-template-columns: minmax(0, 1fr) 96px 30px; }
  .it-row .amt { display: none; }
  .tv { padding: 24px 18px; }
  .tv-g { grid-template-columns: minmax(0, 1fr); }
  .tv-c .now { font-size: 64px; }
  .tv-h .clk { font-size: 22px; }
  .tv-h small { display: none; }
  .tv-h b { font-size: 22px; }
  .pp-head .grow h1 { font-size: 25px; }
  .pt-tools .search { max-width: none; flex-basis: 100%; }
  .login-form { padding: 24px 20px 30px; place-items: start center; }
  #toasts { left: 16px; right: 16px; bottom: 92px; align-items: stretch; }
  .toast { max-width: none; }
}
@media print {
  @page { margin: 12mm; }
  body * { visibility: hidden !important; }
  .print-area, .print-area * { visibility: visible !important; }
  .print-area { position: fixed; left: 0; top: 0; width: 100%; box-shadow: none !important; border: 0 !important; }
  #toasts { display: none !important; }
}
