/* Prototype — the practice's own system, laid out after Praktika (Morgan, 18 Sep 2026). */
:root {
  --blue: #1e73be; --blue-dark: #155a96; --blue-pale: #e3eef9;
  --orange: #f7931e; --red: #e53935; --green: #2e9e4f; --yellow: #fff59d;
  --ink: #212121; --grey: #616161; --mute: #9e9e9e; --line: #d9dde1; --line-soft: #eceff1;
  --bg: #eef0f2; --card: #fff; --top: #dfe3e7; --side-w: 230px;
  --slot: 20px;             /* one 15 minute row in the book */
  --font: Roboto, "Helvetica Neue", Arial, sans-serif;
  --head-font: var(--font);
  /* the parts a look (data-theme) changes */
  --side-bg: #fff; --side-ink: var(--ink); --side-icon: #555; --side-active-bg: var(--blue-pale); --side-active-ink: var(--blue-dark); --side-line: var(--line-soft);
  --top-bg: var(--top); --top-ink: #37474f; --top-line: #cfd4d9;
  --day-bg: #e8ebee; --day-ink: #555; --today-bg: var(--blue); --today-ink: #fff; --chair-bg: #f4f5f6; --chair-ink: #616161;
  --grid-line: #eef1f3; --hour-line: #d5dadf; --closed: #c8c8c8; --time-ink: #616161;
  --card-radius: 6px; --appt-radius: 3px; --appt-ink: #212121; --appt-border: rgba(0,0,0,.25); --appt-shadow: none;
  --fab: var(--orange);
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { font: 14px/1.4 var(--font); color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
.ms { font-family: "Material Symbols Outlined"; font-weight: normal; font-style: normal; font-size: 20px; 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; }

/* ---- shell ---- */
.shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); height: 100vh; }
.shell.collapsed { --side-w: 64px; }
.side { background: var(--side-bg); color: var(--side-ink); border-right: 1px solid var(--side-line); overflow-y: auto; display: flex; flex-direction: column; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--side-line); font-weight: 700; }
.side-user .avatar { width: 34px; height: 34px; border-radius: 50%; background: #cfd8dc; display: grid; place-items: center; color: #fff; }
.nav-item { display: flex; align-items: center; gap: 14px; width: 100%; padding: 11px 16px; border: 0; background: none; text-align: left;
  cursor: pointer; text-decoration: none; color: var(--side-ink); font-size: 14px; }
.nav-item:hover { background: rgba(127,127,127,.1); }
.nav-item.on { background: var(--side-active-bg); color: var(--side-active-ink); font-weight: 700; }
.nav-item .ms { color: var(--side-icon); }
.nav-item.on .ms { color: var(--side-active-ink); }
.nav-item .grow { flex: 1; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; font-size: 12px; font-weight: 700; color: #fff; }
.badge.red { background: var(--red); } .badge.blue { background: var(--blue); }
.nav-sub { padding: 2px 0 6px 50px; display: grid; }
.nav-sub a { padding: 5px 0; color: var(--side-icon); opacity: .9; text-decoration: none; font-size: 13px; cursor: pointer; }
.nav-sub a:hover, .nav-sub a.on { color: var(--side-active-ink); opacity: 1; }
.nav-sub .group { margin: 6px 0 2px -14px; font-size: 12.5px; font-weight: 700; color: var(--side-active-ink); }
.side-foot { margin-top: auto; padding: 12px 16px; font-size: 11.5px; color: var(--mute); }
.shell.collapsed .nav-item span:not(.ms):not(.badge), .shell.collapsed .nav-sub, .shell.collapsed .side-user b, .shell.collapsed .side-foot { display: none; }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; }
.top { display: flex; align-items: center; gap: 12px; height: 56px; padding: 0 14px; background: var(--top-bg); border-bottom: 1px solid var(--top-line); flex: none; }
.top-title { margin: 0; font-size: 20px; font-weight: 400; color: var(--top-ink); font-family: var(--head-font); }
.top-end { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.top-end select { min-width: 190px; padding: 7px 10px; border: 1px solid #bfc6cd; border-radius: 4px; background: #f7f8f9; }
.proto-tag { padding: 4px 10px; border-radius: 12px; background: #fff3e0; color: #b25b00; font-size: 12px; font-weight: 700; }
.dot-ok { width: 14px; height: 14px; border-radius: 50%; background: #43a047; }
#view { flex: 1; min-height: 0; overflow: auto; }
.loading { padding: 30px; color: var(--mute); }

.icon-btn { display: inline-grid; place-items: center; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; cursor: pointer; color: #455a64; }
.icon-btn:hover { background: rgba(0,0,0,.06); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; padding: 6px 14px; border: 1px solid transparent;
  border-radius: 4px; background: #eceff1; cursor: pointer; font-weight: 500; text-transform: uppercase; font-size: 13px; letter-spacing: .02em; }
.btn:hover { filter: brightness(.96); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-orange { background: var(--orange); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-line { background: #fff; border-color: #b0bec5; color: var(--blue-dark); }
.btn-sm { min-height: 28px; padding: 3px 10px; font-size: 12px; }
.fab { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--fab); color: #fff; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,.25); display: grid; place-items: center; }
.fab .ms { font-size: 28px; }
input[type=text], input[type=search], input[type=email], input[type=tel], input[type=date], input[type=number], select, textarea {
  padding: 7px 9px; border: 1px solid #c3cad1; border-radius: 4px; background: #fff; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid #90caf9; outline-offset: 0; border-color: var(--blue); }
label.f, div.f { display: grid; gap: 3px; font-size: 12px; color: var(--grey); }
label.f > span, div.f > span { font-weight: 500; }
div.f > b { font-size: 14px; color: var(--ink); }
.muted { color: var(--mute); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--card-radius); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.page { padding: 16px 18px 30px; }
.later { padding: 40px; text-align: center; color: var(--grey); }
.later .ms { font-size: 48px; color: #b0bec5; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; padding: 10px 18px; border-radius: 6px;
  background: #263238; color: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 90vw; }

/* ---- dialogs ---- */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; background: rgba(0,0,0,.35); }
.modal-card { width: 100%; max-width: 640px; max-height: 92vh; overflow: hidden; display: flex; flex-direction: column; background: #fff; border-radius: 6px; box-shadow: 0 12px 40px rgba(0,0,0,.3); }
.modal-card.wide { max-width: 1100px; }
.modal-head { flex: none; display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--blue); color: #fff; }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 500; flex: 1; }
.modal-head .icon-btn { color: #fff; }
.modal-body { padding: 14px; display: grid; gap: 12px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot { flex: none; display: flex; gap: 8px; justify-content: flex-end; padding: 10px 14px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; }
.modal-foot .left { margin-right: auto; display: flex; gap: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.seg { display: inline-flex; border: 1px solid #b0bec5; border-radius: 4px; overflow: hidden; }
.seg button { border: 0; border-right: 1px solid #b0bec5; background: #fff; padding: 6px 12px; cursor: pointer; }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--blue); color: #fff; }
.type-chips, .icon-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.type-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 9px; border: 1px solid #cfd8dc; border-radius: 14px; background: #fff; cursor: pointer; font-size: 12.5px; }
.type-chip i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.2); }
.type-chip.on { border-color: var(--blue); background: var(--blue-pale); font-weight: 700; }
.icon-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border: 1px solid #cfd8dc; border-radius: 14px; background: #fff; cursor: pointer; font-size: 12px; }
.icon-chip.on { border-color: var(--blue); background: var(--blue-pale); }
.pt-results { display: grid; max-height: 220px; overflow: auto; border: 1px solid var(--line-soft); border-radius: 4px; }
.pt-results button { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 6px 10px; border: 0; border-bottom: 1px solid var(--line-soft); background: #fff; text-align: left; cursor: pointer; }
.pt-results button:hover { background: var(--blue-pale); }
.pt-picked { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 4px; background: #f1f8e9; border: 1px solid #c5e1a5; }
.pt-picked b { font-size: 15px; }
.warn { padding: 8px 10px; border-radius: 4px; background: #fff8e1; color: #8a5a00; font-size: 13px; }
.err { color: var(--red); font-size: 13px; }

/* ---- the book ---- */
.book { display: grid; grid-template-columns: minmax(0, 1fr) 250px; grid-template-rows: auto minmax(0, 1fr) auto; height: 100%; gap: 0 10px; padding: 10px; }
.book-bar { grid-column: 1; display: flex; align-items: center; gap: 10px; padding: 4px 4px 8px; }
.book-range { flex: 1; text-align: center; font-size: 22px; font-weight: 700; color: var(--ink); font-family: var(--head-font); }
.book-nav { display: flex; gap: 2px; }
.book-nav button { min-width: 34px; height: 30px; border: 1px solid #cfd8dc; background: #fff; border-radius: 3px; cursor: pointer; font-size: 13px; }
.book-grid-wrap { grid-column: 1; grid-row: 2; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--card-radius); position: relative; }
.book-grid { display: grid; position: relative; min-width: max-content; }
.bh-day { position: sticky; top: 0; z-index: 6; height: 26px; display: flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--day-bg); color: var(--day-ink); font-weight: 700; border-right: 2px solid var(--card); font-size: 13.5px; cursor: pointer; }
.bh-day.today { background: var(--today-bg); color: var(--today-ink); }
.bh-chair { position: sticky; top: 26px; z-index: 6; height: 24px; display: flex; align-items: center; justify-content: center; gap: 4px;
  background: var(--chair-bg); color: var(--chair-ink); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 500; }
.bh-chair i { font-style: normal; font-size: 11px; padding: 0 5px; border-radius: 8px; color: #333; }
.bh-corner { position: sticky; left: 0; top: 0; z-index: 8; background: var(--card); grid-row: span 2; border-bottom: 1px solid var(--line); }
.times { position: sticky; left: 0; z-index: 5; background: var(--card); border-right: 1px solid var(--hour-line); }
.time-hour { position: relative; border-bottom: 1px solid var(--hour-line); }
.time-hour b { position: absolute; left: 6px; top: 4px; font-size: 30px; font-weight: 500; color: var(--time-ink); line-height: .95; font-family: var(--head-font); }
.time-hour b small { display: block; font-size: 14px; font-weight: 500; text-align: center; }
.time-hour span { position: absolute; right: 4px; font-size: 10.5px; color: #9e9e9e; transform: translateY(-50%); }
.time-hour span::after { content: ""; display: inline-block; width: 6px; height: 1px; margin-left: 2px; background: #b0bec5; vertical-align: middle; }
.col { position: relative; border-right: 1px solid var(--line); cursor: cell;
  background-image: linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px); background-size: 100% var(--slot); }
.col.hour-lines { background-image: linear-gradient(to bottom, var(--hour-line) 1px, transparent 1px), linear-gradient(to bottom, var(--grid-line) 1px, transparent 1px);
  background-size: 100% calc(var(--slot) * 4), 100% var(--slot); }
.col.closed { background-color: var(--closed); cursor: default; }
.col.day-end { border-right: 2px solid #9eaab4; }
.col .now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid var(--red); z-index: 4; pointer-events: none; }
.appt { position: absolute; left: 2px; right: 2px; z-index: 2; overflow: hidden; border: 1px solid var(--appt-border); border-radius: var(--appt-radius);
  padding: 2px 16px 2px 4px; font-size: 11.5px; line-height: 1.25; cursor: pointer; user-select: none; background: var(--doc, #eee); color: var(--appt-ink); box-shadow: var(--appt-shadow); }
.appt::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 12px; background: var(--type, #ccc); border-left: 1px solid rgba(0,0,0,.15); }
.appt .who { font-weight: 700; display: flex; gap: 3px; align-items: flex-start; }
.appt .who .plus { color: var(--red); font-weight: 900; font-size: 13px; line-height: 1; }
.appt .who .n { display: inline-grid; place-items: center; min-width: 14px; height: 14px; border-radius: 2px; background: #1565c0; color: #fff; font-size: 10px; }
.appt .note { opacity: .82; white-space: pre-wrap; }
.appt .icons { position: absolute; left: 3px; right: 15px; bottom: 2px; display: flex; gap: 2px; align-items: center; flex-wrap: wrap-reverse; justify-content: flex-end; }
.appt .icons .ms { font-size: 16px; }
.appt .st { font-size: 16px; }
.appt.fta { opacity: .55; text-decoration: line-through; }
.appt.completed { filter: saturate(.75); }
.appt.dragging { opacity: .6; z-index: 20; box-shadow: 0 6px 18px rgba(0,0,0,.3); }
.appt .resize { position: absolute; left: 0; right: 12px; bottom: 0; height: 6px; cursor: ns-resize; }
.block { position: absolute; left: 1px; right: 1px; z-index: 1; padding: 3px 6px; font-weight: 700; font-size: 13px; color: #333; cursor: pointer;
  background: repeating-linear-gradient(135deg, #fbe3dc 0 6px, #f6c9bd 6px 8px); border: 1px solid #f3b8a8; }
.block.lunch { background: repeating-linear-gradient(135deg, #eeeeee 0 6px, #dcdcdc 6px 8px); border-color: #d5d5d5; color: #9e9e9e; text-align: center; font-weight: 500; letter-spacing: .2em; }
.memo { position: absolute; left: 1px; right: 1px; z-index: 2; padding: 2px 6px; background: #fff59d; border: 1px solid #e6d95c; font-size: 13px; cursor: pointer; }
.ghost { position: absolute; left: 2px; right: 2px; z-index: 19; border: 2px dashed var(--blue); background: rgba(30,115,190,.08); border-radius: 3px; pointer-events: none; font-size: 11px; color: var(--blue-dark); padding: 2px 4px; }

.book-side { grid-column: 2; grid-row: 1 / span 3; display: grid; gap: 12px; align-content: start; overflow: auto; }
.cal { padding: 10px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 16px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 6px; text-align: center; }
.cal-grid .dow { font-size: 11px; color: var(--mute); font-weight: 700; }
.cal-grid button { height: 28px; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.cal-grid button:hover { background: #eceff1; }
.cal-grid button.sel { background: var(--blue); color: #fff; font-weight: 700; }
.cal-grid button.today { outline: 1px solid var(--blue); }
.cal-grid button.out { color: #bdbdbd; }
.side-block { display: grid; gap: 6px; justify-items: center; }
.side-block .lbl { font-size: 12.5px; color: var(--mute); }
.days-seg { display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid #cfd8dc; border-radius: 4px; overflow: hidden; width: 100%; }
.days-seg button { border: 0; border-right: 1px solid #cfd8dc; background: #fafafa; padding: 5px 0; cursor: pointer; }
.days-seg button:last-child { border-right: 0; }
.days-seg button.on { background: var(--blue); color: #fff; }
.legend { display: grid; gap: 4px; width: 100%; }
.legend button { text-align: left; padding: 5px 10px; border: 1px solid rgba(0,0,0,.1); border-radius: 3px; cursor: pointer; font-size: 13px; }
.legend button.off { opacity: .35; }
.standby { grid-column: 1; grid-row: 3; display: flex; gap: 6px; align-items: stretch; padding-top: 8px; overflow-x: auto; }
.standby-actions { display: grid; gap: 4px; flex: none; }
.sb-card { flex: none; width: 160px; position: relative; padding: 4px 16px 4px 6px; border: 1px solid rgba(0,0,0,.2); border-radius: 3px; font-size: 11.5px; cursor: grab; }
.sb-card b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-card .meta { display: flex; gap: 6px; margin-top: 2px; color: #fff; }
.sb-card .meta span { padding: 0 5px; border-radius: 3px; background: #c62828; }
.sb-card .x { position: absolute; right: 2px; top: 2px; border: 0; background: none; cursor: pointer; color: #c62828; }

/* ---- tables and pages ---- */
table.t { width: 100%; border-collapse: collapse; background: var(--card); }
table.t th { position: sticky; top: 0; z-index: 1; padding: 8px 10px; background: var(--chair-bg); border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; color: #455a64; font-weight: 700; }
table.t td { padding: 7px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.t tr.link { cursor: pointer; }
table.t tr.link:hover td { background: #f5f9fd; }
.t-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--card-radius); background: var(--card); }
.search-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 12px; }
.search-row label.f { width: 170px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.tabs button { padding: 8px 14px; border: 1px solid transparent; border-bottom: 0; background: none; cursor: pointer; color: var(--grey); border-radius: 4px 4px 0 0; }
.tabs button.on { background: #fff; border-color: var(--line); color: var(--blue); font-weight: 700; margin-bottom: -1px; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 3px; font-size: 12px; font-weight: 700; border: 1px solid rgba(0,0,0,.15); }
.plus { color: var(--red); font-weight: 900; }
.page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.page-head h2 { margin: 0; font-size: 20px; font-weight: 500; flex: 1; font-family: var(--head-font); }

/* ---- patient file ---- */
.pf { display: grid; gap: 12px; }
.pf-top { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 12px; }
.pf-id { padding: 14px; display: grid; gap: 8px; align-content: start; }
.pf-name { display: flex; align-items: flex-start; gap: 10px; }
.pf-name h2 { margin: 0; font-size: 18px; flex: 1; }
.pf-name .plus { font-size: 30px; line-height: .8; }
.pf-avatar { width: 84px; height: 84px; border-radius: 6px; background: #eceff1; display: grid; place-items: center; color: #b0bec5; }
.pf-avatar .ms { font-size: 64px; }
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 3px 10px; font-size: 13px; }
.kv dt { color: var(--grey); text-align: right; }
.kv dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.pf-right { display: grid; gap: 12px; align-content: start; }
.pf-alerts { padding: 10px 14px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.pf-alerts h4 { margin: 0 0 2px; font-size: 12px; color: var(--grey); font-weight: 700; }
.pf-alerts .alert-text { color: var(--red); font-weight: 700; }
.pf-stats { padding: 10px 14px; display: flex; gap: 26px; flex-wrap: wrap; font-size: 13px; }
.pf-stats b { font-size: 15px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.tile { display: grid; justify-items: center; gap: 4px; padding: 10px 6px; border: 1px solid #cfd8dc; border-radius: 4px; background: #fafbfc; cursor: pointer;
  font-size: 11.5px; font-weight: 700; text-transform: uppercase; color: #37474f; text-align: center; }
.tile .ms { font-size: 30px; color: var(--blue); }
.tile.on { background: var(--blue-pale); border-color: var(--blue); }
.tile.soon { opacity: .55; }
.pf-section { padding: 14px; }
.note-card { border: 1px solid var(--line); border-radius: 4px; margin-bottom: 10px; }
.note-card header { display: flex; gap: 10px; align-items: center; padding: 6px 10px; background: #f4f5f6; font-size: 12.5px; }
.note-card header b { color: #263238; }
.note-card pre { margin: 0; padding: 10px; white-space: pre-wrap; font: 13px/1.45 "SF Mono", Menlo, Consolas, monospace; }
.note-editor textarea { width: 100%; min-height: 260px; font: 13px/1.45 "SF Mono", Menlo, Consolas, monospace; }

/* ---- today ---- */
.today { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 14px; }
.today h3 { margin: 0; padding: 10px 14px; font-size: 15px; border-bottom: 1px solid var(--line-soft); display: flex; gap: 8px; align-items: center; }
.today h3 .count { margin-left: auto; }
.row-item { display: flex; gap: 10px; align-items: center; padding: 8px 14px; border-bottom: 1px solid var(--line-soft); cursor: pointer; }
.row-item:hover { background: #f5f9fd; }
.row-item .time { width: 70px; color: var(--grey); font-variant-numeric: tabular-nums; }
.row-item .grow { flex: 1; min-width: 0; }
.empty { padding: 14px; color: var(--mute); }
.status-pill { padding: 1px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 700; background: #eceff1; }
.status-pill.arrived { background: #fff3e0; color: #b25b00; }
.status-pill.seated { background: #e3f2fd; color: #1565c0; }
.status-pill.completed { background: #e8f5e9; color: #2e7d32; }
.status-pill.fta { background: #ffebee; color: #c62828; }
.status-pill.confirmed { background: #f3e5f5; color: #6a1b9a; }

@media (max-width: 1100px) {
  .book { grid-template-columns: minmax(0, 1fr); }
  .book-side { display: none; }
  .pf-top, .today { grid-template-columns: 1fr; }
}
@media (max-width: 800px) { .shell { --side-w: 64px; } .shell .nav-item span:not(.ms):not(.badge), .shell .nav-sub, .shell .side-user b, .shell .side-foot { display: none; } .proto-tag { display: none; } }

/* ---- login (the note app's login page, restyled) ---- */
.login-body { min-height: 100vh; display: grid; align-content: start; background: var(--bg); }
.banner { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: var(--top); border-bottom: 1px solid #cfd4d9; }
.brand-logo { height: 44px; }
.brand-name { margin: 0; font-size: 22px; font-weight: 500; color: #37474f; }
.login-wrap { display: grid; justify-items: center; gap: 12px; padding: 40px 16px; }
.login-card { width: 100%; max-width: 420px; padding: 24px; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.06); }
.login-form { display: grid; gap: 8px; }
.login-form h1 { margin: 0 0 4px; font-size: 24px; font-weight: 500; }
.login-intro { margin: 0 0 6px; color: var(--grey); line-height: 1.45; }
.login-label { margin-top: 6px; font-size: 13px; font-weight: 700; }
.login-input { width: 100%; min-height: 44px; font-size: 16px; padding: 8px 10px; border: 1px solid #c3cad1; border-radius: 4px; }
.login-btn { margin-top: 10px; min-height: 46px; font-size: 15px; }
.login-links { margin: 6px 0 0; text-align: center; }
.login-foot { max-width: 420px; text-align: center; font-size: 12.5px; color: var(--mute); }
.link-btn { border: 0; background: none; padding: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font-size: 14px; }
.field-error { font-size: 13px; font-weight: 700; color: var(--red); }
.field-error:empty { display: none; }
.fineprint { font-size: 12.5px; color: var(--mute); }

/* ---- 0.3: right click menus, Management ---- */
.ctx { position: fixed; z-index: 70; min-width: 220px; max-height: 80vh; overflow: auto; padding: 4px 0; background: #fff; border: 1px solid #cfd8dc; border-radius: 6px; box-shadow: 0 8px 28px rgba(0,0,0,.22); }
.ctx-title { padding: 6px 12px 6px; font-size: 12px; font-weight: 700; color: var(--grey); border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; white-space: nowrap; }
.ctx-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 12px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 13.5px; }
.ctx-item:hover:not(:disabled) { background: var(--blue-pale); }
.ctx-item:disabled { color: #bdbdbd; cursor: default; }
.ctx-item .ms { font-size: 18px; color: #607d8b; }
.ctx-item.danger { color: var(--red); } .ctx-item.danger .ms { color: var(--red); }
.ctx-item .ctx-check { margin-left: auto; color: var(--blue); }
.ctx-sep { height: 1px; margin: 4px 0; background: var(--line-soft); }
.appt { font-size: var(--appt-font, 11.5px); padding-right: calc(var(--strip, 12px) + 4px); }
.appt::after { width: var(--strip, 12px); }
.appt .icons { right: calc(var(--strip, 12px) + 3px); }
.appt .resize { right: var(--strip, 12px); }
.plain-names .appt .who { font-weight: 400; }
.no-grid .col { background-image: none !important; }
.appt.cut { outline: 2px dashed var(--blue); opacity: .6; }
.attention { display: grid; gap: 12px; }
.attention-head { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 6px; background: #ffebee; color: #b71c1c; }
.attention-head .plus { font-size: 36px; }
.attention-head b { font-size: 20px; } .attention-head p { margin: 2px 0 0; }
.alert-text { color: var(--red); font-weight: 700; }
.manage-card { padding: 16px; display: grid; gap: 12px; max-width: 980px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check-row input { width: 16px; height: 16px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--ink); }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.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: 14px; }
.save-row { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 8px; border-top: 1px solid var(--line-soft); }
.save-row .btn-line { margin-right: auto; }
.row-tools { white-space: nowrap; width: 80px; }
.glyphs { display: flex; flex-wrap: wrap; gap: 2px; }
.glyphs .icon-btn { width: 28px; height: 28px; }
.glyphs .icon-btn.on { background: var(--blue-pale); outline: 2px solid var(--blue); }
.fee-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.fee-card { position: relative; display: grid; place-items: center; gap: 6px; width: 120px; height: 110px; padding: 8px; border: 1px solid #cfd8dc; border-radius: 6px; background: #fafbfc; cursor: pointer; text-align: center; }
.fee-card:hover { border-color: var(--blue); }
.fee-card.default { background: #e3f2fd; border-color: var(--blue); }
.fee-card.shared { background: #fde2e4; border-color: #f4a6ae; }
.fee-card.new { background: #e8f5e9; border-color: #a5d6a7; color: var(--green); }
.fee-flag { position: absolute; top: 6px; left: 6px; padding: 1px 6px; border-radius: 3px; font-size: 10px; font-weight: 700; background: #66bb6a; color: #fff; }
.fee-flag.red { background: #e53935; }
.shared-head { margin: 8px 0 0; padding: 6px 10px; background: #ffe0b2; border-radius: 4px; font-size: 14px; }
.shared-row { padding: 10px; background: #fff3e0; border-radius: 0 0 4px 4px; }

/* =================================================================== looks (Morgan: "improve the aesthetics")
   classic  Praktika's layout, tidied
   teal     The Endodontic Centre's colours (the website and note app palette), Mulish with Playfair headings
   (calm and night were tried and dropped, Morgan 18 Sep 2026: "TEC teal and classic looks the best")          */

/* ---- classic, refined (the default) ---- */
:root, [data-theme="classic"] {
  --appt-radius: 4px; --card-radius: 8px; --appt-border: rgba(0,0,0,.18); --appt-shadow: 0 1px 1px rgba(0,0,0,.06);
  --grid-line: #f0f2f4; --hour-line: #d6dbe0;
}

/* ---- TEC teal ---- */
[data-theme="teal"] {
  --blue: #4d96a3; --blue-dark: #326e79; --blue-pale: #e1eff2; --orange: #e0a458; --green: #3f8f6b;
  --ink: #2a2a2c; --grey: #58585b; --mute: #85868a; --line: #dfe6e8; --line-soft: #edf2f3; --bg: #f3f7f8;
  --font: Mulish, "Avenir Next", "Helvetica Neue", Arial, sans-serif; --head-font: "Playfair Display", Georgia, serif;
  --side-bg: linear-gradient(180deg, #326e79 0%, #2a5d66 100%); --side-ink: #eaf4f6; --side-icon: #bfe0e6; --side-active-bg: rgba(255,255,255,.16);
  --side-active-ink: #fff; --side-line: rgba(255,255,255,.14);
  --top-bg: #ffffff; --top-ink: #326e79; --top-line: #e3eced;
  --day-bg: #f0f7f9; --day-ink: #326e79; --today-bg: #326e79; --chair-bg: #fafcfc; --chair-ink: #58585b;
  --grid-line: #f1f6f7; --hour-line: #d7e6e9; --closed: #e9eef0; --time-ink: #4d96a3;
  --card-radius: 12px; --appt-radius: 8px; --appt-border: rgba(50,110,121,.18); --appt-shadow: 0 1px 3px rgba(50,110,121,.14);
  --fab: #326e79;
}
[data-theme="teal"] .col.closed { background-image: repeating-linear-gradient(135deg, transparent 0 8px, rgba(50,110,121,.05) 8px 10px); }
[data-theme="teal"] .side-user { color: #fff; }
[data-theme="teal"] .side-user .avatar { background: rgba(255,255,255,.2); }
[data-theme="teal"] .side-foot { color: #bfe0e6; }
[data-theme="teal"] .btn { border-radius: 999px; text-transform: none; letter-spacing: 0; font-weight: 700; }
[data-theme="teal"] .top-title { font-size: 24px; }
[data-theme="teal"] .book-range { font-weight: 600; }
[data-theme="teal"] .block { background: repeating-linear-gradient(135deg, #fdf1ea 0 6px, #f8e0d3 6px 8px); border-color: #f1cdb9; border-radius: 8px; }
[data-theme="teal"] .block.lunch { background: #f3f7f8; border: 1px dashed #cfdfe3; color: #9bb3b8; border-radius: 8px; }
[data-theme="teal"] .memo { border-radius: 8px; background: #fff6d6; border-color: #f0dc8a; }
[data-theme="teal"] .modal-head { background: #326e79; }
[data-theme="teal"] .tile .ms { color: #4d96a3; }

/* the look picker in the top bar */
.look { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--top-ink); }
.look select { min-width: 0 !important; padding: 5px 8px !important; }

/* ---- the treatment type strip (Morgan: "treatment type needs to be visible for each patient, we go by the colour") ----
   Praktika's "enlarged treatment type strips", 25% of the appointment by default, with the type's label in it. */
.appt { padding-right: calc(var(--strip, 25%) + 4px); }
.appt::after { width: var(--strip, 25%); border-left: 1px solid rgba(0,0,0,.12); }
[data-theme="teal"] .appt::after { border-radius: 0 7px 7px 0; }
.appt .type-tag { position: absolute; top: 0; right: 0; z-index: 1; width: var(--strip, 25%); padding-top: 3px; text-align: center; font-size: 11px; font-weight: 800;
  letter-spacing: .02em; line-height: 1.1; overflow: hidden; white-space: nowrap; pointer-events: none; }
.appt .icons { right: calc(var(--strip, 25%) + 3px); }
.appt .resize { right: var(--strip, 25%); }
.sb-card { padding-right: 34px; }
.sb-card .sb-type { position: absolute; top: 0; right: 0; bottom: 0; width: 28px; display: grid; place-items: center; font-size: 10px; font-weight: 800; border-left: 1px solid rgba(0,0,0,.12); }
.sb-card .x { right: 30px; }

/* ---- 0.4: Appointment Details (check in and check out) ---- */
.modal-card.ad-card { max-width: 1240px; }
.ad { display: grid; gap: 10px; }
.ad-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; }
.ad-row .grow, .ad-bar .grow { flex: 1; }
.lbl-inline { color: var(--blue); font-size: 12.5px; margin-right: 6px; }
.inline-f { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--grey); }
.ad-status button { padding: 4px 10px; font-size: 12.5px; }
.done-pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 12px; background: #e8f5e9; color: #2e7d32; font-weight: 700; font-size: 12.5px; }
.ad-patient { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--card-radius); background: var(--card); }
.ad-cross { border: 0; background: none; color: var(--red); font-size: 34px; line-height: 1; cursor: pointer; }
.ad-who { flex: 1; display: grid; gap: 2px; font-size: 13px; }
.ad-who b { font-size: 17px; }
.ad-who a { color: var(--ink); font-weight: 700; }
.ad-pbtns { display: grid; gap: 6px; }
.ad-panel { border: 1px solid var(--line); border-radius: var(--card-radius); background: var(--card); overflow: hidden; }
.ad-bar { display: flex; align-items: center; gap: 6px; padding: 6px 8px; border-bottom: 1px solid var(--line-soft); background: var(--chair-bg); }
.ad-bar .btn { min-height: 28px; padding: 2px 8px; }
.ad-title { margin-left: 6px; color: var(--blue); font-weight: 700; font-size: 13px; }
.ad-table { border: 0; border-radius: 0; max-height: 240px; }
.ad-table td.num, td.num, .num { text-align: right; font-variant-numeric: tabular-nums; }
.ad-table td.total { font-weight: 700; color: var(--red); }
table.t tr.sel td { background: var(--blue-pale) !important; }
.owing { color: var(--red); } .paid { color: var(--green); }
.ad-balances { display: flex; flex-wrap: wrap; gap: 8px 26px; padding: 8px 12px; border-radius: var(--card-radius); background: var(--blue-pale); font-size: 13px; }
.ad-balances b { font-weight: 700; }
.ad-notes { display: flex; gap: 8px; align-items: flex-start; }
.ad-note-list { flex: 1; border: 1px solid #f0e6b2; border-radius: var(--card-radius); overflow: hidden; max-height: 180px; overflow-y: auto; }
.ad-note { display: flex; align-items: center; gap: 12px; padding: 7px 10px; background: #fffbe6; border-bottom: 1px solid #f3ebc4; font-size: 13px; }
.ad-note .when { width: 150px; color: var(--grey); font-variant-numeric: tabular-nums; }
.ad-note .who { width: 34px; font-weight: 700; color: var(--grey); }
.ad-note .what { flex: 1; }
.ad-note input { flex: 1; }
.ad-note .del { visibility: hidden; width: 28px; height: 28px; }
.ad-note:hover .del { visibility: visible; }
.ad-foot { display: flex; justify-content: space-between; gap: 10px; width: 100%; flex-wrap: wrap; }
.ad-foot-left { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1; }
.ad-foot-right { display: flex; gap: 6px; align-items: flex-end; }
.ad-foot .btn .ms { font-size: 17px; }
.foot-break { flex-basis: 100%; height: 0; }
.ad-type { max-width: 220px; }
.btn.on { outline: 2px solid var(--blue); }
.btn-hicaps { background: #fff; border-color: #b0bec5; color: #0d47a1; font-weight: 700; }
.proc { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 14px; }
.proc-left { display: grid; gap: 8px; align-content: start; }
.proc-head { display: grid; gap: 6px; }
.proc-list { max-height: 360px; overflow: auto; border: 1px solid var(--line); border-radius: 6px; }
.proc-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) 90px 44px; gap: 8px; width: 100%; padding: 6px 8px; border: 0; border-bottom: 1px solid var(--line-soft); background: var(--card); text-align: left; cursor: pointer; font-size: 13px; }
.proc-row:hover { background: var(--blue-pale); } .proc-row.on { background: #dcedc8; }
.proc-form { display: grid; gap: 10px; align-content: start; }
.proc-pick { padding: 8px 10px; border-radius: 6px; background: #f1f8e9; min-height: 38px; }
.surfaces { display: flex; gap: 4px; flex-wrap: wrap; }
.surfaces button { width: 34px; height: 30px; border: 1px solid #b0bec5; border-radius: 4px; background: #fff; cursor: pointer; font-weight: 700; }
.surfaces button.on { background: var(--blue); color: #fff; border-color: var(--blue); }
.code-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.code-chip { padding: 2px 8px; border: 1px solid #cfd8dc; border-radius: 12px; background: #fafafa; font-size: 12px; font-variant-numeric: tabular-nums; }
.pay-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-top: 8px; }
.notes-scroll { max-height: 55vh; overflow: auto; }
.status-pill.left { background: #fff8e1; color: #8d6e00; } .status-pill.cancelled { background: #ffebee; color: #c62828; }
.appt.completed { filter: saturate(.55) brightness(1.06); }
.arr-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.arr-card { width: 210px; display: grid; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: var(--card-radius); background: var(--card); cursor: pointer; box-shadow: 0 1px 2px rgba(0,0,0,.05); }
.arr-card:hover { border-color: var(--blue); }
.arr-card.seated { border-color: #90caf9; } .arr-card.arrived { border-color: #ffcc80; }
.arr-slot { display: grid; gap: 2px; padding: 6px 8px; border-radius: 6px; font-size: 12px; }
.arr-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.arr-btn { padding: 4px 0; border: 1px solid #cfd8dc; border-radius: 4px; background: #fff; font-size: 11.5px; font-weight: 700; cursor: pointer; text-transform: uppercase; }
.arr-btn.red.on { background: #e53935; color: #fff; border-color: #e53935; }
.arr-btn.green.on { background: #43a047; color: #fff; border-color: #43a047; }
.arr-btn.grey.on { background: #8d6e00; color: #fff; border-color: #8d6e00; }
.arr-cards.compact .arr-card { width: 190px; }
.arr-cards.compact { padding: 10px; }
