/* OneHealth CRM - laid out the way the team already knows from Kumodoc:
   white pages, thin icon bar on the left, blue pill tabs, centred tables, round buttons. */
:root {
  --bg: #ffffff; --surface: #ffffff; --ink: #333a44; --muted: #7b8591; --line: #e4e8ed;
  --side: #1e88e5; --side-ink: #2b95ee; --brand: #1e88e5; --brand-dark: #1670c4; --brand-ink: #ffffff; --brand-soft: #e6f2fd;
  --ok: #43a047; --ok-soft: #e8f5e9;
  --focus: #1e88e5; --danger: #e53935; --danger-soft: #fdecea;
  --pending: #757f8a; --pending-bg: #eef0f3;
  --confirmed: #1e88e5; --confirmed-bg: #e3f0fc;
  --arrived: #ef8a00; --arrived-bg: #fff3e0;
  --completed: #2e9a47; --completed-bg: #e3f5e7;
  --cancelled: #e53935; --cancelled-bg: #fdecea;
  --radius: 14px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.45; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 22px; font-weight: 700; }
h2 { font-size: 16px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 18px 0 8px; }
a { color: var(--brand); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
[hidden] { display: none !important; }

/* frame: icon bar + top bar */
.shell { display: grid; grid-template-columns: 56px minmax(0, 1fr); height: 100vh; transition: grid-template-columns .15s; }
body.rail-open .shell { grid-template-columns: 196px minmax(0, 1fr); }
.rail { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; align-items: stretch; padding: 10px 0; overflow: hidden; }
.rail svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.rail-toggle { border: 0; background: none; color: var(--side-ink); height: 40px; cursor: pointer; display: flex; align-items: center; padding: 0 17px; margin-bottom: 10px; }
.rail nav { display: grid; gap: 4px; }
.rail nav a { display: flex; align-items: center; gap: 14px; height: 42px; padding: 0 17px; color: var(--side-ink); text-decoration: none; font-weight: 600; font-size: 14px; white-space: nowrap; border-left: 3px solid transparent; }
.rail nav a span { opacity: 0; transition: opacity .1s; }
body.rail-open .rail nav a span { opacity: 1; }
.rail nav a:hover { background: #f2f8fe; }
.rail nav a.on { background: var(--brand-soft); border-left-color: var(--brand); color: var(--brand-dark); }
.main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 22px; border-bottom: 1px solid var(--line); background: #fff; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 38px; height: 38px; border-radius: 50%; background: linear-gradient(135deg, #42a5f5, #1e88e5); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 15px; letter-spacing: -0.03em; box-shadow: 0 2px 6px rgba(30,136,229,.35); }
.brand-name { font-weight: 800; font-size: 18px; line-height: 1.05; color: var(--brand); }
.brand-name small { display: block; font-weight: 600; font-size: 9.5px; letter-spacing: 0.18em; color: var(--muted); }
.top-right { display: flex; align-items: center; gap: 12px; }
.outlet-pill { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 0 6px 0 12px; height: 38px; background: #f7f9fb; color: var(--brand); }
.outlet-pill svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.outlet-pill select { border: 0 !important; background: transparent !important; min-height: 0 !important; padding: 4px 6px !important; width: auto !important; font-weight: 600; color: var(--ink); cursor: pointer; }
.me-wrap { position: relative; }
.me-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #e3e7ec; color: #5f6b78; font-weight: 700; cursor: pointer; }
.me-btn:hover { background: #d6dce3; }
.me-menu { position: absolute; right: 0; top: 48px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(20,30,50,.15); padding: 12px; min-width: 210px; display: grid; gap: 2px; z-index: 30; }
.me-name { font-weight: 700; }
.me-level { color: var(--muted); font-size: 12px; margin-bottom: 8px; }
.me-menu button { text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-weight: 600; color: var(--ink); }
.me-menu button:hover { background: var(--brand-soft); color: var(--brand-dark); }
.stage { display: none; }
#view { overflow: auto; padding: 26px 30px 40px; outline: none; display: flex; flex-direction: column; min-height: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sub { color: var(--muted); font-size: 13px; }
.back { display: inline-block; margin-bottom: 14px; text-decoration: none; font-weight: 600; }
.note { color: var(--muted); font-size: 13px; padding: 4px 2px; }
.empty { color: var(--muted); padding: 28px 8px; text-align: center; }

.btn { border: 1px solid transparent; border-radius: 8px; padding: 9px 14px; font-weight: 600; cursor: pointer; background: none; white-space: nowrap; }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: #a3360a; }
.btn.ghost { border-color: var(--line); background: var(--surface); }
.btn.ghost:hover { border-color: #a9c8ec; }
.btn.danger { color: var(--danger); }
.btn.sm { padding: 6px 10px; font-size: 13px; }
.btn.block { width: 100%; margin-top: 14px; }
.btn:disabled { opacity: 0.45; cursor: default; }
.icon-btn { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; padding: 2px 8px; border-radius: 6px; color: var(--muted); }

input[type=text], input[type=password], input[type=search], input[type=tel], input[type=email], input[type=date], select, textarea {
  border: 1px solid #d5dbe2; border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; min-height: 38px;
}
.search { width: min(380px, 38vw); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid #edf0f3; vertical-align: top; }
.table tbody tr { cursor: pointer; }
.table tbody tr:hover { background: #f7f9fb; }
.table tbody tr:last-child td { border-bottom: 0; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.name { font-weight: 700; color: var(--ink); text-decoration: none; }
.name.big { font-size: 19px; }
a.name:hover { text-decoration: underline; }
.tag { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.tag.vip { background: #fff1d6; color: #7a4600; }
.tag.allergy { background: var(--danger-soft); color: var(--danger); }
.pager { display: flex; justify-content: space-between; align-items: center; padding: 12px 2px; color: var(--muted); font-size: 13px; }
.pager-btns { display: flex; align-items: center; gap: 10px; }

.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.st-pending.pill, .chip.st-pending::before { background: var(--pending-bg); color: var(--pending); }
.st-confirmed.pill { background: var(--confirmed-bg); color: var(--confirmed); }
.st-arrived.pill { background: var(--arrived-bg); color: var(--arrived); }
.st-completed.pill { background: var(--completed-bg); color: var(--completed); }
.st-cancelled.pill, .st-no_show.pill { background: var(--cancelled-bg); color: var(--cancelled); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 13px; color: var(--muted); }
.chip strong { color: var(--ink); }
.chip.dot::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.chip.dot.st-pending::before { background: var(--pending); }
.chip.dot.st-confirmed::before { background: var(--confirmed); }
.chip.dot.st-arrived::before { background: var(--arrived); }
.chip.dot.st-completed::before { background: var(--completed); }

/* profile */
.profile-layout { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: start; }
.stack { display: grid; gap: 18px; }
.profile h1 { font-size: 20px; margin-top: 12px; }
.sal { font-weight: 500; color: var(--muted); font-size: 15px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 24px; font-weight: 800; }
.alert { background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 8px 12px; margin-top: 12px; font-size: 14px; }
.facts { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 7px 12px; margin: 16px 0 0; font-size: 14px; }
.facts.two { grid-template-columns: 150px minmax(0, 1fr); margin-top: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.visit-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.visit { width: 100%; display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 12px; align-items: center; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.visit:hover { border-color: #a9c8ec; }
.visit small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.visit-when, .visit-what { font-weight: 600; }

/* dialogs and forms */
.dlg { border: 0; border-radius: 14px; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); box-shadow: 0 24px 60px rgba(20, 24, 40, 0.3); color: var(--ink); }
.dlg.wide { width: min(860px, calc(100vw - 32px)); }
.dlg::backdrop { background: rgba(25, 30, 50, 0.45); }
.dlg-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 2; }
.dlg-body { padding: 18px 20px 20px; }
.dlg-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }
fieldset { border: 0; padding: 0; margin: 0 0 20px; }
legend { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--brand); font-weight: 700; padding: 0; margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: grid; gap: 4px; align-content: start; min-width: 0; }
.field.wide, .check.wide { grid-column: 1 / -1; }
.field label { font-size: 13px; font-weight: 600; }
.field small { color: var(--muted); font-size: 12px; }
.req { color: var(--danger); }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check.inline { font-size: 13px; color: var(--muted); }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.form-error { color: var(--danger); font-weight: 600; min-height: 1px; }
.form-error:not(:empty) { background: var(--danger-soft); padding: 10px 12px; border-radius: 8px; margin-top: 4px; }
.form-context { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.picked { display: flex; justify-content: space-between; align-items: center; gap: 10px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px 6px 12px; background: #f7f9fb; }
.pick-results { list-style: none; margin: 4px 0 0; padding: 0; border-radius: 8px; overflow: hidden; }
.pick-results li button { width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: #f7f9fb; padding: 8px 12px; cursor: pointer; }
.pick-results li button:hover { background: var(--brand-soft); }
.pick-results small { color: var(--muted); }
.pick-results .none { padding: 8px 12px; color: var(--muted); font-size: 13px; }
.appt-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.appt-detail .facts { margin-top: 14px; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.log { margin-top: 18px; font-size: 13px; color: var(--muted); }
.log summary { cursor: pointer; font-weight: 600; }
.log ol { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 3px; }
.log li span { color: var(--ink); font-variant-numeric: tabular-nums; }

/* calendar */
.date-nav { display: flex; align-items: center; gap: 6px; }
.date-nav input { width: 160px; }
.cal-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cal-scroll { flex: 1; min-height: 320px; overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.cal { min-width: calc(64px + var(--cols) * 104px); }
.cal-head { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(104px, 1fr)); position: sticky; top: 0; z-index: 3; background: #fff; border-bottom: 1px solid var(--line); }
.cal-room { padding: 10px 8px; text-align: center; font-weight: 700; font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; border-left: 1px solid var(--line); }
.cal-body { display: grid; grid-template-columns: 64px repeat(var(--cols), minmax(104px, 1fr)); }
.cal-gutter .hour { font-size: 12px; color: var(--muted); text-align: right; padding: 2px 8px 0 0; border-top: 1px solid var(--line); }
.cal-gutter .hour:first-child { border-top: 0; }
.cal-col { position: relative; border-left: 1px solid var(--line); cursor: cell;
  background-image: linear-gradient(to bottom, var(--line) 1px, transparent 1px), linear-gradient(to bottom, #f0f2f5 1px, transparent 1px);
  background-size: 100% 88px, 100% 22px; background-position: 0 -1px, 0 -1px; }
.cal-col:hover { background-color: #f5f9fe; }
.appt { position: absolute; border: 0; border-left: 4px solid var(--pending); border-radius: 6px; background: var(--pending-bg); color: var(--ink); text-align: left; padding: 1px 6px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; font-size: 12px; line-height: 1.3; }
.appt:hover { filter: brightness(0.96); z-index: 2; }
.appt-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt-sub { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.st-confirmed { border-left-color: var(--confirmed); background: var(--confirmed-bg); }
.appt.st-arrived { border-left-color: var(--arrived); background: var(--arrived-bg); }
.appt.st-completed { border-left-color: var(--completed); background: var(--completed-bg); }
.appt.st-cancelled, .appt.st-no_show { border-left-color: var(--cancelled); background: var(--cancelled-bg); opacity: 0.75; }
.appt.st-cancelled .appt-name, .appt.st-no_show .appt-name { text-decoration: line-through; }
.appt.blocked { border-left-color: #8b95a1; background: repeating-linear-gradient(135deg, #e9edf1, #e9edf1 6px, #f5f7f9 6px, #f5f7f9 12px); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--brand); z-index: 1; pointer-events: none; }

#toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 999px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50; font-weight: 600; font-size: 14px; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.bad { background: var(--danger); }

@media (max-width: 860px) {
  .shell, body.rail-open .shell { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; }
  .rail { order: 2; flex-direction: row; border-right: 0; border-top: 1px solid var(--line); padding: 0; }
  .rail-toggle { display: none; }
  .rail nav { grid-auto-flow: column; grid-auto-columns: 1fr; width: 100%; gap: 0; }
  .rail nav a { justify-content: center; border-left: 0; border-top: 3px solid transparent; padding: 0; height: 52px; }
  .rail nav a span { display: none; }
  .rail nav a.on { border-top-color: var(--brand); }
  .topbar { padding: 8px 14px; }
  .brand-name small { display: none; }
  .outlet-pill select { max-width: 130px; }
  #view { padding: 16px; }
  .profile-layout { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  .visit { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Stage 2: consultation ---------- */
input[type=number], input[type=time] { border: 1px solid #d5dbe2; border-radius: 8px; padding: 8px 10px; background: #fff; width: 100%; min-height: 38px; }
textarea { resize: vertical; line-height: 1.45; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 5px; }
.tabs a { padding: 7px 12px; border-radius: 7px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14px; white-space: nowrap; }
.tabs a:hover { background: #eef4fb; color: var(--ink); }
.tabs a.on { background: var(--side); color: #fff; }
.count { display: inline-block; margin-left: 6px; font-size: 11px; padding: 0 6px; border-radius: 999px; background: rgba(0,0,0,0.08); }
.tabs a.on .count { background: rgba(255,255,255,0.22); }
.table-wrap.flat { border: 0; border-radius: 0; }
.table.plain tbody tr { cursor: default; }
.table.plain tbody tr:hover { background: none; }
.table.plain td { vertical-align: middle; }
.row-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
td.row-actions { display: table-cell; text-align: right; white-space: nowrap; }
td.row-actions .btn + .btn { margin-left: 6px; }
.is-void td:not(.row-actions) { color: var(--muted); }
.is-void .pill { margin-left: 8px; }
.records { display: grid; gap: 12px; }
.record { border: 1px solid var(--line); border-radius: 8px; padding: 14px; display: grid; gap: 10px; }
.record > header { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.lbl { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; margin-bottom: 2px; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.pre.inline { display: inline; }
.dx { display: inline-block; background: #eef0f6; border-radius: 6px; padding: 2px 8px; margin: 2px 6px 2px 0; font-size: 13px; }
.dx b { color: var(--side); }
.dx button { border: 0; background: none; cursor: pointer; font-size: 15px; line-height: 1; color: var(--muted); padding: 0 2px; }
.dx-chips:empty { display: none; }
.grid.three { grid-template-columns: repeat(3, 1fr); margin-bottom: 18px; }
.grid.vitals { grid-template-columns: repeat(5, 1fr); }
.bmi { margin-top: 8px; font-weight: 600; min-height: 18px; }
.pform > .alert { margin: 0 0 14px; }
.card > .alert { margin: 0 0 12px; }
.rx-rows { display: grid; gap: 6px; margin-bottom: 10px; }
.rx-row { display: grid; grid-template-columns: 2.2fr 1fr 1.5fr 1fr 0.6fr 1.6fr auto; gap: 6px; align-items: center; }
.rx-warn { color: var(--danger); font-weight: 600; font-size: 13px; }
.rx-warn:empty { display: none; }
.rx-list { margin: 0; padding-left: 18px; display: grid; gap: 4px; }
.fu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.fu-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: start; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.fu-list li.done .fu-body { color: var(--muted); text-decoration: line-through; }
.overdue { color: var(--danger); font-weight: 700; }

/* printable sheets */
.sheet { position: relative; border: 1px solid var(--line); border-radius: 8px; padding: 26px 28px; display: grid; gap: 14px; background: #fff; }
.sheet-head { display: flex; justify-content: space-between; gap: 16px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; }
.sheet-clinic { font-size: 18px; }
.sheet-no { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.sheet-title { text-align: center; font-size: 16px; color: var(--ink); letter-spacing: 0.14em; margin: 4px 0; }
.sheet-body { font-size: 16px; line-height: 1.7; }
.sheet-sign { margin-top: 36px; width: 240px; margin-left: auto; text-align: center; }
.sheet-sign .line { border-top: 1px solid var(--ink); margin-bottom: 6px; }
.sheet-table th, .sheet-table td { padding: 7px 8px; }
.void-stamp { position: absolute; inset: 0; display: grid; place-items: center; font-size: 96px; font-weight: 800; color: rgba(180, 35, 24, 0.22); transform: rotate(-18deg); pointer-events: none; letter-spacing: 0.1em; }

@media print {
  body > *:not(dialog.printable) { display: none !important; }
  dialog.printable { position: static; width: auto; max-width: none; max-height: none; box-shadow: none; border: 0; }
  dialog.printable::backdrop { background: none; }
  dialog.printable .dlg-head, .no-print { display: none !important; }
  .sheet { border: 0; padding: 0; }
}
@media (max-width: 860px) {
  .grid.three, .grid.vitals { grid-template-columns: 1fr 1fr; }
  .rx-row { grid-template-columns: 1fr 1fr; }
  .fu-list li { grid-template-columns: auto minmax(0, 1fr); }
}

/* ---------- sign-in and staff ---------- */
#gate { display: none; }
body.gated #gate { display: grid; place-items: center; position: fixed; inset: 0; background: var(--bg); padding: 16px; z-index: 40; overflow: auto; }
body.gated .shell { visibility: hidden; }
.gate-card { width: min(420px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; box-shadow: 0 12px 40px rgba(20,24,40,0.08); }
.gate-brand { padding: 0 0 18px; }
.gate-form { display: grid; gap: 14px; }
.gate-form h1 { font-size: 22px; }
.center { text-align: center; }
.btn.block + .btn.block { margin-top: 0; }
.readonly .needs-write { display: none !important; }
.level-help ul { margin: 0 0 18px; padding: 12px 14px 12px 30px; background: #f7f9fb; border-radius: 8px; font-size: 13px; display: grid; gap: 4px; color: var(--muted); }
.level-help strong { color: var(--ink); }
.warn-row td { background: #fff7f5; }

/* ---------- Stage 3: billing ---------- */
.dlg.xwide { width: min(1080px, calc(100vw - 32px)); }
.right { text-align: right; }
.spacer { flex: 1; }
.dlg-foot { align-items: center; }
.search-row { display: flex; gap: 8px; align-items: center; }
.search-row input { flex: 1; }
.bill-lines { margin: 14px 0; border: 1px solid var(--line); border-radius: 8px; }
.bill-lines td { padding: 8px 10px; }
.bill-lines input, .bill-lines select { min-height: 34px; padding: 6px 8px; }
.bill-lines input.qty { width: 70px; }
.bill-lines input.money { width: 96px; text-align: right; }
.bill-lines input[readonly] { background: #f4f6f8; color: var(--muted); }
.bill-lines select { width: 150px; }
.bill-foot { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start; }
.bill-totals { display: grid; gap: 6px; background: #f7f9fb; border-radius: 8px; padding: 12px 14px; font-variant-numeric: tabular-nums; }
.bill-totals > div { display: flex; justify-content: space-between; gap: 16px; }
.bill-totals .grand { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 2px; font-size: 17px; }
.bill-totals.right-col { width: min(340px, 100%); margin: 12px 0 0 auto; }
.bill-view .table-wrap.flat { border: 1px solid var(--line); border-radius: 8px; }
.claim-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; }
.claim-box select, .claim-box input { width: auto; min-height: 34px; padding: 5px 8px; }
.pay-list ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pay-list li { display: grid; grid-template-columns: 110px 150px minmax(0, 1fr) 110px auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid #edf0f3; font-size: 14px; }
.pay-list li.voided { color: var(--muted); text-decoration: line-through; }
.pay-form { margin-top: 18px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfd; }
.pay-form h3, .pay-list h3 { margin-top: 0; }
.pay-list { margin-top: 16px; }
.grid.four { grid-template-columns: repeat(4, 1fr); }
.change { font-weight: 700; color: var(--completed); }
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; }
.tile span { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 700; }
.tile strong { font-size: 24px; font-variant-numeric: tabular-nums; }
.tile small { color: var(--muted); }
a.chip { text-decoration: none; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.page-head + .tabs { margin-bottom: 16px; }
@media (max-width: 860px) {
  .bill-foot { grid-template-columns: 1fr; }
  .tiles, .grid.four { grid-template-columns: 1fr 1fr; }
  .pay-list li { grid-template-columns: 1fr 1fr; }
}

/* ---------- Kumodoc-style look (applies across every screen) ---------- */
#view { padding: 20px 26px 36px; }
.page-head h1 { font-size: 20px; color: var(--ink); }
.page-head h1::before { content: ""; display: inline-block; width: 4px; height: 18px; background: var(--brand); border-radius: 2px; margin-right: 10px; vertical-align: -2px; }

/* buttons: rounded pills, blue main action */
.btn { border-radius: 999px; padding: 9px 18px; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(30,136,229,.28); }
.btn.primary:hover { background: var(--brand-dark); }
.btn.ghost { border-color: #d5dbe2; background: #fff; color: var(--brand-dark); }
.btn.ghost:hover { border-color: var(--brand); background: var(--brand-soft); }
.btn.danger { color: var(--danger); border-color: #f4c7c5; background: #fff; }
.btn.sm { padding: 6px 13px; font-size: 12px; }
.round { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer; display: inline-grid; place-items: center; padding: 0 0 2px; }
.round:hover { background: var(--brand-dark); }
.round:disabled { background: #b9d9f6; cursor: default; }
.pager { color: var(--muted); font-size: 12px; }
.pager-btns { gap: 6px; }
.pager-btns > span { margin: 0 6px; }

/* inputs: soft rounded fields */
input[type=text], input[type=password], input[type=search], input[type=tel], input[type=email], input[type=date], input[type=number], input[type=time], select {
  border: 1px solid #d5dbe2; border-radius: 20px; padding: 8px 14px; background: #fff;
}
textarea { border: 1px solid #d5dbe2; border-radius: 12px; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(30,136,229,.15); }
input[type=search] { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%239aa4af' stroke-width='2' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-4-4'/%3E%3C/svg%3E") no-repeat right 12px center; padding-right: 36px; }
.field label { font-size: 12px; color: #5f6b78; }
legend { color: var(--brand); }
.check input { accent-color: var(--brand); }

/* cards and tables */
.card, .table-wrap, .tile, .cal-scroll { border-color: var(--line); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(20,30,50,.05); }
.table th { text-align: center; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; font-weight: 700; letter-spacing: .04em; padding: 13px 12px; border-bottom: 1px solid var(--line); }
.table td { text-align: center; vertical-align: middle; padding: 14px 12px; border-bottom-color: #eef1f4; }
.table td.right, .table th.right { text-align: right; }
.table tbody tr:hover { background: #f5f9fe; }
.table .name { text-transform: uppercase; font-weight: 700; color: #3c4450; letter-spacing: .01em; }
.table .sub { font-size: 12px; }
td.who .face { display: block; margin: 0 auto 6px; }
.face { width: 34px; height: 34px; border-radius: 50%; background: #e3e7ec url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Ccircle cx='12' cy='9' r='4.2'/%3E%3Cpath d='M3.5 22c.6-4.6 4-7.2 8.5-7.2s7.9 2.6 8.5 7.2z'/%3E%3C/svg%3E") center 60%/80% no-repeat; display: inline-block; }
.bill-lines .table th, .bill-lines .table td, .table.left th, .table.left td { text-align: left; }
.bill-lines .table th { text-decoration: none; }

/* tabs: Kumodoc's pill bar with a solid blue active pill */
.tabs { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; box-shadow: 0 1px 4px rgba(20,30,50,.06); flex-wrap: nowrap; overflow-x: auto; }
.tabs a { flex: 1 0 auto; text-align: center; padding: 8px 16px; border-radius: 999px; text-transform: uppercase; font-size: 12.5px; letter-spacing: .04em; color: #4f5a66; font-weight: 600; }
.tabs a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.tabs a.on { background: var(--brand); color: #fff; box-shadow: 0 2px 6px rgba(30,136,229,.3); }
.count { background: rgba(30,136,229,.12); color: var(--brand-dark); }
.tabs a.on .count { background: rgba(255,255,255,.25); color: #fff; }

/* chips and tags */
.chip { border-color: var(--line); background: #f7f9fb; }
.dx { background: var(--brand-soft); }
.dx b { color: var(--brand-dark); }
.tile strong { color: var(--ink); }
.tile span { color: var(--brand); }

/* dialogs: big white panels with a light title and grey close cross */
.dlg { border-radius: 10px; box-shadow: 0 20px 60px rgba(20,30,50,.28); }
.dlg::backdrop { background: rgba(30, 40, 55, 0.45); }
.dlg-head { border-bottom: 0; padding: 18px 22px 6px; }
.dlg-head h2 { font-size: 21px; font-weight: 400; text-transform: uppercase; color: #5f6b78; letter-spacing: .02em; }
.dlg-head .icon-btn { width: 26px; height: 26px; border-radius: 50%; background: #c7ced6; color: #fff; font-size: 18px; padding: 0; display: grid; place-items: center; }
.dlg-head .icon-btn:hover { background: #9aa4af; }
.dlg-body { padding: 12px 22px 22px; }

/* patient side panel, like Kumodoc's left profile column */
.profile { background: #f7f8fa; text-align: center; }
.profile .avatar { width: 96px; height: 96px; margin: 4px auto 0; font-size: 0; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23d3d8de'%3E%3Ccircle cx='12' cy='9' r='4.2'/%3E%3Cpath d='M3.5 22c.6-4.6 4-7.2 8.5-7.2s7.9 2.6 8.5 7.2z'/%3E%3C/svg%3E") center 65%/78% no-repeat; border: 3px solid #fff; box-shadow: 0 1px 6px rgba(20,30,50,.15); }
.profile h1 { color: var(--brand); text-transform: uppercase; font-size: 17px; line-height: 1.25; }
.profile .sal { color: var(--brand); font-size: 14px; }
.profile .facts { text-align: left; background: #fff; border-radius: 10px; padding: 12px; }
.alert { border-radius: 10px; }

/* calendar: lighter grid, blue room headers */
.cal-room { color: var(--brand); }
.now-line { background: var(--danger); }

/* sign-in page: soft blue backdrop with the form card on the right */
body.gated #gate { background: linear-gradient(115deg, #ffffff 0%, #eef6fe 45%, #d9ecfc 100%); }
.gate-wrap { width: min(440px, 100%); display: grid; gap: 14px; margin-left: auto; margin-right: max(0px, 8vw); }
.gate-tag { text-align: center; color: var(--brand); font-weight: 700; font-size: 20px; }
.gate-card { border-radius: 18px; border-color: #e6eef7; padding: 30px 32px; box-shadow: 0 14px 40px rgba(30,136,229,.12); }
.gate-brand { justify-content: center; padding-bottom: 20px; }
.gate-form h1 { text-align: center; font-size: 18px; color: #5f6b78; font-weight: 600; }
.gate-form .btn.primary { padding: 11px 18px; font-size: 14px; }
@media (max-width: 860px) { .gate-wrap { margin: 0 auto; } }
@media (min-width: 861px) { .page-head .head-actions { flex-wrap: nowrap; } .page-head { flex-wrap: nowrap; } }
.tabs { flex-shrink: 0; }
.price-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.price-bar .search { flex: 1; min-width: 220px; }
.tabs a { padding: 8px 12px; font-size: 12px; }

/* ---------- Stage 4: inventory ---------- */
.tile-btn { text-align: left; cursor: pointer; font: inherit; color: inherit; }
.tile-btn:hover { border-color: var(--brand); }
.tile-btn.on { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(30,136,229,.25); }
.tile-btn.warn strong { color: #e67700; }
.table td.left-cell { text-align: left; }
.onhand { font-size: 15px; }
.kind-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef0f3; color: #5f6b78; }
.kind-tag.k-medication { background: #f3e8fd; color: #8e44ad; }
.kind-tag.k-product { background: var(--brand-soft); color: var(--brand-dark); }
.kind-tag.k-consumable { background: #fff3e0; color: #c66a00; }
.kind-tag.k-vaccine { background: #e3f5e7; color: #2e7d32; }
.soon { color: #e67700; font-weight: 700; }
.stock-left { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 700; color: var(--completed); background: var(--completed-bg); border-radius: 999px; padding: 1px 8px; }
.stock-left.none { color: var(--danger); background: var(--danger-soft); }
.head-code { color: #f08c00; font-size: 15px; text-transform: none; }
.item-grid { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
.item-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 18px; box-shadow: 0 2px 10px rgba(20,30,50,.06); }
.item-pic { width: 84px; height: 84px; margin: 0 auto 8px; border-radius: 50%; background: linear-gradient(135deg, #e3f0fc, #cfe4f9); color: var(--brand); font-size: 34px; font-weight: 800; display: grid; place-items: center; }
.item-name { text-align: center; color: var(--ink); font-size: 16px; text-transform: uppercase; letter-spacing: .01em; margin: 4px 0 12px; }
.item-card .facts { font-size: 13px; }
.outlet-stock { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 13px; }
.outlet-stock li { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 8px; }
.outlet-stock li.here { background: var(--brand-soft); }
.ledger { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.ledger thead th { position: sticky; top: 0; background: #fff; z-index: 1; }
td.in { color: var(--completed); font-weight: 700; }
td.out { color: var(--danger); font-weight: 700; }
.doc-no { color: var(--brand); }
.bill-lines input.money { width: 96px; }
@media (max-width: 860px) { .item-grid { grid-template-columns: 1fr; } }

/* ---------- Stage 5: dashboard and reports ---------- */
.page-head + .tiles, .tiles + .tiles { margin-bottom: 14px; }
.tiles + .tiles { margin-top: -2px; }
a.tile-link { text-decoration: none; color: inherit; }
.tile-link small { font-size: 12.5px; }
.card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--brand); margin: 0; }
.chart { width: 100%; height: auto; display: block; }
.chart .bar { fill: #9ccbf5; }
.chart .bar:hover { fill: var(--brand-dark); }
.chart .bar.today { fill: var(--brand); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 11px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 14px; }
.dash-card { padding: 14px 16px; }
.dash-card .card-head { margin-bottom: 6px; }
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list li { border-top: 1px solid var(--line); }
.dash-list li:first-child { border-top: 0; }
.dash-list button { all: unset; box-sizing: border-box; width: 100%; display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 4px; cursor: pointer; border-radius: 8px; }
.dash-list button:hover { background: var(--brand-soft); }
.dash-list button:focus-visible { outline: 2px solid var(--focus); }
.dash-list .when { font-weight: 700; color: var(--brand-dark); font-size: 13px; }
.dash-list .who { font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.dash-list .who small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-list .rank { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 8px 4px; }
.dash-list .rank strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.dash-list .remind { display: block; padding: 9px 4px; color: var(--ink); text-decoration: none; }
.dash-list .remind strong { font-size: 17px; margin-right: 4px; color: var(--brand-dark); }
.dash-list .remind.bad strong { color: var(--danger); }
.empty.small { padding: 14px 4px; font-size: 13px; }
.rep-layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 20px; align-items: start; }
.rep-menu { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px 12px; position: sticky; top: 10px; box-shadow: 0 1px 3px rgba(20,30,50,.05); }
.rep-menu h3 { margin: 12px 8px 4px; color: var(--brand); }
.rep-menu a { display: block; padding: 7px 10px; border-radius: 999px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: 13.5px; }
.rep-menu a:hover { background: var(--brand-soft); color: var(--brand-dark); }
.rep-menu a.on { background: var(--brand); color: #fff; }
.rep-head h2 { margin: 0 0 2px; font-size: 18px; }
.rep-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rep-dates { display: flex; gap: 6px; align-items: center; }
.rep-dates input { width: 150px; }
.rep-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.rep-table th.num, .rep-table td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rep-table tfoot td { font-weight: 800; border-top: 2px solid var(--line); background: #f7f9fb; }
.rep-table tr.click { cursor: pointer; }
.rep-table tr.click:hover td { background: var(--brand-soft); }
@media (max-width: 900px) {
  .rep-layout { grid-template-columns: 1fr; }
  .rep-menu { position: static; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px; }
  .rep-menu > div { display: contents; }
  .rep-menu h3 { display: none; }
  .rep-menu a { border: 1px solid var(--line); padding: 6px 12px; font-size: 13px; }
}
@media print {
  .rail, .topbar, .rep-menu, .rep-bar, .rep-actions .head-actions, .page-head .head-actions { display: none !important; }
  .shell, .rep-layout { display: block !important; }
  .table-wrap { overflow: visible; box-shadow: none; }
}
.rep-table td.date { white-space: nowrap; }

/* ---------- Stage 6: messages, online booking ---------- */
.rail nav a { position: relative; }
.nav-badge { position: absolute; left: 30px; top: 6px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 800; display: grid; place-items: center; line-height: 1; }
.msg-list { display: grid; gap: 12px; }
.msg-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; box-shadow: 0 1px 3px rgba(20,30,50,.05); }
.msg-card.done { background: #f8fbf8; }
.msg-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.msg-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.msg-text { width: 100%; font: inherit; font-size: 13.5px; line-height: 1.5; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; resize: vertical; background: #fafcfe; }
.wa-btn.primary { background: #25a244; }
.wa-btn.primary:hover { background: #1e8a39; }
.sent-tag { color: var(--completed); font-size: 12.5px; font-weight: 600; }
.warn-line { margin: 0; color: #c56a00; font-size: 13px; }
.ob-facts { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 4px 12px; margin: 0; font-size: 13.5px; }
.ob-facts dd { margin: 0; }
.ob-match { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ob-match p { margin: 0; }
.msg-card .msg-card { box-shadow: none; background: #fafcfe; }
/* public booking page */
.book-page { background: linear-gradient(160deg, #eaf4fd 0%, #f7fbff 60%, #fff 100%); min-height: 100vh; }
.book-wrap { max-width: 560px; margin: 0 auto; padding: 28px 16px 40px; }
.book-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; justify-content: center; }
.book-card { background: #fff; border-radius: 18px; padding: 22px; box-shadow: 0 12px 40px rgba(30,80,140,.12); }
.book-card h1 { font-size: 22px; margin: 0 0 14px; }
.book-card .field { margin-bottom: 12px; display: grid; gap: 4px; }
.book-card .label { font-weight: 600; font-size: 13px; }
.slot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.slot { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 6px; font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; color: var(--ink); }
.slot:hover { border-color: var(--brand); }
.slot[aria-checked="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.btn.block { width: 100%; margin-top: 8px; }
.book-done { text-align: center; padding: 10px 0; }
.book-done .tick { width: 56px; height: 56px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); font-size: 30px; display: grid; place-items: center; margin: 0 auto 10px; font-weight: 800; }
.book-foot { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 16px; }
@media (max-width: 760px) { .nav-badge { left: auto; right: 22%; top: 4px; } }
.rep-bar > input[type=date] { width: 170px; }

/* ---------- Stage 7: roster, leave, commissions ---------- */
.pane-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pane-bar.end { justify-content: flex-end; }
.pane-bar select, .pane-bar input[type=month] { width: auto; min-width: 120px; }
.rs-range { min-width: 210px; text-align: center; font-size: 14px; }
.table.roster { table-layout: fixed; min-width: 980px; }
.table.roster th, .table.roster td { padding: 6px; vertical-align: top; }
.table.roster th.today { background: #eef4fb; }
.table.roster .rs-name { width: 190px; text-align: left; }
.table.roster td.rs-name small { display: block; color: var(--muted); font-size: 12px; }
.table.roster th:last-child, .table.roster td:last-child { width: 70px; }
.rs-cell.today { background: #f6f9fd; }
.rs-btn { all: unset; box-sizing: border-box; display: grid; gap: 4px; width: 100%; min-height: 44px; padding: 4px; border-radius: 8px; cursor: pointer; align-content: start; }
.rs-btn:hover, .rs-btn:focus-visible { background: #eef4fb; outline: 2px solid transparent; box-shadow: inset 0 0 0 1px var(--brand); }
.rs-add { color: #b8c4d2; font-size: 18px; text-align: center; line-height: 36px; }
.rs-shift { display: grid; background: var(--brand); color: #fff; border-radius: 7px; padding: 4px 6px; font-size: 12px; font-weight: 600; text-align: center; }
.rs-shift small { font-weight: 500; opacity: .9; font-size: 11px; }
.rs-shift.away { background: #e7ecf2; color: var(--muted); }
.rs-leave { display: inline-block; background: #fff1e0; color: #b25c00; border-radius: 7px; padding: 3px 6px; font-size: 12px; font-weight: 600; text-align: center; }
.table.roster tfoot td { font-size: 12px; color: var(--muted); font-weight: 600; }
.form-warn { margin: 0; padding: 9px 12px; border-radius: 10px; background: #fff6e8; color: #8a4b00; font-size: 13.5px; }
.btn.danger-ghost { background: transparent; color: var(--danger); border: 1px solid #f1c4c4; margin-right: auto; }
.btn.danger-ghost:hover { background: #fdf1f1; }
.click-row { cursor: pointer; }
.click-row:hover td, .click-row:focus-visible td { background: #f4f8fd; }
.bad { color: var(--danger); font-weight: 700; }
.table.rules td { vertical-align: top; }
.table.rules td > select, .table.rules td > input { width: auto; max-width: 100%; margin: 2px 4px 2px 0; }
.table.rules input[type=number] { width: 110px; }
.table.rules td > input[list] { width: 260px; display: block; margin-top: 6px; }
@media print {
  .tabs, .pane-bar, .rs-add { display: none !important; }
  .table.roster { min-width: 0; font-size: 11px; }
  .rs-shift { background: none; color: #000; border: 1px solid #999; }
}
.rs-shift.clash { background: #fff; color: var(--muted); border: 1px dashed #d9a35c; text-decoration: line-through; }
.statement td.date, .statement td:nth-child(2), .table td.date { white-space: nowrap; }

/* ---------- Stage 8: backups ---------- */
.stack.tight { gap: 8px; }
.tile.warn strong { color: #c56a00; }
a.form-warn.block-link { display: block; text-decoration: none; margin-bottom: 12px; }
a.form-warn.block-link:hover { background: #ffefd6; }

/* ---------- Kumodoc-style frame (menu, top bar, page background) ---------- */
:root { --page: #f7f8fa; }
.shell { grid-template-columns: 70px minmax(0, 1fr); }
body.rail-open .shell { grid-template-columns: 230px minmax(0, 1fr); }
.main { background: var(--page); }
#view { background: var(--page); }
.rail { padding: 0; }
.rail-head { display: flex; align-items: center; justify-content: center; height: 68px; border-bottom: 1px solid var(--line); flex: none; }
body.rail-open .rail-head { justify-content: space-between; padding: 0 10px 0 16px; }
.rail-brand { display: none; }
body.rail-open .rail-brand { display: flex; }
.rail-brand .brand-mark { width: 32px; height: 32px; font-size: 13px; }
.rail-brand .brand-name { font-size: 16px; }
.rail-toggle { margin: 0; padding: 0 12px; height: 40px; }
.rail nav { gap: 2px; padding-top: 10px; overflow-y: auto; }
.rail nav a { height: 44px; padding: 0 23px; gap: 16px; color: #2b95ee; font-weight: 500; }
.rail nav a span { color: #4a5563; }
.rail nav a.on { background: #eaf4fd; border-left-color: transparent; }
.rail nav a.on span { color: var(--brand-dark); font-weight: 700; }
.rail-foot { margin-top: auto; padding: 12px 16px 16px; border-top: 1px solid var(--line); display: none; font-size: 12px; color: var(--muted); }
body.rail-open .rail-foot { display: grid; gap: 2px; }
.rail-foot strong { color: var(--ink); font-size: 12.5px; text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar { min-height: 68px; padding: 0 22px; }
.topbar .outlet-pill { height: 40px; }
.top-right { display: flex; align-items: center; gap: 14px; }
.quick { display: flex; align-items: center; gap: 12px; }
.qbtn { position: relative; width: 46px; height: 46px; border-radius: 50%; background: #e9ecef; display: grid; place-items: center; color: #4a5563; text-decoration: none; transition: background .12s; }
.qbtn:hover { background: #dde3e8; color: var(--brand-dark); }
.qbtn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.qplus { position: absolute; right: 9px; bottom: 8px; width: 13px; height: 13px; border-radius: 50%; background: #2fa84f; color: #fff; font-size: 11px; line-height: 13px; text-align: center; font-weight: 800; }
.qbtn .nav-badge { left: auto; right: -2px; top: -3px; }
.me-btn { display: flex; align-items: center; gap: 2px; width: auto; height: auto; border-radius: 0; background: none !important; border: 0; padding: 0; box-shadow: none !important; cursor: pointer; }
.me-face { width: 48px; height: 48px; border-radius: 50%; background: #e3e7ec url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23ffffff'%3E%3Ccircle cx='12' cy='9' r='4.2'/%3E%3Cpath d='M3.5 22c.6-4.6 4-7.2 8.5-7.2s7.9 2.6 8.5 7.2z'/%3E%3C/svg%3E") center 65%/78% no-repeat; display: block; }
.me-caret { color: var(--brand); font-size: 18px; line-height: 1; margin-top: -8px; }
.me-menu { top: 58px; }
@media (max-width: 1100px) { .quick .qbtn:nth-child(n+5) { display: none; } }
@media (max-width: 860px) {
  .rail-head, .rail-foot { display: none !important; }
  .quick { display: none; }
  .shell, body.rail-open .shell { grid-template-columns: 1fr; }
}

/* ---------- Kumodoc-style dashboard ---------- */
.dash-hello { align-items: flex-end; flex-wrap: wrap; gap: 10px; }
.dash-hello h1::before { display: none; }
.hello-date { margin: 0; color: #6b7480; font-weight: 600; font-size: 13px; }
.dash-hello h1 { font-size: 19px; text-transform: uppercase; color: #333a44; letter-spacing: .01em; }
.dash-hello h1 { text-transform: none; }
.hello-upd { margin-left: 10px; font-size: 12px; font-weight: 600; color: #2fa84f; }
.dash-tools { display: flex; align-items: center; gap: 10px; }
.dash-tool { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: #4a5563; }
.dash-tool select { width: auto; min-width: 110px; }
.round-tool { width: 38px; height: 38px; border-radius: 50%; border: 1px solid #d5dbe2; background: #fff; color: var(--brand); font-size: 18px; cursor: pointer; }
.round-tool:hover { border-color: var(--brand); background: var(--brand-soft); }
.kstack { display: grid; gap: 16px; margin-bottom: 16px; }
.kgrid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kcard { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(20,30,50,.08); padding: 16px 18px 14px; min-width: 0; }
.ktitle { margin: 0; text-align: center; font-size: 17px; font-weight: 700; color: #3c4450; text-transform: none; letter-spacing: 0; }
.ksub { margin: 2px 0 0; text-align: center; color: #6b7480; font-size: 12.5px; }
.kchart { width: 100%; height: auto; display: block; margin-top: 8px; }
.kgrid { stroke: #e8ebef; stroke-width: 1; }
.kaxis { fill: #6b7480; font-size: 12px; }
.kcard.wide .kaxis { font-size: 13px; }
.klegend { display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; font-size: 12px; color: #4a5563; margin-top: 4px; }
.klegend span { display: inline-flex; align-items: center; gap: 6px; }
.klegend .ring { width: 11px; height: 11px; border-radius: 50%; border: 2px solid; display: inline-block; }
.klegend .sq { width: 14px; height: 9px; border-radius: 2px; display: inline-block; }
.kchips { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid #eef1f4; margin-top: 8px; padding-top: 10px; }
.kchip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e1e5ea; background: #fff; border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 700; color: #9aa4af; cursor: pointer; }
.kchip.on { color: #3c4450; border-color: #b8c1cb; }
.kchip .dot { width: 8px; height: 8px; border-radius: 50%; background: #a8d8f0; display: inline-block; }
.kchip.on .dot { background: #f5a623; }
.kchip .dot.o3 { background: #a8e3dc; } .kchip .dot.o4 { background: #f7b6c2; } .kchip .dot.o5 { background: #b7e4c7; }
.kchip.on .dot { background: #f5a623 !important; }
.tile, .card { background: #fff; }
@media (max-width: 1100px) { .kgrid3 { grid-template-columns: 1fr; } }

/* ---------- Kumodoc-style appointments calendar ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kt-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fff; margin: -20px -26px 0; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.kt-wrap { display: flex; align-items: center; gap: 6px; border: 1px solid #d5dbe2; border-radius: 20px; padding: 0 10px; height: 36px; background: #fff; }
.kt-wrap select { border: 0 !important; box-shadow: none !important; padding: 0 4px !important; min-height: 0; height: 34px; font-weight: 700; font-size: 13px; color: #3c4450; background: transparent; }
.kt-select.wide { max-width: 230px; }
.kt-count { background: #c7ced6; color: #fff; border-radius: 50%; width: 20px; height: 20px; font-size: 11px; display: grid; place-items: center; }
.kt-date { display: flex; align-items: center; gap: 6px; position: relative; }
.kt-arrow { border: 0; background: none; font-size: 22px; color: #6b7480; cursor: pointer; padding: 0 6px; }
.kt-cal { border: 0; background: none; cursor: pointer; font-size: 15px; filter: grayscale(1); }
.kt-hidden-date { position: absolute; left: 30px; top: 0; width: 1px !important; height: 1px; opacity: 0; padding: 0 !important; border: 0 !important; }
.kt-datetext { font-size: 15px; color: #3c4450; white-space: nowrap; }
.kt-today { border: 1px solid #d5dbe2; background: #fff; border-radius: 20px; height: 34px; padding: 0 14px; font-weight: 600; color: var(--brand-dark); cursor: pointer; }
.kt-spacer { flex: 1; }
.kt-filter { border: 1px solid #f5a623; background: #fff7ea; color: #c47d0e; border-radius: 20px; height: 34px; padding: 0 12px; cursor: pointer; font-weight: 700; }
.kt-filter b { font-size: 11px; }
.kt-search { width: 190px !important; flex: 0 1 190px; min-width: 120px; height: 36px; }
.kt-bar { flex-wrap: nowrap; } .kt-select.wide { max-width: 190px; }
@media (max-width: 1100px) { .kt-bar { flex-wrap: wrap; } }
.kfilter .check { display: flex; margin: 6px 0; }
.kcal-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 56px; height: calc(100vh - 68px - 61px); margin: 0 -26px -36px; }
.cal-scroll.k { border: 0; border-radius: 0; box-shadow: none; min-height: 0; height: 100%; }
.kcal-side { border-left: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; align-items: center; gap: 12px; padding-top: 52px; }
.ks-add { width: 40px; height: 40px; border-radius: 50%; border: 0; background: #1e88e5; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; box-shadow: 0 2px 6px rgba(30,136,229,.35); }
.ks-add:hover { background: var(--brand-dark); }
.ks-count { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #d5dbe2; display: grid; place-items: center; font-weight: 700; color: #4a5563; font-size: 13px; }
.cal-scroll.k .cal-head { border-bottom: 1px solid #dfe3e8; }
.cal-scroll.k .cal-room { color: #5b6470; font-size: 15px; font-weight: 700; padding: 12px 6px; border-left: 1px solid #e3e6ea; }
.cal-scroll.k .cal-gutter .hour { font-size: 12px; color: #4a5563; font-weight: 600; text-align: right; padding: 4px 6px 0 0; border-top: 1px solid #dfe3e8; }
.cal-scroll.k .cal-col { border-left: 1px solid #e3e6ea;
  background-image: repeating-linear-gradient(to bottom, #dfe3e8 0, #dfe3e8 1px, transparent 1px, transparent 88px),
                    repeating-linear-gradient(to bottom, transparent 0, transparent 21px, #eef0f3 21px, #eef0f3 22px); background-size: 100% 88px; }
.cal-scroll.k .cal-col:hover { background-color: #f7fafd; }
.appt.k { background: #f0f0f0; border: 0; border-left: 10px solid var(--tag); border-radius: 11px; padding: 3px 18px 3px 6px; gap: 0; font-size: 11px; line-height: 1.25; color: #3c4450; box-shadow: 0 0 0 1px rgba(0,0,0,.04); }
.appt.k .appt-name { font-weight: 800; font-size: 11px; letter-spacing: .01em; white-space: normal; }
.appt.k .appt-name small { font-weight: 700; font-size: 9px; color: #6b7480; }
.appt.k .appt-ref { font-weight: 700; font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt.k .appt-rem { font-style: italic; font-size: 10.5px; color: #4a5563; white-space: normal; overflow: hidden; }
.appt.k .appt-icons { position: absolute; top: 2px; right: 4px; font-size: 9px; display: flex; gap: 2px; }
.appt.k .appt-icons i { font-style: normal; display: inline-grid; place-items: center; width: 11px; height: 11px; border: 1px solid #6b7480; border-radius: 2px; font-size: 8px; }
.appt.k.st-cancelled, .appt.k.st-no_show { opacity: .55; }
.appt.k.st-cancelled .appt-name, .appt.k.st-no_show .appt-name { text-decoration: line-through; }
.appt.k.blocked { background: #f4f4f4; border: 1px solid #6f4a8e; border-left-width: 1px; color: #6f4a8e; }
.appt.k.dim { opacity: .25; }
.appt-hover { position: fixed; z-index: 50; width: 300px; background: #fff; border-radius: 6px; box-shadow: 0 8px 30px rgba(20,30,50,.25); overflow: hidden; text-align: center; padding-bottom: 12px; pointer-events: none; font-size: 12px; }
.appt-hover p { margin: 0; }
.ah-band { font-weight: 800; font-size: 12px; letter-spacing: .04em; padding: 4px 6px; }
.ah-paid { color: #2fa84f; font-size: 10px; font-weight: 700; text-align: left; padding: 6px 10px 0; }
.ah-ref { font-size: 19px; font-weight: 800; color: #4a5563; margin-top: 4px !important; }
.ah-svc { font-size: 11px; color: #6b7480; }
.ah-name { color: #2b95ee; font-weight: 800; font-size: 15px; margin-top: 8px !important; }
.ah-no { font-size: 10.5px; font-weight: 700; color: #4a5563; }
.ah-phone { font-weight: 700; font-size: 14px; color: #3c4450; margin-top: 2px !important; }
.ah-box { text-align: left; margin: 10px 10px 0; padding: 10px 12px; border-radius: 8px; box-shadow: 0 1px 6px rgba(20,30,50,.15); display: grid; gap: 3px; }
.ah-k { font-weight: 800; color: #3c4450; margin-top: 6px !important; }
.ah-red { color: #e03131; font-weight: 700; }
.ah-green { color: #2fa84f; font-weight: 700; }
.ah-tag { justify-self: start; margin-top: 8px; font-weight: 800; font-size: 11px; padding: 3px 8px; border-radius: 3px; }
@media (max-width: 860px) { .kt-bar { margin: -16px -16px 0; } .kcal-wrap { margin: 0 -16px -16px; height: calc(100vh - 220px); } .kt-datetext { min-width: 0; } }

/* ---------- Kumodoc-style lists (customers etc.) ---------- */
.k-actions { display: flex; gap: 12px; margin: 16px 0 6px; }
.k-round { width: 52px; height: 52px; border-radius: 50%; border: 0; color: #fff; font-size: 26px; font-weight: 700; cursor: pointer; box-shadow: 0 3px 8px rgba(20,30,50,.2); display: grid; place-items: center; }
.k-round.orange { background: #f5a033; font-size: 22px; }
.k-round.green { background: #5cb85c; font-size: 30px; }
.k-round:hover { filter: brightness(.95); }
.k-listbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 6px 0 4px; color: #3c4450; }
.k-show { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.k-size { width: 74px !important; border: 0 !important; border-bottom: 1px solid #c7ced6 !important; border-radius: 0 !important; text-align: center; }
.k-search { width: 240px; }
.k-list { background: transparent; }
.k-table { background: transparent; }
.k-table th { font-size: 14px; padding: 18px 10px; }
.k-table td { padding: 16px 10px; border-bottom: 1px solid #e3e6ea; }
.k-table tbody tr { cursor: pointer; }
.k-who { display: flex; align-items: center; gap: 14px; text-align: left !important; min-width: 300px; }
.face.big { width: 54px; height: 54px; flex: none; }
.k-icons { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.k-gender { font-weight: 900; font-size: 13px; }
.k-gender.male { color: #1e88e5; } .k-gender.female { color: #e64980; }
.k-dot { width: 10px; height: 10px; border-radius: 50%; background: #3fb950; display: inline-block; }
.k-name { display: block; color: #1e88e5; font-weight: 800; font-size: 15px; text-transform: uppercase; text-decoration: none; line-height: 1.2; }
.k-name:hover { text-decoration: underline; }
.k-age { color: #8a939e; font-weight: 800; font-size: 13px; }
.k-no { font-weight: 800; font-size: 11.5px; color: #3c4450; }
.k-wa { color: #2fa84f; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.wa-ico { width: 18px; height: 18px; border-radius: 50%; background: #25d366; color: #fff; font-size: 11px; display: grid; place-items: center; }
.k-yes { color: #2fa84f; font-weight: 700; font-size: 15px; }
.k-x { color: #e03131; font-weight: 700; }
.k-caps { font-weight: 800; color: #4a5563; text-transform: uppercase; font-size: 13.5px; }
.k-edit { border: 0; background: none; color: #1e88e5; font-size: 20px; cursor: pointer; }
.k-pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; font-size: 13px; color: #3c4450; }
.k-pager-r { display: flex; align-items: center; gap: 8px; }
.k-pager .round { width: 30px; height: 30px; }
.k-pager .round:disabled { background: #c5d9ef; }
.k-page { width: 64px !important; text-align: center; border: 0 !important; border-bottom: 1px solid #c7ced6 !important; border-radius: 0 !important; }
.k-listbar .k-search { width: 280px !important; flex: none !important; max-width: 50%; }

/* ---------- Kumodoc-style customer profile ---------- */
.ktabs-row { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.ktabs-row .tabs { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.ktabs-row .tabs::-webkit-scrollbar { display: none; }
.ktabs a { flex: 1 0 auto; min-width: 150px; }
.kt-round { flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #d5dbe2; background: #fff; color: var(--brand); font-size: 18px; cursor: pointer; line-height: 1; }
.profile-layout.k { grid-template-columns: 360px minmax(0, 1fr); }
.kprof { background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(20,30,50,.1); padding: 16px; display: grid; gap: 12px; position: sticky; top: 0; }
.kprof-top { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
.kprof-face { position: relative; display: grid; justify-items: center; gap: 4px; text-align: center; }
.kprof-face small { font-size: 10.5px; color: #4a5563; }
.face.xl { width: 72px; height: 72px; }
.kprof-pen { position: absolute; right: -2px; top: 48px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: #f5a033; color: #fff; font-size: 12px; cursor: pointer; }
.kprof-name { color: #1e88e5; font-size: 19px; font-weight: 800; text-transform: uppercase; line-height: 1.2; margin: 0 0 6px; }
.kprof-name::before { display: none !important; }
.kprof-line { margin: 2px 0; font-size: 11.5px; color: #4a5563; font-weight: 600; }
.kprof-joined { display: flex; justify-content: space-between; gap: 10px; font-size: 11.5px; color: #4a5563; }
.kprof-bar { height: 6px; background: #f1c6c6; border-radius: 3px; overflow: hidden; }
.kprof-bar i { display: block; height: 100%; background: #1f2a44; }
.kprof-money { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.kpm { border: 1px solid #e3e6ea; border-radius: 20px; padding: 6px 10px; text-align: center; display: grid; }
.kpm strong { font-size: 16px; color: #1f2a44; }
.kpm small { font-size: 10px; color: #6b7480; }
.kpm.red strong { color: #e03131; }
.kprof-facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.kprof-facts dt { font-size: 11px; color: #6b7480; }
.kprof-facts dd { margin: 0; font-weight: 800; font-size: 13px; color: #3c4450; }
.ksummary { position: relative; min-height: 300px; }
.k-round.small { width: 40px; height: 40px; font-size: 24px; position: absolute; left: 16px; top: 12px; }
.ksum-chips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.ksum-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #e3e6ea; border-radius: 999px; padding: 3px 12px; font-size: 12px; font-weight: 600; color: #3c4450; }
.ksum-chip i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.kempty { text-align: center; color: #4a5563; font-size: 13px; padding: 20px 0; }
.kempty-pic { font-size: 70px; filter: grayscale(.3); }
.btn.k-outline-green { border: 1px solid #2fa84f; color: #2fa84f; background: #fff; border-radius: 20px; }
.btn.k-outline-green:hover { background: #ebf8ee; }
@media (max-width: 900px) { .profile-layout.k { grid-template-columns: 1fr; } .kprof { position: static; } }

/* ---------- Kumodoc-style Sales ---------- */
.k-yearbox { display: grid; justify-items: center; gap: 4px; margin: 4px auto 6px; font-weight: 700; color: #3c4450; }
.k-year { width: 140px !important; text-align: center; }
.k-total { text-align: right; font-weight: 800; color: #e03131; margin: 0; }
.k-print { color: #1e88e5; font-size: 18px; }
.k-date { font-size: 13px; color: #3c4450; white-space: nowrap; }
.k-so { display: inline-flex; align-items: center; gap: 8px; }
.k-so a, .k-blue { color: #1e88e5; font-weight: 800; text-decoration: none; }
.k-state { width: 12px; height: 12px; border-radius: 50%; display: inline-block; background: #3fb950; }
.k-state.unpaid { background: #e03131; } .k-state.partly_paid { background: #f5a623; } .k-state.draft { background: #9aa4af; } .k-state.void { background: #3c4450; }
.k-amt { font-weight: 800; font-size: 16px; color: #3c4450; }
.k-person { display: grid; justify-items: center; gap: 2px; }
.k-person strong { font-size: 13.5px; color: #3c4450; }
.k-person .face.big { width: 48px; height: 48px; }
.k-sub { font-size: 12.5px; color: #6b7480; }
.k-sub b { font-size: 11px; color: #3c4450; }
.k-glance { background: #f1f3f5; border-radius: 14px; padding: 14px; }
.k-glance-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.k-glance-head h2 { margin: 0; font-size: 20px; color: #3c4450; }
.k-glance-date { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; color: #6b7480; }
.k-upd { font-size: 12px; font-weight: 700; color: #2fa84f; }
.k-outletsel { width: 200px !important; }
.k-glance-grid { display: grid; grid-template-columns: 340px repeat(3, minmax(0, 1fr)); grid-template-rows: auto auto; gap: 12px; }
.k-glance-card { background: #fff; border-radius: 10px; padding: 12px 14px; box-shadow: 0 1px 3px rgba(20,30,50,.06); min-width: 0; }
.k-glance-card.tall { grid-row: span 2; display: flex; flex-direction: column; }
.k-glance-card.wide { grid-column: span 3; }
.k-glance-card.green { border-top: 3px solid #5cbf7d; }
.k-glance-card.purple { border-top: 3px solid #5c62c0; }
.k-gc-title { margin: 0 0 6px; font-size: 16px; color: #3c4450; text-transform: none; letter-spacing: 0; display: flex; align-items: center; gap: 8px; }
.k-gc-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.k-big { font-size: 27px; font-weight: 800; color: #3c4450; margin: 0; }
.k-big small { font-size: 16px; color: #6b7480; }
.k-donut { width: 120px; height: 120px; flex: none; }
.k-chg { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.k-chg.up { background: #e6f6ea; color: #2fa84f; } .k-chg.down { background: #fdecec; color: #e03131; } .k-chg.flat { background: #f1f3f5; color: #6b7480; }
.k-legend { list-style: none; padding: 0; margin: auto 0 0; display: grid; gap: 4px; font-size: 13px; }
.k-legend li { display: grid; grid-template-columns: 14px 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid #eef1f4; padding: 3px 0; }
.k-legend li i { width: 9px; height: 9px; border-radius: 50%; }
.k-legend li.net { grid-template-columns: 1fr auto; font-weight: 800; padding-left: 22px; }
.k-gc-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding-top: 10px; border-top: 1px solid #eef1f4; font-size: 15px; }
.k-gc-foot .red { color: #e03131; }
.k-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.k-pillcount { margin-left: auto; font-size: 12px; font-weight: 600; border: 1px solid #d5dbe2; border-radius: 999px; padding: 2px 10px; }
.k-cust { width: 100%; border-collapse: collapse; font-size: 13px; }
.k-cust th { font-size: 12px; color: #6b7480; text-align: right; font-weight: 700; padding: 4px; }
.k-cust td { text-align: right; padding: 8px 4px; font-weight: 700; border-bottom: 1px solid #eef1f4; }
.k-cust td:first-child { text-align: left; font-weight: 600; }
.k-cust .k-chg { display: block; width: max-content; margin: 2px 0 0 auto; }
.dotc { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 8px; }
.k-top { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.k-top th { color: #6b7480; font-weight: 700; text-align: left; padding: 4px; }
.k-top th:last-child, .k-top td:last-child { text-align: center; width: 64px; }
.k-top td { padding: 7px 4px; border-bottom: 1px solid #eef1f4; vertical-align: middle; height: 38px; }
.k-top strong { font-size: 12.5px; color: #3c4450; }
.k-rank { width: 26px; color: #6b7480; }
@media (max-width: 1200px) { .k-glance-grid { grid-template-columns: 1fr 1fr; } .k-glance-card.wide { grid-column: span 1; } .k-glance-card.tall { grid-row: span 1; } .k-split { grid-template-columns: 1fr; } }
.k-gear { color: #b8c1cb; font-size: 22px; }
.k-desc { color: #1e88e5; font-weight: 800; font-size: 14.5px; text-align: center; }
.k-type { font-weight: 800; font-size: 13px; }
.k-type.t-service { color: #f06595; } .k-type.t-lab { color: #7950f2; } .k-type.t-vaccine { color: #12b886; }
.k-type.t-medication { color: #e64980; } .k-type.t-product { color: #1c4fa0; } .k-type.t-consumable { color: #f08c00; }
.k-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.k-filter-sel { width: auto !important; }
.k-thumb { display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 6px; background: #f1f3f5; color: #b8c1cb; font-size: 20px; }
.k-desc.left { text-align: left !important; }
.k-stockdet { font-size: 12px; font-weight: 600; color: #1e88e5; margin-top: 2px; }
.k-small { font-size: 12.5px; color: #3c4450; }
.k-stock { color: #1e88e5; font-weight: 800; font-size: 16px; white-space: nowrap; }
.k-stock small { display: block; font-size: 10.5px; color: #6b7480; font-weight: 600; }
.k-stock.low { color: #f08c00; } .k-stock.neg { color: #e03131; }
.roster-bar { margin: -20px -26px 0; }
.table.roster .rs-name { width: 230px; }
.rs-emp { display: flex; align-items: center; gap: 10px; text-align: left; }
.rs-emp .face.big { width: 46px; height: 46px; flex: none; }
.rs-emp strong { display: block; color: #1e88e5; font-size: 12.5px; line-height: 1.2; }
.rs-emp small { display: block; font-size: 10.5px; color: #6b7480; }
.rs-emp b { display: block; font-size: 10.5px; color: #3c4450; }
.rs-ok { display: inline-grid; place-items: center; width: 12px; height: 12px; background: #3fb950; color: #fff; font-size: 8px; font-style: normal; border-radius: 2px; }
.table.roster th { color: #5b6470; text-decoration: none; font-size: 12.5px; }
.k-actions.spread { justify-content: space-between; align-items: center; }
.k-link { color: #1e88e5; text-decoration: underline; font-size: 13px; }
.k-verified { color: #1e88e5; font-size: 12px; }

/* ---------- Kumodoc-style reports ---------- */
.rep-layout.k { grid-template-columns: 380px minmax(0, 1fr); gap: 0; margin: -20px -26px -36px; min-height: calc(100vh - 68px); }
.rep-menu.k { background: #fff; border: 0; border-right: 1px solid var(--line); border-radius: 0; padding: 16px 20px; box-shadow: none; position: static; max-height: none; display: grid; align-content: start; gap: 14px; }
.k-repsearch-wrap { display: flex; justify-content: center; }
.k-repsearch { width: 80% !important; border-radius: 22px !important; height: 40px; }
.k-repgroup { border-radius: 14px; box-shadow: 0 2px 8px rgba(20,30,50,.1); background: #fff; overflow: hidden; }
.k-repgroup summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px; padding: 16px 20px; font-weight: 800; font-size: 15px; color: #4a5563; }
.k-repgroup summary::-webkit-details-marker { display: none; }
.k-repico { font-size: 22px; }
.k-chev { margin-left: auto; color: #6b7480; transition: transform .15s; }
.k-repgroup:not([open]) .k-chev { transform: rotate(-90deg); }
.rep-menu.k a { display: block; padding: 9px 22px; color: #4a5563; font-weight: 700; font-size: 13.5px; text-decoration: none; border-radius: 0; background: #fbfbfc; }
.rep-menu.k a:hover { background: #eef4fb; color: var(--brand-dark); }
.rep-menu.k a.on { background: #eaf4fd; color: var(--brand-dark); }
.rep-layout.k > .stack { padding: 18px 26px 36px; }
.k-rephead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.k-rephead h2 { margin: 0; font-size: 30px; font-weight: 800; color: #4a5563; text-transform: none; letter-spacing: 0; }
.k-reptools { display: flex; align-items: center; gap: 10px; }
.k-rt { width: 40px; height: 40px; border-radius: 50%; border: 0; color: #fff; font-size: 17px; cursor: pointer; }
.k-rt.print { background: #8fd0ef; } .k-rt.dl { background: #8fd19e; }
.k-rt:disabled { opacity: .5; cursor: default; }
@media (max-width: 900px) { .rep-layout.k { grid-template-columns: 1fr; margin: -16px; } }
.k-person strong.k-blue { color: #1e88e5; }

/* Kumodoc keeps the menu as a vertical bar on the left at every computer and tablet size.
   Only on a phone-sized screen (520px or less) does it move to the bottom. */
@media (min-width: 521px) and (max-width: 860px) {
  .shell { grid-template-columns: 70px minmax(0, 1fr) !important; grid-template-rows: none !important; }
  body.rail-open .shell { grid-template-columns: 230px minmax(0, 1fr) !important; }
  .rail { order: 0; flex-direction: column; border-right: 1px solid var(--line); border-top: 0; padding: 0; }
  .rail-head { display: flex !important; }
  .rail-toggle { display: flex; }
  .rail nav { grid-auto-flow: row; grid-auto-columns: auto; width: auto; gap: 2px; }
  .rail nav a { justify-content: flex-start; border-left: 3px solid transparent; border-top: 0; padding: 0 23px; height: 44px; }
  .rail nav a span { display: inline; }
  .rail nav a.on { border-top-color: transparent; }
  body.rail-open .rail-foot { display: grid !important; }
  .nav-badge { left: 30px; right: auto; top: 6px; }
}

/* photos kept with a patient record */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.photo-grid figure { margin: 0; }
.photo-grid img { width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line, #e5e7eb); display: block; }
.photo-grid figcaption { margin-top: 4px; }
/* grid children may shrink, so wide tables scroll inside their card instead of pushing the page wider */
.profile-layout > *, .stack > * { min-width: 0; }

/* letters kept from Kumodoc */
.letter-body { width: 100%; min-height: 160px; border: 0; display: block; margin: 8px 0; background: #fff; }
.letter-sig { max-height: 80px; max-width: 220px; display: block; }

/* cash wallet on the patient's Sales tab */
.wallet-card .row-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.wallet-balance { margin: 0 0 8px; font-size: 1.05rem; }
.wallet-balance strong { font-size: 1.4rem; }
.wallet-card tr.voided td { opacity: .55; text-decoration: line-through; }

/* price range on a bill line (Kumodoc: 200.00 - 500.00) */
.price-range { font-size: 11px; color: #6b7a90; margin-top: 2px; white-space: nowrap; }
.price-range.bad { color: #c62828; font-weight: 600; }
input.money.invalid { border-color: #c62828; background: #fff5f5; }

/* Kumodoc-style status pill and sub-tabs on a customer's Sales / Payments tabs */
.k-status { display: inline-block; min-width: 110px; padding: 5px 14px; border-radius: 6px; font-size: 12px; text-align: center; }
.k-status.on { background: #e3f4e4; color: #1f5e24; }
.k-status.off { background: #fde7e7; color: #a02020; }
.k-status.hold { background: #fff3d6; color: #8a5a00; }
.tabs.k-subtabs { display: inline-flex; gap: 0; background: #fff; border: 1px solid #dfe6f0; border-radius: 999px; padding: 3px; }
.tabs.k-subtabs a { padding: 6px 28px; border-radius: 999px; font-size: 12px; font-weight: 700; text-transform: uppercase; color: #3b4a5f; text-decoration: none; }
.tabs.k-subtabs a.on { background: #3d8be0; color: #fff; }

/* a sale's automatic case note, laid out as a receipt like Kumodoc's */
.sale-note { font-size: 12.5px; max-width: 720px; }
.sale-note .sale-head { display: grid; grid-template-columns: 120px 1fr; gap: 2px 10px; margin: 4px 0 10px; }
.sale-note .sale-head dt { color: #5b6b80; font-weight: 600; }
.sale-note .sale-head dd { margin: 0; font-weight: 700; }
.sale-note table.sale-lines { width: 100%; border-collapse: collapse; }
.sale-note table.sale-lines th { text-align: left; font-size: 11px; text-transform: uppercase; color: #5b6b80; border-bottom: 1px solid #d9e1ec; padding: 4px 6px; }
.sale-note table.sale-lines td { padding: 4px 6px; border-bottom: 1px dotted #e3e9f2; }
.sale-note table.sale-lines .right { text-align: right; }
.sale-note table.sale-lines tfoot td { border-bottom: none; }
.sale-note table.sale-lines tfoot tr.strong td { font-weight: 700; border-top: 1px solid #d9e1ec; }
.sale-note .sale-pay { margin-top: 8px; }

/* customer profile: narrow strip beside every tab except Timeline (Kumodoc) */
.profile-layout.k.strip { grid-template-columns: 150px minmax(0, 1fr); }
.kstrip { background: #fff; border-radius: 12px; padding: 16px 10px; text-align: center; display: grid; gap: 6px; justify-items: center; box-shadow: 0 1px 3px rgba(20, 40, 80, .06); position: sticky; top: 12px; }
.kstrip .face.xl { width: 84px; height: 84px; }
.kstrip-name { color: #2f7fd6; font-weight: 800; font-size: 14px; text-transform: uppercase; text-decoration: none; line-height: 1.2; }
.kstrip-no { font-size: 11px; font-weight: 700; }
.kstrip small { font-size: 9px; font-weight: 700; }
.kstrip-line { font-size: 10.5px; font-weight: 600; line-height: 1.3; margin-top: 8px; word-break: break-word; }
.kstrip-alert { font-size: 11px; text-align: left; margin: 4px 0 0; }
@media (max-width: 900px) { .profile-layout.k.strip { grid-template-columns: 1fr; } .kstrip { position: static; } }

/* case notes: past notes on the left, the editor always open on the right (Kumodoc) */
.cn-split { display: grid; grid-template-columns: minmax(300px, 40%) minmax(0, 1fr); gap: 14px; align-items: start; }
.cn-split.read-only { grid-template-columns: 1fr; }
.cn-left { background: #fff; border-radius: 12px; padding: 12px; box-shadow: 0 1px 3px rgba(20, 40, 80, .06); }
.cn-search { width: 100%; margin-bottom: 10px; }
.cn-notes { display: grid; gap: 14px; max-height: calc(100vh - 210px); overflow-y: auto; padding-right: 4px; }
.cn-note { border-bottom: 1px solid #e3e9f2; padding-bottom: 12px; display: grid; gap: 6px; font-size: 12.5px; }
.cn-note.is-cancelled { opacity: .55; }
.cn-note > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cn-date { font-size: 13.5px; }
.cn-by { font-size: 11px; font-weight: 700; margin-top: 2px; }
.cn-chips { display: flex; gap: 6px; align-items: center; }
.cn-meta { font-size: 11px; font-weight: 700; margin: 0; }
.cn-service { color: #2f7fd6; font-weight: 700; font-size: 11.5px; text-transform: uppercase; margin: 0; }
.cn-note p { margin: 0; }
.cn-note .sale-note { font-size: 11.5px; }
.cn-right { background: #fff; border-radius: 12px; padding: 14px; box-shadow: 0 1px 3px rgba(20, 40, 80, .06); position: sticky; top: 12px; }
.cn-form { display: grid; gap: 10px; }
.cn-tools { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.cn-tools-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; flex: 1; min-width: 260px; }
.k-round.tool { width: 44px; height: 44px; font-size: 20px; background: #3d8be0; }
.k-round.tool.sm { width: 28px; height: 28px; font-size: 14px; box-shadow: none; }
.cn-form textarea[name=note] { min-height: 300px; resize: vertical; }
.cn-form .field > label[for=f_note] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.cn-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.cn-actions { display: flex; gap: 8px; align-items: center; }
.cn-editing { margin: 0; font-size: 12px; font-weight: 700; color: #8a5a00; background: #fff3d6; padding: 6px 10px; border-radius: 6px; }
@media (max-width: 1100px) { .cn-split { grid-template-columns: 1fr; } .cn-right { position: static; } .cn-notes { max-height: none; } .cn-bottom { grid-template-columns: 1fr; } }

/* ---------- appointment panel, laid out like Kumodoc's ---------- */
dialog.kap { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: #f5f6f8; color: var(--ink); overflow: hidden; }
dialog.kap[open] { display: flex; flex-direction: column; }
.kap-head { background: #fff; display: flex; align-items: flex-start; gap: 18px; padding: 10px 56px 8px 28px; position: relative; flex: none; }
.kap-cust { display: flex; gap: 18px; flex: 1 1 0; min-width: 0; }
.kap-cust .face.xl { width: 78px; height: 78px; flex: none; }
.kap-id { min-width: 0; }
.kap-nameline { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.kap-name { color: #1e7fd6; font-weight: 800; font-size: 17px; text-decoration: none; letter-spacing: .01em; }
.kap-name.plain { color: #3c4450; }
.kap-no { font-size: 11px; font-weight: 700; color: #3c4450; }
.kap-bar { height: 5px; border-radius: 3px; background: #1e7fd6; margin: 4px 0 6px; max-width: 390px; }
.kap-line { margin: 0; font-size: 12.5px; line-height: 1.65; color: #4a5563; white-space: pre-wrap; }
.kap-red { color: #d32f2f; }
.kap-alert { margin: 2px 0 4px; font-size: 12px; }
.kap-book { flex: 0 1 780px; background: #fff; border-radius: 0 0 26px 26px; box-shadow: 0 4px 14px rgba(20, 30, 50, .18); padding: 8px 20px 14px; margin-top: -10px; }
.kap-book-top { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; color: #5f6b78; }
.kap-ref { font-size: 17px; color: #3c4450; }
.kap-tagrow { display: flex; justify-content: flex-end; margin: 2px 0 0; }
.kap-chip { display: inline-block; border-radius: 6px; padding: 3px 10px; font-size: 11px; font-weight: 800; color: #3c4450; background: #e6e9ee; letter-spacing: .02em; }
.kap-chip.room { background: #9be7f1; color: #1c7f8c; }
.kap-chip.dur { background: #74e0cf; color: #146a5c; }
.kap-chip.right { margin-left: auto; }
.kap-sts { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.kap-st { border: 0; border-radius: 999px; padding: 9px 20px; font-size: 13px; font-weight: 800; letter-spacing: .06em; cursor: pointer; font-family: inherit; display: inline-flex; align-items: center; gap: 6px; }
.kap-st.pending { background: #fff; color: #5d93c9; box-shadow: inset 0 0 0 2px #8fb9e3; }
.kap-st.confirmed { background: #dcebfb; color: #1565c0; box-shadow: 0 4px 0 #1565c0; }
.kap-st.arrived { background: #fdf1c4; color: #8a6400; box-shadow: 0 4px 0 #a37a00; }
.kap-st.started { background: #cfe9d2; color: #1f6b2c; box-shadow: 0 4px 0 #2e7d32; }
.kap-st.no_show, .kap-st.cancelled { background: #fbd9d9; color: #a31515; box-shadow: 0 4px 0 #a31515; }
.kap-st.completed { background: #d5efd9; color: #1f6b2c; }
.kap-st:disabled { background: #dcdcdc; color: #9a9a9a; box-shadow: 0 4px 0 #a9a9a9; cursor: not-allowed; }
.kap-st.on { box-shadow: inset 0 0 0 2px currentColor; transform: translateY(3px); cursor: default; }
.kap-st.pending.on { box-shadow: inset 0 0 0 2px #8fb9e3; }
.kap-st:not(.on):not(:disabled):hover { filter: brightness(.96); }
.kap-bill { width: 42px; height: 42px; border-radius: 50%; border: 2px solid #2e9a47; background: #fff; color: #2e9a47; font-size: 20px; font-weight: 700; cursor: pointer; margin-left: 6px; }
.kap-x { position: absolute; top: 8px; right: 14px; border: 0; background: none; font-size: 20px; cursor: pointer; color: #3c4450; padding: 6px; }
.tabs.kap-tabs { margin: 8px 24px 0; flex: none; }
.tabs.kap-tabs a { flex: 1 1 0; font-weight: 700; font-size: 13.5px; padding: 10px 16px; }
.kap-body { flex: 1 1 auto; overflow: auto; padding: 22px 28px 110px; }
.kap-over { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 36px; align-items: start; }
.kap-left { display: grid; gap: 10px; }
.kap-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 5px rgba(20, 30, 50, .14); padding: 16px 20px; }
.kap-card h3 { text-transform: none; letter-spacing: 0; margin: 0; font-size: 16.5px; color: #3c4450; }
.kap-svc { margin: 0 0 8px; font-weight: 800; font-size: 12px; color: #3c4450; }
.kap-small { margin: 4px 0; font-size: 11px; color: #5f6b78; }
.kap-where { margin: 8px 0; font-size: 12.5px; color: #3c4450; }
.kap-item { margin: 10px 0; display: grid; gap: 2px; color: #1565c0; font-weight: 700; font-size: 12.5px; }
.kap-rem { margin: 6px 0; font-size: 12px; font-style: italic; color: #4a5563; white-space: pre-wrap; }
.kap-chips { display: flex; gap: 6px; align-items: center; border-top: 1px solid #eef0f3; margin: 14px -20px -8px; padding: 8px 10px 0; }
.kap-loghead { display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none; padding: 0; cursor: pointer; font-family: inherit; color: #3c4450; }
.kap-h { font-size: 20px; font-weight: 700; flex: 1; text-align: left; }
.kap-arrow { width: 20px; height: 20px; border-radius: 50%; background: #1e88e5; color: #fff; font-size: 13px; display: grid; place-items: center; }
.kap-ico { width: 30px; height: 30px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 16px; flex: none; }
.kap-ico.blue { background: #1c54b2; }
.kap-ico.gold { background: #f7b731; color: #fff; font-weight: 800; }
.kap-ico.log { background: #fde2e2; }
.kap-log { margin-top: 12px; overflow-x: auto; }
.kap-log table { width: 100%; border-collapse: collapse; font-size: 12px; }
.kap-log th { color: #1565c0; text-decoration: underline; text-transform: uppercase; font-size: 12px; padding: 6px 8px; text-align: center; border-bottom: 1px solid #e4e8ed; }
.kap-log td { padding: 8px; text-align: center; border-bottom: 1px solid #e4e8ed; }
.kap-sec { text-transform: none; letter-spacing: 0; display: flex; align-items: center; gap: 10px; font-size: 20px; color: #3c4450; margin: 0 0 14px; }
.kap-right .kap-card { margin-bottom: 26px; }
.kap-empty { text-align: center; padding: 14px 0 10px; font-size: 12px; font-weight: 700; color: #3c4450; }
.kap-empty p { margin: 8px 0 0; }
.kap-empty-ico { width: 36px; height: 36px; border-radius: 50%; background: #dfe6f3; display: inline-grid; place-items: center; font-size: 18px; opacity: .8; }
.kap-hands { margin: 0; padding-left: 18px; font-size: 13px; }
.kap-foot { position: absolute; right: 16px; bottom: 12px; display: flex; align-items: flex-start; gap: 12px; }
.kap-round { width: 52px; height: 52px; border-radius: 50%; background: #fff; border: 2px solid; font-size: 24px; cursor: pointer; display: grid; place-items: center; box-shadow: 0 3px 8px rgba(20, 30, 50, .22); }
.kap-round.orange { color: #f0a030; border-color: #f0a030; }
.kap-round.green { color: #4caf50; border-color: #4caf50; font-size: 30px; }
.kap-round.red { color: #e05252; border-color: #e05252; }
.kap-round.tick { background: #5cb85c; border-color: #5cb85c; color: #fff; }
.kap-round:hover { filter: brightness(.95); }
.kap-done { display: grid; justify-items: center; gap: 4px; font-size: 12px; color: #3c4450; }
@media (max-width: 1000px) { .kap-head { flex-direction: column; padding-right: 40px; } .kap-book { margin-top: 0; border-radius: 16px; flex: none; width: 100%; } .kap-over { grid-template-columns: 1fr; gap: 16px; } }

/* ---------- bill view, laid out like Kumodoc's sale window ---------- */
.dlg.ksale { width: min(1300px, calc(100vw - 32px)); background: #eef4fb; }
.dlg.ksale .dlg-head { background: transparent; padding: 10px 14px 0; position: absolute; right: 0; top: 0; z-index: 3; }
.dlg.ksale .dlg-head .icon-btn { background: none; color: #3c4450; font-size: 24px; }
.dlg.ksale .dlg-body { padding: 18px 46px 18px 14px; }
.dlg.ksale .bill-view { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
.ks-left { display: grid; gap: 14px; min-width: 0; }
.ks-right { display: grid; gap: 14px; }
.ks-card { background: #fff; border-radius: 14px; padding: 16px 18px; }
.ks-title { display: flex; align-items: center; gap: 12px; }
.ks-title h3 { margin: 0; font-size: 22px; color: #3c4450; text-transform: none; letter-spacing: 0; }
.ks-when { margin: 0 0 10px; font-size: 11.5px; color: #4a5563; }
.ks-who { display: flex; align-items: center; gap: 8px; border-top: 1px solid #e8ecf1; padding-top: 10px; flex-wrap: wrap; }
.ks-who .spacer { flex: 1; }
.ks-name { color: #1e88e5; font-weight: 800; font-size: 13.5px; text-decoration: none; text-transform: uppercase; }
.ks-no { font-size: 12px; font-weight: 700; color: #5f6b78; }
.ks-btn { border: 1px solid #1e9fc4; color: #1e9fc4; background: #fff; border-radius: 999px; padding: 8px 22px; font-size: 14px; cursor: pointer; font-family: inherit; }
.ks-btn:hover { background: #eaf7fb; }
.ks-items { padding: 12px 18px; max-height: 62vh; overflow-y: auto; }
.ks-row { display: grid; grid-template-columns: minmax(0, 1fr) 90px 100px 100px 100px; gap: 6px; align-items: center; font-size: 13.5px; color: #3c4450; }
.ks-row > span { text-align: center; }
.ks-headrow { color: #1565c0; font-weight: 700; font-size: 13px; padding: 10px 0 12px; border-bottom: 1px solid #dfe4ea; position: sticky; top: -12px; background: #fff; z-index: 1; }
.ks-headrow > span:first-child { text-align: left; }
.ks-item { padding: 12px 0 10px; border-bottom: 1px solid #dfe4ea; }
.ks-item:last-child { border-bottom: 0; }
.ks-desc { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.ks-desc strong { font-size: 14.5px; text-transform: uppercase; }
.ks-gear { width: 38px; text-align: center; color: #c3c9d1; font-size: 20px; flex: none; }
.ks-dot { width: 13px; height: 13px; border-radius: 50%; background: #4caf50; flex: none; margin-top: 3px; }
.ks-dot.red { background: #e53935; }
.ks-dot.grey { background: #a8b0ba; }
.ks-code { font-size: 12px; font-weight: 700; color: #7b8591; margin: 2px 0 16px; text-transform: uppercase; }
.ks-tag { color: #e08fd8; }
.ks-tag.service { color: #ef6f8f; }
.ks-tag.lab { color: #3d8be0; }
.ks-tag.vaccine { color: #2fa84f; }
.ks-qty { font-size: 11.5px; font-weight: 700; color: #5f6b78; line-height: 1.7; }
.ks-alloc { display: flex; align-items: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ks-alloc-k { color: #1e9fc4; font-weight: 700; font-size: 13px; }
.ks-person { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #e8ecf1; border-radius: 999px; padding: 3px 10px 3px 4px; font-size: 11.5px; font-weight: 800; color: #3c4450; }
.ks-person .face { width: 24px; height: 24px; }
.ks-pay { padding: 20px 32px 24px; }
.ks-paytitle { text-align: center; margin: 0 0 12px; font-size: 18px; color: #3c4450; text-transform: none; letter-spacing: 0; }
.ks-sum { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0 0 16px; padding-bottom: 16px; border-bottom: 1px solid #dfe4ea; font-size: 13.5px; }
.ks-sum dt { font-weight: 700; color: #5f6b78; }
.ks-sum dd { margin: 0; text-align: right; color: #3c4450; }
.ks-h { margin: 0 0 6px; font-size: 17px; color: #1a6f8a; text-transform: none; letter-spacing: 0; }
.ks-histhead, .ks-histrow, .ks-out { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; }
.ks-histhead { font-weight: 700; color: #3c4450; padding-bottom: 8px; border-bottom: 1px solid #dfe4ea; margin-bottom: 10px; }
.ks-hist { margin-bottom: 12px; }
.ks-hist.voided { text-decoration: line-through; color: #9aa4af; }
.ks-link { border: 0; background: none; padding: 0; font: inherit; font-weight: 700; font-size: 12.5px; color: #5f6b78; cursor: pointer; }
.ks-link:hover { color: #1e88e5; text-decoration: underline; }
.ks-method { text-align: right; color: #1e88e5; font-size: 13px; }
.ks-date { font-size: 11.5px; color: #4a5563; max-width: 150px; line-height: 1.6; }
.ks-none { font-size: 12.5px; color: #7b8591; margin: 0 0 10px; }
.ks-out { padding: 10px 0 16px; border-bottom: 1px solid #dfe4ea; margin-bottom: 18px; }
.ks-out span:first-child { font-weight: 700; color: #5f6b78; }
.ks-rem span { color: #f0a030; }
.ks-remtext { margin: 4px 0 0; font-size: 13px; white-space: pre-wrap; }
.ks-right .pay-form, .ks-right .claim-box { margin-top: 0; background: #fff; border: 0; border-radius: 14px; }
.ks-right .pay-form .grid.four { grid-template-columns: 1fr 1fr; }
.ks-void { justify-self: end; width: 52px; height: 52px; border-radius: 50%; border: 0; background: #e53935; color: #fff; font-size: 28px; cursor: pointer; box-shadow: 0 3px 8px rgba(20, 30, 50, .25); display: grid; place-items: center; }
@media (max-width: 900px) { .dlg.ksale .bill-view { grid-template-columns: 1fr; } .ks-row { grid-template-columns: minmax(0, 1fr) 54px 76px 76px 76px; font-size: 12px; } }
.ks-bal { display: block; color: #d32f2f; font-weight: 700; font-size: 11px; line-height: 1.3; margin-top: 4px; }
.ks-out.owing, .ks-out.owing span:first-child { color: #d32f2f; }
.ks-out.owing { border-bottom: 0; margin-bottom: 0; padding-bottom: 8px; }
.ks-paynow { border: 0; background: none; padding: 0 0 14px; margin-bottom: 14px; width: 100%; text-align: left; border-bottom: 1px solid #dfe4ea; color: #d32f2f; font: inherit; font-size: 13px; cursor: pointer; }
.ks-person.plain { padding-left: 10px; }
.ks-items.refunding .ks-row { grid-template-columns: minmax(0, 1fr) 80px 96px 96px 96px 70px; }
.ks-pick { appearance: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #5cb85c; background: #fff; cursor: pointer; margin: 0; vertical-align: middle; }
.ks-pick:checked { background: #5cb85c; box-shadow: inset 0 0 0 3px #fff; }
.ks-pick:disabled { border-color: #cfd5dc; cursor: not-allowed; }
.ks-refunded { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: #fdecea; color: #d32f2f; font-size: 11px; font-weight: 700; }
.dlg.ksale .bill-view { position: relative; }
.ks-refbar { grid-column: 1; grid-row: 2; display: flex; justify-content: space-between; align-items: center; padding: 0 6px; }
.dlg.ksale .bill-view .ks-right { grid-column: 2; grid-row: 1 / span 2; }
.ks-back { border: 0; background: none; color: #1e88e5; font-size: 34px; line-height: 1; cursor: pointer; padding: 0 10px; }
.ks-go { width: 52px; height: 52px; border-radius: 50%; border: 0; background: #5cb85c; color: #fff; font-size: 26px; cursor: pointer; box-shadow: 0 3px 8px rgba(20, 30, 50, .22); }
.rf-list { margin: 0 0 12px; padding-left: 18px; font-size: 13.5px; }
.btn.primary.danger-fill { background: #e53935; border-color: #e53935; }
@media (max-width: 900px) { .dlg.ksale .bill-view .ks-right, .ks-refbar { grid-column: 1; grid-row: auto; } }

/* ---------- top bar like Kumodoc's: ten round buttons in its order, the user menu last ---------- */
.topbar { justify-content: flex-end; }
.quick { display: flex; align-items: center; gap: 14px; }
.qbtn { width: 50px; height: 50px; color: #3f7fc4; background: #e9ecef; }
.qbtn svg { width: 26px; height: 26px; stroke-width: 1.5; }
.qbtn.green { color: #3d9a5b; }
.qbtn.clock { background: linear-gradient(180deg, #f8c558, #f2a93b); color: #fff; box-shadow: 0 0 0 2px #fff, 0 0 0 3px #d9d9d9; }
.qbtn.clock.is-in { background: linear-gradient(180deg, #63c27a, #3fa35b); }
.qbtn .nav-badge { left: auto; right: -3px; top: -5px; min-width: 18px; height: 18px; line-height: 18px; font-size: 11px; background: #e53935; color: #fff; border-radius: 9px; padding: 0 4px; text-align: center; position: absolute; font-weight: 700; }
.me-face { width: 50px; height: 50px; }
@media (max-width: 1100px) { .quick { gap: 8px; } .quick .qbtn:nth-child(n+5) { display: grid; } .qbtn { width: 42px; height: 42px; } .qbtn svg { width: 22px; height: 22px; } }
@media (max-width: 760px) { .quick .qbtn:not([data-quick="newsale"]):not([data-quick="bell"]):not([data-quick="clock"]):not([data-quick="inbox"]) { display: none; } }
/* outlet picker sits at the bottom of the left menu, as in Kumodoc */
.rail-outlet { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; margin: auto 8px 10px; height: 44px; border-radius: 10px; color: var(--brand); cursor: pointer; flex: none; }
.rail-outlet:hover { background: var(--brand-soft); }
.rail-outlet svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; flex: none; }
.rail-outlet select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; min-height: 0; padding: 0; }
body.rail-open .rail-outlet { justify-content: flex-start; padding: 0 10px; border: 1px solid var(--line); margin-bottom: 0; }
body.rail-open .rail-outlet select { position: static; opacity: 1; border: 0; background: transparent; font-weight: 600; font-size: 12.5px; color: var(--ink); width: 100%; height: auto; }
.rail-outlet + .rail-foot { margin-top: 0; }
/* ---------- dashboard header and widget board like Kumodoc's ---------- */
.dash-hello.k { display: block; margin: -4px 0 14px; padding: 6px 0 8px; background: var(--page); z-index: 5; }
.dash-hello.k.pinned { position: sticky; top: 0; }
.dash-hello.k .hello-date { margin: 0; font-size: 13px; font-weight: 700; color: #5f6b78; }
.dash-hello.k h1 { margin: 2px 0 8px; font-size: 17px; font-weight: 800; color: #3c4450; }
.kbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.kb-label { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: #6b7480; }
.kb-label.grow { flex: 1 1 260px; margin-right: auto; max-width: 480px; }
.kb-select { width: auto; min-width: 104px; min-height: 34px; height: 34px; border-radius: 999px; padding: 0 30px 0 14px; border: 1px solid #b9c0c9; background-color: #fff; color: #4a5563; font-size: 14px; }
.kb-select.add { min-width: 150px; color: #7b8591; }
.kb-search { flex: 1; min-height: 30px; height: 30px; border: 0; border-bottom: 1px solid #e4e8ed; border-radius: 8px; box-shadow: 0 1px 3px rgba(20, 30, 50, .12); padding: 0 10px; font-size: 14px; background: #fff; }
.kb-round { width: 36px; height: 36px; border-radius: 50%; border: 1px solid #d5d9de; background: #fff; color: #6b7480; cursor: pointer; display: grid; place-items: center; flex: none; padding: 0; }
.kb-round svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kb-round:hover { background: #f1f4f7; }
.kb-round.green { color: #2e9a47; border-color: #2e9a47; }
.kb-round.green.on { background: #e3f5e7; }
.kb-round.blue { color: #1e88e5; border-color: #9cc7ef; }
.kb-round.red { color: #c62828; border-color: #e3a1a1; }
.kb-round.sm { width: 28px; height: 28px; }
.kb-round.sm svg { width: 14px; height: 14px; }
.kboard { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kboard .kw { position: relative; padding-top: 18px; }
.kboard .kw.wide { grid-column: 1 / -1; }
.kboard .kw[draggable="true"] { cursor: grab; }
.kboard .kw.dragging { opacity: .45; }
.kboard .kw.drop { outline: 2px dashed var(--brand); outline-offset: 2px; }
.kboard .kw.locked { box-shadow: 0 1px 4px rgba(20, 30, 50, .08), inset 0 0 0 1px #e1e5ea; }
.kw-tools { position: absolute; top: 10px; right: 12px; display: flex; gap: 6px; }
.kboard .kw .ktitle { padding: 0 70px; margin-bottom: 8px; }
.kboard .kw .tiles { margin-top: 10px; }
.kboard .kw .dash-list { margin-top: 4px; }
.kw-big { display: grid; justify-items: center; gap: 4px; padding: 18px 0 10px; color: #5f6b78; font-size: 13px; }
.kw-big strong { font-size: 40px; color: #3c4450; line-height: 1; }
.kboard-empty { grid-column: 1 / -1; text-align: center; color: #7b8591; padding: 60px 0; }
@media (max-width: 1100px) { .kboard { grid-template-columns: 1fr; } }
/* ---------- clock in/out window, help, big displays ---------- */
.clock-box { display: grid; gap: 10px; justify-items: center; text-align: center; }
.clock-who { margin: 0; } .clock-state { margin: 0; color: #7b8591; font-weight: 700; } .clock-state.in { color: #2e9a47; }
.clock-go { min-width: 180px; font-size: 16px; padding: 12px 20px; background: #f2a93b; border-color: #f2a93b; }
.clock-go.out { background: #3fa35b; border-color: #3fa35b; }
.clock-list { width: 100%; text-align: left; } .clock-list h3 { margin: 8px 0 4px; }
.clock-list ul { list-style: none; margin: 0; padding: 0; } .clock-list li { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #eef0f3; font-size: 13.5px; }
.help-box ul { padding-left: 18px; display: grid; gap: 6px; }
.kdisplay { background: #fff; border-radius: 12px; padding: 22px 28px; min-height: 70vh; }
.kdisplay header { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; border-bottom: 2px solid var(--brand); padding-bottom: 10px; margin-bottom: 14px; }
.kdisplay h1 { margin: 0; font-size: 28px; } .kdisplay h1::before { display: none; } .kdisplay header p { margin: 0; color: #5f6b78; font-weight: 700; flex: 1; }
.kdisplay-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.kdisplay-list li { display: grid; grid-template-columns: 130px minmax(0, 1fr) 150px; align-items: center; gap: 16px; padding: 12px 16px; border-radius: 10px; background: #f5f7fa; font-size: 20px; }
.kdisplay-list li.started { background: #e3f5e7; }
.kd-no { font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.kd-name { font-weight: 700; } .kd-name small { display: block; font-size: 12px; font-weight: 600; color: #7b8591; }
.kd-st { text-align: right; font-weight: 700; color: #5f6b78; font-size: 15px; }
.kdisplay-empty { text-align: center; color: #7b8591; font-size: 20px; padding: 80px 0; }
.kbar .kb-select { flex: none; width: 118px; font-weight: 500; }
.kbar .kb-select.add { width: 144px; }
.kbar .kb-label.grow { flex: 0 1 430px; }
.kbar .kb-label.grow + .kb-label { margin-left: auto; }
.kbar .kb-search { border: 0; }

/* ---------- pieces added to match Kumodoc's screens one for one ---------- */
.k-none { text-align: center; color: #7b8591; padding: 46px 12px !important; font-size: 13.5px; }
.k-bin { border: 0; background: none; color: #d32f2f; font-size: 17px; cursor: pointer; padding: 4px 6px; }
.k-bin:hover { background: #fdecea; border-radius: 6px; }
.k-round.blue { background: #3d8be0; font-size: 22px; } .k-round.teal { background: #35b0c4; font-size: 22px; } .k-round.purple { background: #7b6bd6; font-size: 20px; text-decoration: none; }
.k-sublinks { display: flex; align-items: center; gap: 6px; margin-left: 10px; }
.k-sublinks a { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #5f6b78; text-decoration: none; border: 1px solid #e1e5ea; background: #fff; }
.k-sublinks a.on { color: #fff; background: var(--brand); border-color: var(--brand); }
.k-rating { font-size: 10px; font-weight: 800; color: #5f6b78; letter-spacing: .02em; }
.k-wallet { display: inline-grid; place-items: center; width: 30px; height: 24px; border-radius: 5px; background: #2f7fd6; color: #fff; text-decoration: none; font-size: 14px; }
.k-g { color: #4285f4; font-size: 15px; }
.kt-views { display: inline-flex; gap: 4px; margin-left: 6px; }
.kt-view { min-width: 34px; height: 34px; border-radius: 8px; border: 1px solid #d5dbe2; background: #fff; color: #5f6b78; font-size: 13px; font-weight: 700; cursor: pointer; padding: 0 6px; }
.kt-view.on { background: #e3f0fc; border-color: #7fb3ea; color: #1565c0; }
.kt-view:hover { background: #f1f4f7; }
button.kt-datetext { border: 0; background: none; font: inherit; font-weight: 700; cursor: pointer; color: inherit; padding: 0 4px; }
.ks-side { width: 40px; height: 40px; border-radius: 50%; border: 1px solid #d8c9a6; background: #fff; color: #b98a2f; display: grid; place-items: center; cursor: pointer; text-decoration: none; font-size: 17px; }
.ks-side + .ks-side { border-color: #9cc7ef; color: #2f7fd6; }
.kappt-list { flex: 1; min-width: 0; background: #fff; border-radius: 10px; }
.kset { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 34px 18px; padding: 36px 20px; }
.kset-tile { text-align: center; }
.kset-ico { width: 74px; height: 74px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(20, 30, 50, .14); display: grid; place-items: center; font-size: 34px; margin: 0 auto 8px; }
.kset-tile h2 { margin: 0 0 4px; font-size: 15px; color: #3c4450; text-transform: none; letter-spacing: 0; }
.kset-tile ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 8px; font-size: 11.5px; }
.kset-tile a { color: var(--brand); font-weight: 600; }
.kset-off { border: 0; background: none; padding: 0; font: inherit; color: #9aa4af; cursor: pointer; }
.kroles th, .kroles td { text-align: center; }
.krole { font-weight: 800; font-size: 15px; }
.krole.full { background: #dff3e3; color: #2e7d32; border-radius: 6px; padding: 3px 10px; font-size: 11.5px; font-weight: 700; }
.krole.yes { color: #2e9a47; } .krole.some { color: #f0a030; } .krole.no { color: #e53935; }
.fu-all { list-style: none; margin: 0 0 10px; padding: 0; }
.fu-all li { display: grid; grid-template-columns: 220px minmax(0, 1fr) 110px; gap: 10px; padding: 6px 0; border-bottom: 1px solid #eef0f3; font-size: 13.5px; }
@media (max-width: 1100px) { .kset { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ---------- appointments: Week and Month views, as in Kumodoc ---------- */
.cal.week .cal-room { text-transform: none; letter-spacing: 0; color: #4a5563; font-size: 15px; }
.cal-room.is-today, .cal-col.is-today { background-color: #f1f7fe; }
.kmonth { display: flex; flex-direction: column; height: 100%; background: #fff; overflow: auto; }
.kmonth-head { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid #dfe3e8; position: sticky; top: 0; background: #fff; z-index: 2; }
.kmonth-head div { text-align: center; padding: 12px 4px; font-weight: 700; font-size: 15px; color: #5b6470; }
.kmonth-grid { flex: 1; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(92px, 1fr)); }
.mcell { border-right: 1px solid #e3e6ea; border-bottom: 1px solid #e3e6ea; padding: 4px 4px 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; cursor: cell; }
.mcell:nth-child(7n) { border-right: 0; }
.mcell.is-today { background: #f1f7fe; }
.mday { align-self: flex-end; border: 0; background: none; font: inherit; font-size: 15px; font-weight: 600; color: #3c4450; cursor: pointer; padding: 0 4px; border-radius: 6px; }
.mday:hover { background: #e9eef4; }
.mcell.other .mday { color: #b4bcc6; }
.mchip { position: relative; display: block; width: 100%; text-align: left; border: 1px solid rgba(0, 0, 0, .12); border-left: 6px solid var(--tag); border-radius: 9px; background: color-mix(in srgb, var(--tag) 38%, #fff); padding: 2px 20px 2px 6px; cursor: pointer; font: inherit; color: #3c4450; }
.mchip-name { display: block; font-size: 10.5px; font-weight: 800; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mchip-name small { font-size: 9px; color: #6b7480; }
.mchip-svc { display: block; font-size: 9.5px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mchip-ico { position: absolute; top: 3px; right: 4px; font-style: normal; font-size: 9px; }
.mchip.st-cancelled, .mchip.st-no_show { opacity: .55; }
.mchip.st-cancelled .mchip-name, .mchip.st-no_show .mchip-name { text-decoration: line-through; }
.mchip.blocked { border-left-color: #6f4a8e; background: #f4f4f4; color: #6f4a8e; }
.mmore-link { align-self: flex-start; border: 0; background: none; padding: 0 2px; font: inherit; font-size: 12px; color: #1e88e5; cursor: pointer; }
.mmore-link:hover { text-decoration: underline; }
.mmore { display: grid; gap: 4px; max-height: 60vh; overflow: auto; }
.mmore .mchip-name, .mmore .mchip-svc { white-space: normal; }
@media (max-width: 900px) { .kmonth-grid { grid-template-rows: repeat(6, minmax(70px, auto)); } .mchip-svc { display: none; } }
/* Kumodoc fills each booking card with its tag colour (seen in Day and Week views) */
.appt.k { background: color-mix(in srgb, var(--tag) 62%, #fff); border: 1px solid color-mix(in srgb, var(--tag) 70%, #555); border-left: 6px solid color-mix(in srgb, var(--tag) 80%, #333); }
.appt.k.blocked { background: #f4f4f4; border: 1px solid #6f4a8e; border-left-width: 1px; }
.mchip { background: color-mix(in srgb, var(--tag) 62%, #fff); border-color: color-mix(in srgb, var(--tag) 70%, #555); }
.kt-filter-wrap { position: relative; }
.kfilter-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: 40; width: 270px; background: #fff; border-radius: 14px; box-shadow: 0 10px 30px rgba(20, 30, 50, .22); padding: 14px 16px 12px; }
.kfilter-pop h3 { margin: 0 0 10px; font-size: 17px; color: #3c4450; text-transform: none; letter-spacing: 0; }
.kf-body { max-height: 330px; overflow: auto; display: grid; gap: 10px; }
.kf-group { display: grid; gap: 6px; }
.kf-head { display: flex; align-items: center; gap: 10px; font-weight: 700; color: #3c4450; font-size: 14.5px; }
.kf-opt { display: flex; align-items: center; gap: 10px; padding-left: 22px; color: #4a5563; font-size: 14px; }
.kfilter-pop input[type=checkbox] { appearance: none; width: 20px; height: 20px; border-radius: 50%; border: 2px solid #5cb85c; background: #fff; margin: 0; cursor: pointer; flex: none; }
.kfilter-pop input[type=checkbox]:checked { background: #5cb85c url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/13px no-repeat; }
.kfilter-pop footer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid #eef0f3; margin-top: 10px; padding-top: 10px; }
.kfilter-pop footer .btn.primary { border-radius: 999px; padding: 8px 22px; }
