/* Prototype — The Endodontic Centre's own practice system. Its own look since 0.5 (19 Sep 2026): a light, Mac style
   window (toolbar across the top, a source list on the left of each screen, sheets and a side panel for detail), in
   two looks, Classic and TEC teal. */
:root {
  --accent: #2f66d9; --accent-ink: #fff; --accent-soft: #e4ecfb; --accent-deep: #1f4fb5;
  --ink: #1c2330; --ink-2: #465063; --ink-3: #7d8797; --line: #d6dde8; --line-2: #c4cedb; --hair: #e4e9f0;
  --bg: #e8edf4; --panel: #fff; --panel-2: #f6f8fb; --source: #dde4ee; --source-ink: #28324a; --hover: rgba(30,50,90,.06);
  --good: #1f9d55; --good-soft: #e3f4ea; --warn: #c77700; --warn-soft: #fff1da; --bad: #d93025; --bad-soft: #fde9e7;
  --tb-bg: linear-gradient(180deg, #2e3d57 0%, #243249 100%); --tb-ink: #eef3fa; --tb-line: #1a2437; --tb-pill: rgba(255,255,255,.1); --tb-pill-on: #fff; --tb-pill-on-ink: #1f4fb5;
  --book-open: #edf2f9; --book-open-2: #e5ecf6; --book-shut: #d9e0e9; --book-hour: #cbd6e4; --book-quarter: #dfe6f0; --book-head: #f4f7fb;
  --radius: 11px; --radius-sm: 7px; --shadow: 0 1px 2px rgba(20,35,60,.07), 0 1px 1px rgba(20,35,60,.04);
  --shadow-lg: 0 18px 50px rgba(15,25,45,.24), 0 2px 8px rgba(15,25,45,.1);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Inter, "Segoe UI", Arial, sans-serif;
  --slot: 20px;
  color-scheme: light;
}
[data-theme="teal"] {
  --accent: #2c7c89; --accent-soft: #dcedf0; --accent-deep: #215f69;
  --ink: #1c2a2d; --ink-2: #435a5f; --ink-3: #7a8e92; --line: #cfe0e3; --line-2: #bcd2d6; --hair: #deeaec;
  --bg: #e3eef0; --panel-2: #f4f9fa; --source: #d4e7ea; --source-ink: #23454b; --hover: rgba(20,80,90,.07);
  --tb-bg: linear-gradient(180deg, #2f7480 0%, #276570 100%); --tb-ink: #f0fafb; --tb-line: #1d545d; --tb-pill: rgba(255,255,255,.13);
  --tb-pill-on: #fff; --tb-pill-on-ink: #215f69;
  --book-open: #e9f4f5; --book-open-2: #e0eef0; --book-shut: #d4e2e5; --book-hour: #c4dadd; --book-quarter: #dae9eb; --book-head: #f3f9fa;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 13.5px/1.42 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.ms { font-family: "Material Symbols Rounded"; font-weight: normal; font-style: normal; font-size: 22px; line-height: 1; letter-spacing: normal;
  text-transform: none; display: inline-block; white-space: nowrap; direction: ltr; -webkit-font-smoothing: antialiased;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24; vertical-align: middle; }
.ms.fill { font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24; }
.muted { color: var(--ink-3); }
.fineprint { font-size: 12px; color: var(--ink-3); }
.err { color: var(--bad); font-size: 13px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.owing { color: var(--bad); } .paid { color: var(--good); }
.alert-text { color: var(--bad); font-weight: 600; }
.plus { color: var(--bad); font-weight: 900; }
.grow { flex: 1; }

/* ---------------------------------------------------------------- the window */
.app { display: grid; grid-template-rows: auto minmax(0, 1fr); height: 100vh; }
.tb { display: flex; align-items: center; gap: 12px; min-width: 0; height: 66px; padding: 0 16px; background: var(--tb-bg); color: var(--tb-ink);
  border-bottom: 1px solid var(--tb-line); position: relative; z-index: 30; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.tb-brand { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; letter-spacing: -.01em; white-space: nowrap; }
.tb-mark { width: 30px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: #fff; color: #243249; font-size: 11px; font-weight: 800; letter-spacing: .02em; }
[data-theme="teal"] .tb-mark { color: #276570; }
.tb-brand small { font-weight: 500; opacity: .6; font-size: 11.5px; }
.tb-nav { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--tb-pill); margin: 0 auto; }
.tb-nav a { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 1px; min-width: 88px; padding: 5px 12px 4px; border-radius: 9px; font-size: 11.5px; color: inherit; text-decoration: none; font-weight: 500; white-space: nowrap; }
.tb-nav a:hover { background: rgba(127,127,127,.12); }
.tb-nav a.on { background: var(--tb-pill-on); color: var(--tb-pill-on-ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tb-nav .ms { font-size: 28px; }
.tb-nav .counts { position: absolute; top: 2px; right: 8px; display: flex; gap: 2px; }
.tb-nav .count { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; background: var(--bad); color: #fff; }
.tb-nav .count.blue { background: var(--accent); }
[data-theme="teal"] .tb-nav .count.blue { background: #8fd3dc; color: #123b41; }
.tb-find { position: relative; }
.tb .tb-find input { width: 210px; padding: 7px 10px 7px 34px; border-radius: 8px; border: 1px solid transparent; background: var(--tb-pill); color: inherit; }
.tb .tb-find input::placeholder { color: inherit; opacity: .6; }
.tb .tb-find input:focus { outline: none; background: #fff; color: var(--ink); border-color: var(--accent); }
.tb-find > .ms { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-size: 20px; opacity: .6; pointer-events: none; }
.tb-find .found { position: absolute; right: 0; top: calc(100% + 6px); width: 360px; max-height: 60vh; overflow: auto; background: #fff; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: 4px; }
.tb-find .found button { display: grid; grid-template-columns: 1fr auto; gap: 8px; width: 100%; padding: 7px 10px; border: 0; background: none; border-radius: 6px; text-align: left; cursor: pointer; }
.tb-find .found button:hover, .tb-find .found button.hl { background: var(--accent); color: #fff; }
.tb-find .found button:hover .muted, .tb-find .found button.hl .muted { color: rgba(255,255,255,.8); }
.tb-loc { display: inline-flex; padding: 2px; border-radius: 8px; background: var(--tb-pill); }
.tb-loc button { border: 0; background: none; padding: 4px 10px; border-radius: 6px; cursor: pointer; font-weight: 500; }
.tb-loc button.on { background: var(--tb-pill-on); color: var(--tb-pill-on-ink); box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.tb-proto { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; background: #fff3d6; color: #8a5a00; white-space: nowrap; }
.tb-me { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; background: var(--tb-pill); color: inherit; font-weight: 700; font-size: 12px; }
#view { min-height: 0; overflow: auto; position: relative; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, var(--bg)) 0, var(--bg) 280px); }
.loading { padding: 30px; color: var(--ink-3); }

/* a screen with a source list on the left */
.split { display: grid; grid-template-columns: 248px minmax(0, 1fr); height: 100%; }
.source { background: var(--source); color: var(--source-ink); border-right: 1px solid var(--line); overflow-y: auto; padding: 12px 10px 20px; display: grid; gap: 14px; align-content: start; }
.source h4 { margin: 0 6px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }
.source-list { display: grid; gap: 1px; }
.source-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 6px 8px; border: 0; border-radius: 6px; background: none; text-align: left;
  cursor: pointer; color: inherit; text-decoration: none; font-size: 13px; }
.source-item:hover { background: var(--hover); }
.source-item.on { background: var(--accent); color: #fff; }
.source-item.on .muted { color: rgba(255,255,255,.8); }
.source-item .ms { font-size: 21px; opacity: .8; }
.source-item.soon { opacity: .5; }
.main-pane { min-width: 0; overflow: auto; }
.page { padding: 18px 22px 36px; }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.015em; flex: 1; }
.page-head h3 { margin: 0; font-size: 15px; font-weight: 700; flex: 1; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--hair); background: var(--panel-2); border-radius: var(--radius) var(--radius) 0 0; }
.card-head h3 { margin: 0; font-size: 14px; font-weight: 700; flex: 1; display: flex; align-items: center; gap: 8px; }
.card-head h3 .ms { font-size: 22px; }
.card-head h3 .ms { color: var(--accent); }
.card-body { padding: 12px 14px; }
.later { padding: 40px 20px; text-align: center; color: var(--ink-2); }
.later .ms { font-size: 44px; color: var(--line-2); }
.empty { padding: 14px; color: var(--ink-3); }

/* ---------------------------------------------------------------- controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 30px; padding: 4px 12px; border: 1px solid var(--line-2);
  border-radius: var(--radius-sm); background: #fff; cursor: pointer; font-weight: 500; font-size: 13px; white-space: nowrap; box-shadow: 0 1px 1px rgba(0,0,0,.04); }
.btn:hover:not(:disabled) { background: #f7f8fa; }
.btn:disabled { opacity: .45; cursor: default; }
.btn .ms { font-size: 20px; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--accent-deep); }
.btn-green { background: var(--good); border-color: var(--good); color: #fff; }
.btn-green:hover:not(:disabled) { background: #188247; }
.btn-red { background: #fff; border-color: #f0c4c0; color: var(--bad); }
.btn-red:hover:not(:disabled) { background: var(--bad-soft); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-orange { background: #fff; border-color: #f1d3a4; color: #9a5b00; }
.btn-line { background: #fff; }
.btn-ghost { border-color: transparent; background: none; box-shadow: none; }
.btn-ghost:hover:not(:disabled) { background: var(--hover); }
.btn-sm { min-height: 26px; padding: 2px 9px; font-size: 12.5px; }
.btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-deep); }
.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 7px; background: none; cursor: pointer; color: var(--ink-2); }
.icon-btn:hover { background: var(--hover); }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=date], input[type=time], input[type=number], input[type=password], select, textarea {
  padding: 6px 9px; border: 1px solid var(--line-2); border-radius: var(--radius-sm); background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 25%, transparent); outline-offset: 0; border-color: var(--accent); }
textarea { resize: vertical; }
label.f, div.f { display: grid; gap: 4px; font-size: 12px; color: var(--ink-2); }
label.f > span, div.f > span { font-weight: 600; }
div.f > b { font-size: 14px; color: var(--ink); font-weight: 600; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 12px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 2px; gap: 2px; border-radius: 8px; background: #eceef1; }
.seg button { border: 0; background: none; padding: 4px 11px; border-radius: 6px; cursor: pointer; font-weight: 500; font-size: 12.5px; color: var(--ink-2); }
.seg button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.14); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink); cursor: pointer; }
.check-row input { width: 15px; height: 15px; accent-color: var(--accent); }
.radio-row { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink); }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.radio-row input { accent-color: var(--accent); }
.warn { padding: 8px 11px; border-radius: 8px; background: var(--warn-soft); color: #7a4a00; font-size: 12.5px; }
.chip { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; font-weight: 700; border: 1px solid rgba(0,0,0,.08); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #eef0f3; color: var(--ink-2); white-space: nowrap; }
.pill.arrived { background: var(--warn-soft); color: #8a5300; } .pill.seated { background: var(--accent-soft); color: var(--accent-deep); }
.pill.left { background: #f1ecfb; color: #5b3aa5; } .pill.completed, .pill.good { background: var(--good-soft); color: #17703c; }
.pill.fta, .pill.cancelled, .pill.bad { background: var(--bad-soft); color: #a52119; }
.pill.confirmed { background: var(--good-soft); color: #17703c; }
.code-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.code-chip { padding: 1px 7px; border: 1px solid var(--line); border-radius: 5px; background: #fafbfc; font-size: 12px; font-variant-numeric: tabular-nums; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 90; padding: 9px 16px; border-radius: 10px; background: rgba(30,30,32,.92);
  color: #fff; box-shadow: var(--shadow-lg); max-width: 90vw; font-weight: 500; }

/* tables */
.t-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
table.t { width: 100%; border-collapse: collapse; background: var(--panel); }
table.t th { position: sticky; top: 0; z-index: 1; padding: 7px 10px; background: var(--panel-2); border-bottom: 1px solid var(--line); text-align: left;
  font-size: 11.5px; color: var(--ink-3); font-weight: 600; white-space: nowrap; }
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--hair); vertical-align: top; }
table.t tbody tr:last-child td { border-bottom: 0; }
table.t tr.link { cursor: pointer; }
table.t tr.link:hover td { background: #f7f9fc; }
table.t tr.sel td { background: var(--accent-soft) !important; }
table.t td.total { font-weight: 700; }

/* sheets (dialogs) */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 16px; background: rgba(20,22,26,.28); animation: fade .12s ease-out; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(8px) scale(.99); opacity: 0; } }
.modal-card { width: 100%; max-width: 600px; max-height: 90vh; overflow: hidden; display: flex; flex-direction: column; background: #fff; border-radius: 14px;
  box-shadow: var(--shadow-lg); animation: rise .16s ease-out; }
.modal-card.wide { max-width: 1060px; }
.modal-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 14px 18px 6px; }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 700; flex: 1; letter-spacing: -.01em; }
.modal-body { padding: 8px 18px 16px; display: grid; gap: 12px; overflow: auto; flex: 1 1 auto; min-height: 0; align-content: start; }
.modal-foot { flex: none; display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--hair); background: #fbfbfc; flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; display: flex; gap: 8px; flex-wrap: wrap; }

/* right click menus */
.ctx { position: fixed; z-index: 95; min-width: 220px; max-height: 80vh; overflow: auto; padding: 5px; background: rgba(252,252,253,.97); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow-lg); }
.ctx-title { padding: 4px 9px 6px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.ctx-item { display: flex; align-items: center; gap: 9px; width: 100%; padding: 5px 9px; border: 0; border-radius: 6px; background: none; text-align: left; cursor: pointer; font-size: 13px; }
.ctx-item:hover:not(:disabled) { background: var(--accent); color: #fff; }
.ctx-item:hover:not(:disabled) .ms { color: #fff !important; }
.ctx-item:disabled { color: #b4b6ba; cursor: default; }
.ctx-item .ms { font-size: 20px; color: var(--ink-3); }
.ctx-item.danger { color: var(--bad); }
.ctx-item .ctx-check { margin-left: auto; color: var(--accent); }
.ctx-sep { height: 1px; margin: 4px 6px; background: var(--hair); }

/* ---------------------------------------------------------------- the book */
.book-main { display: grid; grid-template-rows: auto minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); height: 100%; min-width: 0; }
.book-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--panel); }
.book-range { font-size: 18px; font-weight: 700; letter-spacing: -.015em; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.book-range small { font-weight: 500; color: var(--ink-3); font-size: 13px; margin-left: 6px; }
.nav-group { display: inline-flex; border: 1px solid var(--line-2); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.nav-group button { border: 0; border-right: 1px solid var(--line); background: none; padding: 3px 9px; cursor: pointer; min-height: 28px; font-weight: 500; }
.nav-group button:last-child { border-right: 0; }
.nav-group button:hover { background: #f5f6f8; }
.book-grid-wrap { overflow: auto; position: relative; background: var(--book-head); }
.book-grid { display: grid; position: relative; min-width: max-content; }
.bh-day { position: sticky; top: 0; z-index: 6; height: 34px; display: flex; align-items: center; justify-content: center; gap: 7px; background: var(--book-head);
  font-weight: 600; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--hair); border-right: 1px solid var(--line); color: var(--ink-2); }
.bh-day .dnum { display: inline-grid; place-items: center; min-width: 26px; height: 26px; border-radius: 13px; font-size: 15px; font-weight: 700; color: var(--ink); }
.bh-day.today { color: var(--accent); }
.bh-day.today .dnum { background: var(--accent); color: #fff; }
.bh-chair { position: sticky; top: 34px; z-index: 6; height: 26px; display: flex; align-items: center; justify-content: center; gap: 6px; background: var(--book-head);
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 12px; color: var(--ink-3); font-weight: 500; }
.bh-chair .doc { display: inline-flex; align-items: center; gap: 4px; color: var(--ink-2); font-weight: 600; }
.bh-chair .doc i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid rgba(0,0,0,.15); }
.bh-corner { position: sticky; left: 0; top: 0; z-index: 8; background: var(--book-head); grid-row: span 2; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.times { position: sticky; left: 0; z-index: 5; background: var(--book-head); border-right: 1px solid var(--line); }
.time-hour { position: absolute; left: 0; right: 0; }
.time-hour b { position: absolute; right: 8px; top: -7px; font-size: 11px; font-weight: 600; color: var(--ink-3); white-space: nowrap; }
.time-hour.first b { top: 2px; }
.col { position: relative; border-right: 1px solid var(--line); cursor: cell; background-color: var(--book-open);
  background-image: linear-gradient(to bottom, var(--book-hour) 1px, transparent 1px), linear-gradient(to bottom, var(--book-quarter) 1px, transparent 1px);
  background-size: 100% calc(var(--slot) * 4), 100% var(--slot); }
.col.alt { background-color: var(--book-open-2); }
.col .shut { position: absolute; left: 0; right: 0; background: var(--book-shut); opacity: .75; pointer-events: none; }
.col.closed { background-color: var(--book-shut); background-image: repeating-linear-gradient(135deg, transparent 0 9px, rgba(0,0,0,.035) 9px 11px); cursor: default; }
.col.day-end { border-right: 2px solid var(--line-2); }
.col .now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--bad); z-index: 4; pointer-events: none; }
.col .now::before { content: ""; position: absolute; left: -4px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.no-grid .col { background-image: none !important; }

.appt { position: absolute; left: 3px; right: 3px; z-index: 2; overflow: hidden; border-radius: 6px; padding: 2px 5px 2px calc(var(--band, 9px) + 4px); font-size: var(--appt-font, 11.5px); line-height: 1.25;
  cursor: pointer; user-select: none; background: var(--tint, #eee); color: var(--tint-ink, #1d1d1f); box-shadow: 0 1px 2px rgba(0,0,0,.12), inset 0 0 0 1px rgba(0,0,0,.06); }
.appt::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--band, 9px); background: var(--type, #999); box-shadow: 1px 0 0 rgba(0,0,0,.12); }
.appt:hover { box-shadow: 0 2px 8px rgba(0,0,0,.2), inset 0 0 0 1px rgba(0,0,0,.1); z-index: 3; }
.appt .who { font-weight: 700; display: flex; gap: 3px; align-items: baseline; padding-right: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plain-names .appt .who { font-weight: 500; }
.appt .who .plus { color: #ff3b30; font-size: 12px; }
.appt .who .n { display: inline-grid; place-items: center; min-width: 13px; height: 13px; padding: 0 2px; border-radius: 3px; background: rgba(0,0,0,.55); color: #fff; font-size: 9px; font-weight: 700; }
.appt .meta { opacity: .85; font-size: .92em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .note { opacity: .85; white-space: pre-wrap; font-size: .92em; }
.appt .ref { opacity: .8; font-size: .9em; font-style: italic; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.appt .tag { position: absolute; top: 2px; right: 3px; padding: 0 5px; border-radius: 4px; font-size: 10.5px; font-weight: 800; line-height: 16px; background: var(--type); color: var(--type-ink);
  box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.appt .docdot { position: absolute; right: 3px; bottom: 3px; min-width: 21px; height: 16px; padding: 0 4px; border-radius: 8px; font-size: 9.5px; font-weight: 800; line-height: 16px;
  text-align: center; background: var(--doc); color: #222; box-shadow: 0 0 0 1px rgba(0,0,0,.18); }
.appt .icons { position: absolute; left: calc(var(--band, 9px) + 3px); right: 26px; bottom: 1px; display: flex; gap: 1px; align-items: center; flex-wrap: wrap-reverse; justify-content: flex-end; }
.appt .icons .ms { font-size: 19px; filter: drop-shadow(0 0 1px rgba(255,255,255,.9)); }
.appt.fta { opacity: .55; } .appt.fta .who { text-decoration: line-through; }
.appt.completed { --tint: var(--tint-done) !important; }
.appt.completed .who::after { content: " ✓"; }
.appt.completed::before { opacity: .55; }
.appt.dragging { opacity: .65; z-index: 20; box-shadow: 0 8px 22px rgba(0,0,0,.3); }
.appt.cut { outline: 2px dashed var(--accent); opacity: .6; }
.appt .resize { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; cursor: ns-resize; }
.block { position: absolute; left: 2px; right: 2px; z-index: 1; padding: 3px 7px; font-weight: 600; font-size: 12px; color: #6b4a3a; cursor: pointer; border-radius: 6px;
  background: repeating-linear-gradient(135deg, #fbece5 0 7px, #f6ddd1 7px 9px); border: 1px solid #efcfbf; }
.block.lunch { background: repeating-linear-gradient(135deg, #f2f3f5 0 7px, #e7e9ec 7px 9px); border-color: #dfe2e6; color: #9a9ea5; text-align: center; letter-spacing: .15em; font-weight: 500; }
.memo { position: absolute; left: 2px; right: 2px; z-index: 2; padding: 3px 7px; background: #fff7c7; border: 1px solid #efe08b; border-radius: 6px; font-size: 12px; cursor: pointer; box-shadow: var(--shadow); }
.ghost { position: absolute; left: 3px; right: 3px; z-index: 19; border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); border-radius: 6px;
  pointer-events: none; font-size: 11px; color: var(--accent-deep); padding: 2px 5px; font-weight: 600; }


/* the plan painted on the book */
.area { position: absolute; left: 0; right: 0; z-index: 1; overflow: hidden; }
.area.doc-hours { z-index: 0; }
.area > span { position: absolute; left: 5px; top: 2px; right: 4px; font-size: 10.5px; font-weight: 700; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; }
.area.lunch { background: repeating-linear-gradient(135deg, #e3f3e7 0 7px, #d3ebd9 7px 9px); color: #4f8a5d; }
.area.lunch > span { text-align: center; letter-spacing: .18em; text-transform: uppercase; top: 50%; transform: translateY(-50%); }
.area.closed { background: repeating-linear-gradient(135deg, #e3e5e9 0 7px, #d8dbe0 7px 9px); color: #7b808a; }
.area.holiday { background: repeating-linear-gradient(45deg, #eceef1 0 10px, #e2e5e9 10px 20px); color: #6b707a; }
.area.holiday > span { text-align: center; top: 40px; font-size: 12px; }
.area.dnb { background: repeating-linear-gradient(135deg, transparent 0 6px, rgba(217,48,37,.28) 6px 8px); color: #a52119; border-top: 2px solid rgba(217,48,37,.6); }
.area.note { background: #fff4b8; color: #7a6400; border-top: 2px solid #e6cf53; }
.area.annotation { background-color: rgba(120,160,230,.08); background-image: linear-gradient(rgba(100,140,220,.18) 1px, transparent 1px), linear-gradient(90deg, rgba(100,140,220,.18) 1px, transparent 1px);
  background-size: 8px 8px; color: #3656a3; }
.area.held { border-left: 3px dashed; }
.area.held > span { color: rgba(0,0,0,.55); font-weight: 600; }
.planning .col { cursor: crosshair; }
.planning .appt { opacity: .35; pointer-events: none; }
.planning { box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--accent) 55%, transparent); }
.doc-row.brush-on { background: #fff; box-shadow: 0 0 0 1.5px var(--accent), var(--shadow); font-weight: 600; }
.doc-row.brush-on .ms { opacity: 1; color: var(--accent); }

/* the book's source list */
.cal-head { display: flex; align-items: center; gap: 4px; font-weight: 700; font-size: 13.5px; padding: 0 4px; }
.cal-head span { flex: 1; }
.cal-head .icon-btn { width: 24px; height: 24px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; margin-top: 4px; text-align: center; }
.cal-grid .dow { font-size: 10.5px; color: var(--ink-3); font-weight: 600; padding: 2px 0; }
.cal-grid button { height: 26px; border: 0; border-radius: 13px; background: none; cursor: pointer; font-size: 12px; font-variant-numeric: tabular-nums; }
.cal-grid button:hover { background: var(--hover); }
.cal-grid button.inrange { background: color-mix(in srgb, var(--accent) 12%, transparent); border-radius: 0; }
.cal-grid button.sel { background: var(--accent); color: #fff; font-weight: 700; border-radius: 13px; }
.cal-grid button.today:not(.sel) { color: var(--accent); font-weight: 800; }
.cal-grid button.out { color: #b3b6bc; }
.cal-grid button.wkend { color: var(--ink-3); }
.doc-row { display: flex; align-items: center; gap: 8px; width: 100%; padding: 4px 8px; border: 0; border-radius: 6px; background: none; cursor: pointer; text-align: left; font-size: 13px; color: inherit; }
.doc-row:hover { background: var(--hover); }
.doc-row i { width: 12px; height: 12px; border-radius: 4px; border: 1px solid rgba(0,0,0,.15); flex: none; }
.doc-row .ms { margin-left: auto; font-size: 20px; opacity: .6; }
.doc-row.off { opacity: .4; }
.wl-card { position: relative; display: grid; gap: 2px; padding: 6px 8px 6px 12px; border-radius: 8px; background: #fff; border: 1px solid var(--line); cursor: grab; font-size: 12px; box-shadow: var(--shadow); }
.wl-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: 8px 0 0 8px; background: var(--type, #999); }
.wl-card b { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 16px; }
.wl-card .x { position: absolute; right: 2px; top: 2px; width: 22px; height: 22px; }
.wl-card .x .ms { font-size: 17px; }
.wl-list { display: grid; gap: 6px; }

/* ---------------------------------------------------------------- the visit panel (check in, treatment, check out) */
.drawer-wrap { position: fixed; inset: 0; z-index: 50; background: rgba(20,22,26,.18); animation: fade .12s ease-out; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(820px, 100vw); display: flex; flex-direction: column; background: var(--bg);
  box-shadow: -18px 0 50px rgba(0,0,0,.18); animation: slide .18s ease-out; }
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.vp-head { flex: none; background: var(--panel); border-bottom: 1px solid var(--line); padding: 14px 18px 12px; display: grid; gap: 10px; }
.vp-top { display: flex; align-items: flex-start; gap: 12px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 15px; color: #fff; background: #9aa3ad; flex: none; }
.vp-who { flex: 1; min-width: 0; }
.vp-who h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.015em; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vp-who .sub { color: var(--ink-2); font-size: 12.5px; display: flex; gap: 12px; flex-wrap: wrap; margin-top: 2px; }
.vp-who .sub a { color: inherit; }
.alert-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.alert-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: var(--bad-soft); color: #a52119; cursor: pointer; border: 0; }
.alert-chip.amber { background: var(--warn-soft); color: #8a5300; }
.vp-when { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.vp-when b { font-size: 14px; }
.stepper { display: flex; align-items: center; gap: 0; background: #eceef1; border-radius: 10px; padding: 3px; }
.stepper button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 5px; border: 0; background: none; padding: 6px 8px; border-radius: 8px; cursor: pointer;
  font-weight: 600; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }
.stepper button .ms { font-size: 21px; }
.stepper button.past { color: var(--ink-2); }
.stepper button.on { background: #fff; color: var(--accent-deep); box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.stepper button.bad.on { color: var(--bad); }
.stepper .sep { color: var(--line-2); font-size: 14px; }
.vp-body { flex: 1; overflow: auto; padding: 14px 18px 20px; display: grid; gap: 12px; align-content: start; }
.vp-fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px 12px; }
.items { display: grid; }
.item-row { display: grid; grid-template-columns: 54px minmax(0, 1fr) 60px 90px 30px; gap: 8px; align-items: center; padding: 7px 14px; border-bottom: 1px solid var(--hair); cursor: pointer; }
.item-row:hover { background: #f8f9fb; }
.item-row.sel { background: var(--accent-soft); }
.item-row .code { font-weight: 700; font-variant-numeric: tabular-nums; }
.item-row .desc small { display: block; color: var(--ink-3); }
.item-row .tooth { font-weight: 600; text-align: center; }
.item-row .x { visibility: hidden; }
.item-row:hover .x { visibility: visible; }
.items-foot { display: flex; align-items: center; gap: 8px; padding: 9px 14px; }
.items-foot b { font-size: 15px; }
.money-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 12px 14px; }
.money-grid div { display: grid; gap: 2px; }
.money-grid span { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.money-grid b { font-size: 17px; font-variant-numeric: tabular-nums; }
.paybar { height: 6px; border-radius: 3px; background: #eceef1; overflow: hidden; margin: 0 14px 12px; }
.paybar i { display: block; height: 100%; background: var(--good); border-radius: 3px; }
.pay-row { display: grid; grid-template-columns: 90px minmax(0, 1fr) 90px 90px 30px; gap: 8px; align-items: center; padding: 7px 14px; border-top: 1px solid var(--hair); font-size: 13px; }
.pay-row .x { visibility: hidden; } .pay-row:hover .x { visibility: visible; }
.finish { display: flex; align-items: center; gap: 12px; padding: 14px; }
.finish p { margin: 0; flex: 1; color: var(--ink-2); }
.done-banner { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: var(--good-soft); color: #17703c; font-weight: 600; border-bottom: 1px solid #cdebd9; }
.done-banner .grow { flex: 1; }
.vnote { display: flex; gap: 10px; padding: 7px 14px; border-top: 1px solid var(--hair); font-size: 13px; align-items: baseline; }
.vnote .when { color: var(--ink-3); font-size: 12px; width: 120px; flex: none; }
.vnote .who { font-weight: 700; color: var(--ink-2); width: 28px; flex: none; }
.vnote .what { flex: 1; }
.vnote .icon-btn { visibility: hidden; width: 24px; height: 24px; } .vnote:hover .icon-btn { visibility: visible; }
.vp-foot { flex: none; display: flex; align-items: center; gap: 6px; padding: 10px 18px; background: var(--panel); border-top: 1px solid var(--line); flex-wrap: wrap; }
.vp-foot .tools { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.tool { display: inline-flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px; padding: 5px 6px; border: 0; border-radius: 9px; background: none; cursor: pointer; font-size: 11px; color: var(--ink-2); font-weight: 500; }
.tool .ms { font-size: 27px; color: var(--accent); }
.tool:hover { background: var(--hover); }
.tool.danger .ms, .tool.danger { color: var(--bad); }
.steri-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 14px; border-top: 1px solid var(--hair); font-size: 13px; }
.steri-row .ms { font-size: 22px; }

/* procedure picker */
.proc { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
.proc-left { display: grid; gap: 8px; align-content: start; }
.proc-list { max-height: 380px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.proc-row { display: grid; grid-template-columns: 46px minmax(0, 1fr) 84px 40px; gap: 8px; width: 100%; padding: 6px 9px; border: 0; border-bottom: 1px solid var(--hair); background: #fff; text-align: left; cursor: pointer; font-size: 12.5px; }
.proc-row:hover { background: #f5f7fa; } .proc-row.on { background: var(--accent-soft); }
.proc-form { display: grid; gap: 10px; align-content: start; }
.proc-pick { padding: 9px 11px; border-radius: 8px; background: var(--accent-soft); min-height: 38px; }
.surfaces { display: flex; gap: 3px; flex-wrap: wrap; }
.surfaces button { width: 30px; height: 28px; border: 1px solid var(--line-2); border-radius: 6px; background: #fff; cursor: pointer; font-weight: 700; font-size: 12px; }
.surfaces button.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.pay-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button { padding: 7px 0 9px; border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer; color: var(--ink-3); font-weight: 600; margin-bottom: -1px; }
.tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button:disabled { opacity: .4; cursor: default; }
.attention { display: grid; gap: 12px; }
.attention-head { display: flex; gap: 12px; align-items: center; padding: 12px; border-radius: 10px; background: var(--bad-soft); color: #8e1c14; }
.attention-head .ms { font-size: 30px; }
.attention-head b { font-size: 16px; } .attention-head p { margin: 2px 0 0; }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 5px 12px; font-size: 13px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.pt-results { display: grid; max-height: 230px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.pt-results button { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--hair); background: #fff; text-align: left; cursor: pointer; }
.pt-results button:hover { background: var(--accent-soft); }
.pt-picked { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; background: var(--good-soft); border: 1px solid #cdebd9; }
.pt-picked b { font-size: 14px; }
.type-chips, .icon-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.type-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border: 1px solid var(--line-2); border-radius: 7px; background: #fff; cursor: pointer; font-size: 12.5px; }
.type-chip i { width: 11px; height: 11px; border-radius: 3px; border: 1px solid rgba(0,0,0,.18); }
.type-chip.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.icon-chip { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--line-2); border-radius: 7px; background: #fff; cursor: pointer; font-size: 12px; }
.icon-chip.on { border-color: var(--accent); background: var(--accent-soft); }

/* ---------------------------------------------------------------- today */
.board { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; align-items: start; }
.lane { background: #eceef2; border-radius: 12px; padding: 8px; display: grid; gap: 8px; align-content: start; min-height: 120px; }
[data-theme="teal"] .lane { background: #e4eef0; }
.lane-head { display: flex; align-items: center; gap: 6px; padding: 2px 4px 2px; font-weight: 700; font-size: 12.5px; color: var(--ink-2); }
.lane-head .n { margin-left: auto; font-weight: 700; color: var(--ink-3); }
.lane-head .ms { font-size: 20px; }
.vcard { position: relative; display: grid; gap: 4px; padding: 9px 10px 9px 13px; border-radius: 9px; background: #fff; box-shadow: var(--shadow); cursor: pointer; border: 1px solid var(--line); }
.vcard::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; border-radius: 9px 0 0 9px; background: var(--type, #999); }
.vcard:hover { border-color: var(--line-2); box-shadow: 0 3px 10px rgba(0,0,0,.1); }
.vcard .t { font-size: 12px; color: var(--ink-3); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.vcard b { font-size: 13.5px; }
.vcard .acts { display: flex; gap: 4px; margin-top: 3px; }
.vcard .acts .btn { flex: 1; }
.today-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
.work-row { display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--hair); cursor: pointer; font-size: 13px; }
.work-row:hover { background: #f8f9fb; }
.work-row .d { width: 64px; color: var(--ink-3); font-size: 12px; }

/* ---------------------------------------------------------------- patients */
.find-big { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.find-big .box { position: relative; flex: 1; max-width: 560px; }
.find-big input { width: 100%; padding: 9px 12px 9px 36px; font-size: 15px; border-radius: 10px; }
.find-big .box .ms { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.pf-head { background: var(--panel); border-bottom: 1px solid var(--line); padding: 16px 22px 0; }
.pf-id { display: flex; gap: 14px; align-items: flex-start; }
.pf-id .avatar { width: 56px; height: 56px; font-size: 19px; }
.pf-id h2 { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -.02em; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf-facts { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.pf-facts span { display: inline-flex; align-items: center; gap: 4px; }
.pf-facts .ms { font-size: 18px; color: var(--ink-3); }
.pf-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.pf-tabs { display: flex; gap: 20px; margin-top: 14px; overflow-x: auto; }
.pf-tabs button { display: inline-flex; align-items: center; gap: 5px; padding: 8px 0 10px; border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer;
  color: var(--ink-3); font-weight: 600; white-space: nowrap; }
.pf-tabs button .ms { font-size: 21px; }
.pf-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.pf-tabs button.on .ms { color: var(--accent); }
.pf-tabs .soon { font-size: 9.5px; font-weight: 700; padding: 0 5px; border-radius: 4px; background: #eceef1; color: var(--ink-3); }
.pf-body { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; padding: 16px 22px 30px; align-items: start; }
.rail { display: grid; gap: 12px; }
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--hair); }
.stat-row div { background: #fff; padding: 9px 12px; display: grid; gap: 1px; }
.stat-row span { font-size: 11px; color: var(--ink-3); font-weight: 600; }
.stat-row b { font-size: 15px; font-variant-numeric: tabular-nums; }
.visit-row { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 7px 12px; border-top: 1px solid var(--hair); cursor: pointer; font-size: 12.5px; }
.visit-row:hover { background: #f8f9fb; }
.visit-row .d { color: var(--ink-2); font-weight: 600; }
.visit-row.future .d { color: var(--accent); }
.tl { display: grid; gap: 10px; }
.tl-item { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; }
.tl-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tl-ic.sms { background: #e8f6ee; color: #1f9d55; } .tl-ic.email, .tl-ic.letter { background: #eef0fd; color: #4c5bd4; } .tl-ic.call { background: #fff2e0; color: #c77700; }
.tl-ic.review { background: #fff7d6; color: #a07800; } .tl-ic.report { background: #f3ecfb; color: #7446b8; } .tl-ic.referral { background: #fdecea; color: #b8322a; }
.tl-card { background: #fff; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.tl-card header { display: flex; align-items: center; gap: 8px; padding: 7px 12px; font-size: 12.5px; color: var(--ink-2); border-bottom: 1px solid var(--hair); }
.tl-card header b { color: var(--ink); }
.tl-card pre { margin: 0; padding: 10px 12px; white-space: pre-wrap; font: 12.5px/1.5 "SF Mono", Menlo, Consolas, monospace; }
.tl-card .body { padding: 9px 12px; white-space: pre-wrap; font-size: 13px; }
.tl-filter { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.note-editor textarea { width: 100%; min-height: 240px; font: 12.5px/1.5 "SF Mono", Menlo, Consolas, monospace; }
.ref-card { display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px; background: linear-gradient(180deg, #fff, #fbfcfd); border: 1px solid var(--line); }
.ref-card b { font-size: 14.5px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* ---------------------------------------------------------------- settings */
.manage-card { padding: 18px; display: grid; gap: 14px; max-width: 900px; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.reminder-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.save-row { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--hair); }
.save-row .btn-line { margin-right: auto; }
.row-tools { white-space: nowrap; width: 70px; }
.glyphs { display: flex; flex-wrap: wrap; gap: 2px; }
.glyphs .icon-btn { width: 28px; height: 28px; }
.glyphs .icon-btn.on { background: var(--accent-soft); outline: 2px solid var(--accent); }
.fee-cards { display: flex; flex-wrap: wrap; gap: 10px; }
.fee-card { position: relative; display: grid; place-items: center; gap: 6px; width: 132px; height: 96px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff;
  cursor: pointer; text-align: center; box-shadow: var(--shadow); }
.fee-card:hover { border-color: var(--accent); }
.fee-card.default { border-color: var(--accent); background: var(--accent-soft); }
.fee-card.new { border-style: dashed; color: var(--accent); box-shadow: none; }
.fee-flag { position: absolute; top: 7px; left: 7px; padding: 0 6px; border-radius: 4px; font-size: 9.5px; font-weight: 700; background: var(--accent); color: #fff; }
.fee-flag.red { background: #8e8e93; }

/* ---------------------------------------------------------------- sterilisation */
.steri-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.steri-stats .card { padding: 12px 14px; display: grid; gap: 2px; }
.steri-stats span { font-size: 11.5px; color: var(--ink-3); font-weight: 600; }
.steri-stats b { font-size: 22px; letter-spacing: -.02em; }
.label-sheet { display: flex; flex-wrap: wrap; gap: 8px; }
.label-prev { width: 204px; height: 76px; border: 1px dashed var(--line-2); border-radius: 6px; padding: 5px 8px; display: grid; grid-template-columns: 1fr auto; font-size: 10.5px; background: #fff; }
.scan-box { display: flex; gap: 8px; align-items: center; }
.scan-box input { flex: 1; font-size: 14px; padding: 8px 11px; }

/* ---------------------------------------------------------------- login */
.login-body { min-height: 100vh; display: grid; align-content: start; background: var(--bg); }
.banner { display: flex; align-items: center; gap: 14px; padding: 12px 22px; background: var(--panel); border-bottom: 1px solid var(--line); }
.brand-logo { height: 40px; }
.brand-name { margin: 0; font-size: 17px; font-weight: 700; color: var(--ink-2); }
.login-wrap { display: grid; justify-items: center; gap: 12px; padding: 48px 16px; }
.login-card { width: 100%; max-width: 400px; padding: 26px; background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-lg); }
.login-form { display: grid; gap: 8px; }
.login-form h1 { margin: 0 0 4px; font-size: 22px; font-weight: 700; letter-spacing: -.02em; }
.login-intro { margin: 0 0 6px; color: var(--ink-2); line-height: 1.45; }
.login-label { margin-top: 6px; font-size: 12.5px; font-weight: 600; }
.login-input { width: 100%; min-height: 40px; font-size: 15px; padding: 8px 11px; border: 1px solid var(--line-2); border-radius: 9px; }
.login-btn { margin-top: 10px; min-height: 40px; font-size: 14px; }
.login-links { margin: 6px 0 0; text-align: center; }
.login-foot { max-width: 400px; text-align: center; }
.link-btn { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; cursor: pointer; font-size: 13.5px; }
.field-error { font-size: 13px; font-weight: 600; color: var(--bad); }
.field-error:empty { display: none; }

@media (max-width: 900px) {
  .tb-nav a { min-width: 0; }
  .tb-nav a span.lbl { display: none; }
}
@media (max-width: 1180px) {
  .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-grid, .pf-body { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split > .source { display: none; }
  .tb-find input { width: 150px; }
  .tb-proto, .tb-brand small { display: none; }
  .vp-fields, .grid4 { grid-template-columns: 1fr 1fr; }
  .steri-stats { grid-template-columns: 1fr 1fr; }
}
.avatar.sm { width: 26px; height: 26px; font-size: 10.5px; }
table.t td .avatar.sm { vertical-align: middle; }

/* the patient's history, a card per visit */
.year-head { font-size: 12px; font-weight: 800; letter-spacing: .08em; color: var(--ink-3); margin: 8px 2px -2px; }
.tl-card.vc { border-left: 5px solid var(--type, var(--line)); }
.tl-card.vc.missed { opacity: .75; }
.tl-card.vc header { flex-wrap: wrap; row-gap: 4px; }
.vc-note { border-bottom: 1px solid var(--hair); }
.vc-note:last-child { border-bottom: 0; }
.vc-note-head { display: flex; align-items: center; gap: 8px; padding: 5px 12px 0; font-size: 12px; }
.vc-empty { display: flex; align-items: center; gap: 8px; padding: 10px 12px; color: var(--warn); font-size: 13px; border-bottom: 1px solid var(--hair); }
.vc-empty .btn { margin-left: auto; }
.vc-lines { background: var(--panel-2); }
.vc-line { display: flex; align-items: center; gap: 9px; padding: 6px 12px; border-top: 1px solid var(--hair); font-size: 12.5px; cursor: default; }
.vc-lines .vc-line:first-child { border-top: 0; }
.vc-line .grow { min-width: 0; }
.vc-more { margin-top: 4px; white-space: pre-wrap; color: var(--ink-2); }
.tl-ic.sm { width: 26px; height: 26px; border-radius: 8px; flex: none; }
.tl-ic.sm .ms { font-size: 17px; }
.nowrap { white-space: nowrap; }
.tl-filter .seg { flex-wrap: wrap; }
