:root {
  color-scheme: light;
  --surface: #fff;
  --page: #f3f6fa;
  --stroke: #e0e7f0;
  --stroke-strong: #cbd6e5;
  --ink: #182940;
  --subtle: #53647a;
  --muted: #68798e;
  --action: #225bd3;
  --action-hover: #174ab7;
  --blue-bg: #eaf1ff;
  --blue-text: #214fad;
  --teal-bg: #e0f5f1;
  --teal-text: #096255;
  --violet-bg: #efebfd;
  --violet-text: #5b409f;
  --amber-bg: #fff1da;
  --amber-text: #855010;
  --rose-bg: #ffebef;
  --rose-text: #972d4b;
  --neutral-bg: #eaf0f6;
  --neutral-text: #475870;
  --radius: 13px;
  --sidebar: 216px;
  --header: 65px;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--page);
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
a { color: inherit; text-decoration: none; }
button, a, input, select, textarea, [tabindex] { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid #194fcd; outline-offset: 3px; }
[hidden] { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip { position: fixed; z-index: 50; top: 10px; left: 10px; transform: translateY(-150%); padding: 11px; background: white; border: 2px solid var(--action); }
.skip:focus { transform: translateY(0); }
svg { flex-shrink: 0; vertical-align: middle; }
h1, h2, h3, p { margin: 0; }
small { color: var(--muted); }

.sidebar {
  display: flex; flex-direction: column; position: fixed; z-index: 10; left: 0; top: 0; bottom: 0;
  width: var(--sidebar); padding: 0 13px 14px; border-right: 1px solid var(--stroke); background: #fbfcff; overflow: auto;
}
.brand {
  display: flex; align-items: center; gap: 10px; width: fit-content; min-height: var(--header); padding: 0 8px;
  font-size: 28px; line-height: 1; font-weight: 750; letter-spacing: -1.55px;
}
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; color: white; background: var(--action); border-radius: 10px; }
.sidebar-workspace { display: flex; align-items: center; gap: 9px; margin: 12px 3px 24px; padding: 9px; border: 1px solid var(--stroke); border-radius: 10px; }
.workspace-icon, .avatar { display: grid; place-items: center; flex-shrink: 0; }
.workspace-icon { width: 32px; height: 32px; border-radius: 8px; color: var(--blue-text); background: var(--blue-bg); }
.sidebar-workspace strong, .operator strong { display: block; font-size: 13px; line-height: 1.35; }
.sidebar-workspace small, .operator small { display: block; font-size: 11px; line-height: 1.4; }
.nav-label { font-size: 11px; font-weight: 650; letter-spacing: .035em; color: var(--muted); margin: 0 0 8px 10px; }
.second-label { margin-top: 25px; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 10px; margin: 2px 0;
  border-radius: 8px; color: #465a73; font-weight: 550;
}
.nav-link:hover { background: #f0f4fa; color: var(--ink); }
.nav-link.is-current { background: #e6efff; color: #1749b2; font-weight: 700; }
.nav-link.is-current::before { content: ""; position: absolute; left: 0; top: 11px; bottom: 11px; width: 3px; border-radius: 2px; background: var(--action); }
.nav-count, .count-badge {
  flex-shrink: 0; display: inline-grid; place-items: center; min-width: 23px; height: 23px; padding: 0 5px;
  border-radius: 7px; background: var(--neutral-bg); color: var(--neutral-text); font-size: 11px; font-weight: 700;
}
.nav-count { margin-left: auto; height: 20px; min-width: 20px; }
.sidebar-bottom { margin-top: auto; padding: 26px 7px 0; }
.local-badge { display: flex; gap: 7px; align-items: center; margin-bottom: 8px; color: var(--subtle); font-size: 11px; }
.local-badge span { width: 6px; height: 6px; border-radius: 50%; background: #167b68; }
.text-button { display: inline-flex; align-items: center; gap: 7px; min-height: 32px; background: none; border: 0; padding: 0; font-size: 12px; }
.quiet { color: var(--subtle); }
.text-button:hover { color: var(--action); }
.operator { display: flex; align-items: center; gap: 9px; border-top: 1px solid var(--stroke); margin-top: 9px; padding-top: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 9px; font-size: 12px; font-weight: 720; background: var(--neutral-bg); color: var(--neutral-text); }
.blue { --tone-bg: var(--blue-bg); --tone-ink: var(--blue-text); }
.teal { --tone-bg: var(--teal-bg); --tone-ink: var(--teal-text); }
.violet { --tone-bg: var(--violet-bg); --tone-ink: var(--violet-text); }
.amber { --tone-bg: var(--amber-bg); --tone-ink: var(--amber-text); }
.rose { --tone-bg: var(--rose-bg); --tone-ink: var(--rose-text); }
.neutral { --tone-bg: var(--neutral-bg); --tone-ink: var(--neutral-text); }
.avatar, .chip, .metric-icon, .attention-dot, .event { background: var(--tone-bg, var(--neutral-bg)); color: var(--tone-ink, var(--neutral-text)); }
.workspace { margin-left: var(--sidebar); min-width: 0; }
.topbar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px; height: var(--header); padding: 0 28px;
  background: var(--surface); border-bottom: 1px solid var(--stroke);
}
.topbar-leading, .topbar-actions { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-leading > [data-action="menu"] { display: none; }
.search-trigger, .branch-control {
  display: flex; align-items: center; gap: 8px; height: 37px; padding: 0 10px; border: 1px solid var(--stroke);
  border-radius: 8px; background: #f8faff; color: var(--subtle);
}
.search-trigger { justify-content: flex-start; min-width: 248px; font-size: 12px; text-align: left; }
.search-trigger:hover, .branch-control:hover { border-color: var(--stroke-strong); }
kbd { margin-left: auto; color: var(--muted); font-size: 10px; font-family: inherit; padding: 2px 5px; border: 1px solid var(--stroke); border-radius: 4px; white-space: nowrap; }
.branch-control { position: relative; background: white; color: var(--ink); }
.branch-control:focus-within { outline: 2px solid var(--action); outline-offset: 2px; }
.branch-control select { min-height: 35px; appearance: none; border: 0; padding: 0 21px 0 0; background: transparent; font-size: 12px; font-weight: 650; cursor: pointer; }
.branch-control select:focus { outline: none; }
.branch-control > svg:last-child { position: absolute; right: 9px; pointer-events: none; }
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 36px; border-radius: 8px;
  padding: 0 12px; border: 1px solid transparent; font-weight: 650; font-size: 12px; line-height: 1.3; text-align: center;
}
.button.primary { background: var(--action); color: white; }
.button.primary:hover:not(:disabled) { background: var(--action-hover); }
.button.secondary { background: white; border-color: var(--stroke-strong); color: var(--ink); }
.button.secondary:hover:not(:disabled) { background: #f7faff; border-color: #aebfd7; }
.button.danger { background: #a02747; color: white; }
.button.danger-quiet { color: var(--rose-text); background: var(--rose-bg); }
.icon-button {
  display: inline-grid; place-items: center; width: 35px; height: 35px; flex: 0 0 auto; border-radius: 7px;
  border: 1px solid var(--stroke); background: white; color: var(--subtle); padding: 0;
}
.icon-button:hover { color: var(--action); border-color: var(--stroke-strong); }
.link-button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; color: var(--blue-text); font-size: 12px; font-weight: 650; }
.link-button:hover { text-decoration: underline; text-underline-offset: 3px; }

main { max-width: 1650px; margin: 0 auto; padding: 28px 28px 40px; outline: none; }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; }
.page-heading h1 { font-size: clamp(26px, 2.75vw, 38px); line-height: 1.08; letter-spacing: -.045em; font-weight: 750; overflow-wrap: anywhere; }
.page-heading p { margin-top: 7px; color: var(--subtle); font-size: 13px; }
.page-actions, .date-controls { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.date-field { display: inline-flex; }
.date-field input, .filter select, .inline-search {
  min-height: 35px; border: 1px solid var(--stroke-strong); border-radius: 8px; padding: 0 9px; background: white; color: var(--ink); font-size: 12px;
}
.date-field input { min-width: 122px; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; margin-bottom: 18px; }
.metric { min-width: 0; min-height: 115px; border: 1px solid var(--stroke); background: white; border-radius: var(--radius); padding: 13px 15px; }
.metric-head { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: var(--subtle); font-size: 12px; font-weight: 650; }
.metric-icon, .attention-dot {
  display: inline-grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px;
}
.metric strong { display: block; margin: 2px 0 2px; font-size: clamp(21px, 2.15vw, 32px); font-weight: 730; letter-spacing: -.035em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.metric small { font-size: 11px; }
.panel { min-width: 0; border: 1px solid var(--stroke); border-radius: var(--radius); background: var(--surface); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 66px; padding: 13px 16px; }
.panel-heading h2 { font-size: 17px; line-height: 1.25; letter-spacing: -.022em; }
.panel-heading p { font-size: 12px; color: var(--muted); margin-top: 4px; }
.panel-heading.compact { min-height: 49px; padding: 12px 14px 7px; }
.panel-heading.compact h2 { font-size: 15px; }
.panel-link { margin: 0 16px 12px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(244px, 270px); gap: 16px; align-items: start; }
.overview-rail { min-width: 0; display: grid; gap: 14px; }
.side-items { padding: 2px 10px 8px; }
.attention-item, .queue-item {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 8px;
  width: 100%; min-height: 48px; border: 0; background: transparent; text-align: left; padding: 5px 4px; border-radius: 7px;
}
.attention-item:hover, .queue-item:hover { background: #f1f6ff; }
.attention-item strong, .queue-item strong, .row-person strong { display: block; font-size: 12px; line-height: 1.35; }
.attention-item small, .queue-item small, .row-person small { display: block; margin-top: 2px; font-size: 11px; }
.attention-item > svg, .queue-item > svg { color: #60758e; }
.subtle-empty { padding: 12px; color: var(--subtle); font-size: 13px; }

.timeline { --resource: 153px; border-block: 1px solid var(--stroke); }
.timeline-header, .timeline-row { display: grid; grid-template-columns: var(--resource) minmax(0, 1fr); }
.timeline-header { min-height: 39px; background: #f7faff; border-bottom: 1px solid var(--stroke); color: var(--subtle); font-size: 11px; }
.timeline-header > span { display: grid; align-items: center; padding-left: 13px; font-weight: 650; }
.times { display: grid; grid-template-columns: repeat(9, minmax(0, 1fr)); align-items: center; border-left: 1px solid var(--stroke); font-variant-numeric: tabular-nums; }
.times span { padding-left: 5px; }
.timeline-row { min-height: 69px; border-bottom: 1px solid var(--stroke); }
.timeline-row:last-child { border-bottom: 0; }
.chair-cell { display: flex; gap: 8px; align-items: center; min-width: 0; padding: 8px 12px; }
.chair-cell .avatar { width: 31px; height: 31px; font-size: 10px; }
.chair-cell strong, .chair-cell small { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chair-cell > div { min-width: 0; }
.chair-cell strong { font-size: 12px; }
.chair-cell small { margin-top: 3px; font-size: 10px; }
.track {
  position: relative; overflow: hidden; min-height: 68px; border-left: 1px solid var(--stroke);
  background-image: linear-gradient(to right, transparent calc(100% - 1px), #eaf0f8 calc(100% - 1px));
  background-size: calc(100% / 9) 100%;
}
.event, .gap {
  position: absolute; left: calc(var(--start) + 3px); width: calc(var(--duration) - 6px); top: 9px; bottom: 9px;
  display: flex; flex-direction: column; justify-content: center; gap: 3px; overflow: hidden; border-radius: 6px; padding: 3px 5px;
  text-align: left; font-size: 10px; line-height: 1.14;
}
.event { border: 1px solid color-mix(in srgb, var(--tone-ink) 13%, var(--tone-bg)); border-left: 2px solid color-mix(in srgb, var(--tone-ink) 65%, white); }
.event:hover { border-color: var(--tone-ink); }
.event strong { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.event span { font-variant-numeric: tabular-nums; }
.gap { align-items: center; flex-direction: row; border: 1px dashed #aebfdb; background: #f9fbff; color: var(--blue-text); font-weight: 600; padding: 2px; }
.gap span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gap:hover { border-color: var(--action); background: var(--blue-bg); }
.event:focus-visible, .gap:focus-visible { outline-offset: -2px; }
.schedule-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 9px; min-height: 45px; padding: 9px 13px; }
.chip { display: inline-flex; align-items: center; gap: 5px; width: fit-content; border-radius: 5px; padding: 4px 6px; font-size: 10px; font-weight: 700; line-height: 1.2; white-space: nowrap; }
.chip-dot { width: 5px; height: 5px; flex-shrink: 0; border-radius: 50%; background: currentColor; }
.view-switch { display: flex; gap: 3px; }
.view-switch [aria-pressed="true"] { background: var(--blue-bg); border-color: #b9cdf7; color: var(--blue-text); }
.list-schedule, .desktop-schedule.is-hidden { display: none; }
.list-schedule.is-active { display: block; }
.schedule-list-group { border-top: 1px solid var(--stroke); }
.schedule-list-group > .chair-cell { background: #f7faff; }
.list-events { padding: 5px 12px 9px; }
.schedule-list-item {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 8px; align-items: center; text-align: left;
  background: none; border: 0; border-radius: 6px; min-height: 45px; width: 100%; padding: 5px 7px;
}
.schedule-list-item:hover { background: #eff5ff; }
.schedule-list-item strong, .schedule-list-item small { display: block; }
.schedule-list-item small { font-size: 11px; margin-top: 3px; }
.schedule-list-item time { font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.schedule-list-item.open { color: var(--blue-text); }
.schedule-list-item.open > svg { margin-right: 4px; }

.table-scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 11px 14px; border-top: 1px solid var(--stroke); font-size: 13px; }
th { color: var(--subtle); background: #f8faff; font-size: 11px; letter-spacing: .015em; white-space: nowrap; }
td small { display: block; margin-top: 3px; font-size: 11px; }
tr:last-child td:first-child { border-bottom-left-radius: var(--radius); }
tr:last-child td:last-child { border-bottom-right-radius: var(--radius); }
.row-action { text-align: right; white-space: nowrap; }
.row-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.row-person { display: flex; align-items: center; gap: 9px; min-width: 0; }
a.row-person:hover strong, .messages a:hover strong { color: var(--blue-text); text-decoration: underline; }
.inline-search { display: flex; gap: 5px; align-items: center; color: var(--subtle); }
.inline-search input { width: 175px; min-width: 0; border: 0; background: transparent; min-height: 30px; }
.muted { color: var(--subtle); }
.empty {
  min-height: 166px; display: flex; align-items: center; justify-content: center; flex-direction: column; text-align: center;
  border-top: 1px solid var(--stroke); padding: 20px 14px; gap: 8px;
}
.empty-icon { display: inline-grid; place-items: center; width: 40px; height: 40px; color: var(--blue-text); background: var(--blue-bg); border-radius: 11px; }
.empty p { color: var(--subtle); font-size: 13px; }
.padded { padding: 15px 16px; }
.stack { display: grid; gap: 10px; }
.stack > .button { justify-self: start; }
.cash-grid, .chart-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 300px); align-items: start; gap: 15px; }
.cash-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.messages { padding: 0 12px 8px; }
.message-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 62px; padding: 8px 5px; border-top: 1px solid var(--stroke); }
.message-row p { margin-top: 4px; color: var(--subtle); font-size: 12px; }
.report-row { display: grid; grid-template-columns: 155px minmax(0, 1fr) auto; align-items: center; gap: 9px; }
.report-row .chair-cell { padding-left: 0; }
.report-row progress { width: 100%; height: 8px; border: 0; border-radius: 8px; overflow: hidden; appearance: none; }
.report-row progress::-webkit-progress-bar { background: var(--neutral-bg); }
.report-row progress::-webkit-progress-value { background: var(--action); border-radius: 8px; }
.report-row progress::-moz-progress-bar { background: var(--action); border-radius: 8px; }
.report-row strong { font-size: 12px; }

.back-link { display: inline-flex; align-items: center; gap: 5px; color: var(--blue-text); font-size: 12px; margin-bottom: 13px; }
.patient-header { display: flex; gap: 13px; align-items: flex-start; }
.patient-header > .avatar { width: 53px; height: 53px; font-size: 18px; border-radius: 13px; }
.patient-header > .page-heading { flex: 1; min-width: 0; }
.patient-tabs { display: flex; flex-wrap: wrap; gap: 3px; border-bottom: 1px solid var(--stroke-strong); margin-bottom: 14px; }
.patient-tabs > a { padding: 10px 12px; border-bottom: 2px solid transparent; color: var(--subtle); font-weight: 600; font-size: 13px; }
.patient-tabs > a[aria-selected="true"] { color: var(--blue-text); border-color: var(--action); }
.patient-tabs > a:hover { color: var(--blue-text); }
.tooth-board { padding: 16px 11px; background: #f8fbff; border-block: 1px solid var(--stroke); overflow-x: auto; }
.tooth-row { display: grid; grid-template-columns: repeat(16, minmax(25px, 1fr)); gap: 4px; min-width: 476px; }
.tooth-row + .tooth-row { margin-top: 12px; }
.tooth-button {
  display: grid; place-items: center; gap: 3px; min-height: 48px; padding: 4px 0; border: 1px solid #dbe5f2;
  border-radius: 7px; color: #51647d; background: white; font-size: 10px; font-weight: 650;
}
.tooth-button.has-finding { background: var(--blue-bg); color: var(--blue-text); }
.tooth-button[aria-pressed="true"] { background: var(--action); color: white; border-color: var(--action); }
.tooth-button:hover:not([aria-pressed="true"]) { border-color: var(--action); }
.finding h3 { margin-top: 8px; font-size: 16px; }
.plan-options { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.plan-total { font-size: 25px; letter-spacing: -.025em; }
.segments { display: flex; gap: 3px; padding: 3px; border-radius: 8px; background: var(--neutral-bg); }
.segments button { min-height: 30px; padding: 4px 8px; border: 1px solid transparent; background: none; border-radius: 6px; font-size: 12px; font-weight: 600; }
.segments button[aria-pressed="true"] { background: white; color: var(--blue-text); border-color: var(--stroke); }
.diary-form { margin-top: 13px; }
.read-fields, .money-lines { margin: 0; }
.read-fields > div, .money-lines > div { display: flex; justify-content: space-between; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--stroke); }
.read-fields > div:last-child, .money-lines > div:last-child { border-bottom: 0; }
.read-fields dt, .money-lines dt { color: var(--subtle); }
.read-fields dd, .money-lines dd { margin: 0; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.addition { padding: 10px; background: #f5f8ff; border-radius: 7px; }
.addition-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.addition p { margin-top: 4px; line-height: 1.4; }

dialog {
  width: min(560px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 0; margin: auto; overflow: auto;
  border: 1px solid var(--stroke); border-radius: 15px; box-shadow: 0 24px 70px #0e28523b; color: var(--ink); background: white;
}
dialog::backdrop { background: #10244170; }
.dialog-heading { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; padding: 17px 18px 15px; border-bottom: 1px solid var(--stroke); }
.dialog-heading h2 { font-size: 21px; letter-spacing: -.027em; }
.dialog-heading p { margin-top: 4px; font-size: 12px; color: var(--subtle); }
.dialog-body { padding: 15px 18px; }
.dialog-subtitle { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 10px; }
.dialog-footer { padding: 10px 18px 13px; border-top: 1px solid var(--stroke); background: #f8faff; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 11px; }
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12px; font-weight: 650; }
.dialog-body .field + .field, .dialog-body .field + .form-grid, .dialog-body .form-grid + .field { margin-top: 10px; }
.field input:not([type=radio]), .field select, .field textarea {
  width: 100%; min-height: 37px; min-width: 0; border: 1px solid var(--stroke-strong); border-radius: 7px;
  background: white; padding: 7px 9px; font-weight: 450; line-height: 1.35;
}
.field select:disabled { background: #f5f7fa; color: var(--subtle); opacity: 1; }
.field textarea { resize: vertical; }
.checkbox { display: flex; gap: 6px; align-items: center; margin-top: 10px; }
.form-actions { display: flex; justify-content: flex-end; align-items: center; gap: 7px; margin-top: 10px; }
.dialog-footer .form-actions { margin-top: 0; }
.form-actions.wrap { flex-wrap: wrap; justify-content: flex-start; }
.form-error { color: var(--rose-text); font-size: 12px; font-weight: 650; margin: 0 0 8px; padding: 8px; border-radius: 6px; background: var(--rose-bg); }
.diary-form .form-error { margin-top: 10px; }
.booking-slots { display: flex; flex-wrap: wrap; gap: 5px; max-height: 116px; overflow: auto; padding: 3px; }
.time-option { position: relative; }
.time-option input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.time-option span { display: grid; place-items: center; min-height: 31px; min-width: 51px; border: 1px solid var(--stroke-strong); border-radius: 6px; background: #f8faff; }
.time-option input:checked + span { background: var(--action); border-color: var(--action); color: white; }
.time-option input:focus-visible + span { outline: 2px solid var(--action); outline-offset: 2px; }
.candidate, .visit-summary { display: flex; justify-content: space-between; align-items: center; gap: 9px; padding: 9px 0; border-bottom: 1px solid var(--stroke); }
.candidate .button { white-space: nowrap; }
.find-result { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 38px; border-radius: 6px; padding: 6px; }
#find-results { margin-top: 10px; }
.find-result:hover { background: var(--blue-bg); }
.toast { position: fixed; right: 18px; bottom: 18px; z-index: 30; padding: 11px 14px; border-radius: 9px; background: #183153; color: white; font-size: 13px; box-shadow: 0 12px 36px #0e28522e; max-width: calc(100% - 36px); opacity: 0; pointer-events: none; }
.toast.on { opacity: 1; }
.operator-role select {
  width: 100%; min-height: 26px; margin-top: 2px; border: 0; border-radius: 4px; background: transparent;
  color: var(--subtle); font-size: 11px;
}
.event.blocked {
  color: #41536a; border: 1px dashed #8fa0b9; background: repeating-linear-gradient(135deg, #f3f6fa, #f3f6fa 5px, #e7edf4 5px, #e7edf4 9px);
}
.section-tabs { display: flex; flex-wrap: wrap; gap: 4px 8px; margin-bottom: 15px; border-bottom: 1px solid var(--stroke-strong); }
.section-tabs a { padding: 9px 10px; border-bottom: 2px solid transparent; color: var(--subtle); font-weight: 650; }
.section-tabs a[aria-current="page"] { border-color: var(--action); color: var(--blue-text); }
.section-tabs a:hover { color: var(--action); }
.conversation-grid { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); align-items: start; gap: 14px; }
.conversation-grid .filter { display: block; margin-bottom: 8px; }
.attention-item[aria-pressed="true"] { background: var(--blue-bg); color: var(--blue-text); }
.next-visit, .call-notice {
  display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; border: 1px solid var(--stroke);
  border-radius: 8px; background: #f8faff; padding: 8px 11px; font-size: 12px;
}
.next-visit { margin-bottom: 12px; }
.next-visit strong { overflow-wrap: anywhere; }
.call-notice { margin: 7px 12px 0; background: var(--blue-bg); border-color: #c5d8fd; color: var(--blue-text); }
.call-notice > span { display: inline-flex; align-items: center; gap: 6px; }
.call-notice .button { min-height: 30px; }
.diary-fields { margin-top: 12px; }
.care-row {
  display: grid; grid-template-columns: minmax(155px, 1.2fr) minmax(85px, .7fr) minmax(0, 1.1fr);
  align-items: center; gap: 8px 14px; padding: 9px 0; border-bottom: 1px solid var(--stroke);
}
.care-row:last-child { border-bottom: 0; }
.care-row p { font-size: 12px; }
.care-row > .button { justify-self: start; }
.image-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 11px; }
.image-gallery.compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.image-gallery figure { min-width: 0; margin: 0; }
.image-gallery button { display: block; width: 100%; padding: 0; border: 1px solid var(--stroke); border-radius: 7px; background: #eff3f8; }
.image-gallery img { display: block; width: 100%; height: 175px; object-fit: contain; }
.image-gallery figcaption { margin-top: 5px; overflow-wrap: anywhere; font-size: 12px; color: var(--subtle); }
.image-preview { display: block; max-width: 100%; max-height: 65dvh; margin: auto; }
.money-lines dd { min-width: 0; }

@media (max-height: 790px) {
  .sidebar-workspace { margin-bottom: 17px; }
  .nav-link { min-height: 36px; }
  .nav-label { margin-bottom: 5px; }
  .second-label { margin-top: 16px; }
  .sidebar-bottom { padding-top: 15px; }
}

@media (max-width: 1220px) {
  :root { --sidebar: 195px; }
  .topbar { padding-inline: 20px; }
  main { padding-inline: 20px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
  .overview-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
}
@media (max-width: 860px) {
  :root { --header: 58px; }
  .sidebar { display: none; padding-top: 0; top: var(--header); width: min(232px, 85vw); box-shadow: 10px 0 32px #142c5424; }
  .open-menu .sidebar { display: flex; }
  .sidebar .brand { min-height: 57px; }
  .sidebar-workspace { margin-top: 4px; }
  .workspace { margin-left: 0; }
  .topbar-leading > [data-action="menu"] { display: grid; }
  .topbar-actions { margin-left: auto; }
  main { padding-top: 22px; }
}
@media (max-width: 630px) {
  .topbar { padding-inline: 10px; gap: 7px; }
  .topbar-leading, .topbar-actions { gap: 6px; }
  .search-trigger { min-width: 0; width: 35px; justify-content: center; padding: 0; }
  .search-trigger span, .search-trigger kbd, .branch-control > svg:first-child { display: none; }
  .branch-control { padding-left: 7px; padding-right: 1px; }
  .branch-control select { max-width: 129px; }
  .topbar .button { white-space: nowrap; }
  .topbar .button svg { width: 15px; }
  .topbar [data-top-call] { display: none; }
  main { padding: 19px 11px 25px; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 9px; margin-bottom: 13px; }
  .page-actions, .date-controls { justify-content: flex-start; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 12px; }
  .metric { padding: 9px; min-height: 93px; }
  .metric strong { font-size: 23px; }
  .metric-head { font-size: 11px; }
  .metric-icon { width: 24px; height: 24px; }
  .metric-icon svg { width: 14px; }
  .metric small { font-size: 10px; }
  .overview-grid, .overview-rail, .cash-grid, .chart-layout, .conversation-grid { grid-template-columns: minmax(0, 1fr); gap: 11px; }
  .panel-heading { min-height: 54px; padding: 10px 11px; }
  .panel-heading h2 { font-size: 15px; }
  .desktop-schedule, .view-switch { display: none; }
  .list-schedule { display: block; }
  th, td { padding: 8px 9px; }
  .wide-table table { min-width: 420px; }
  .inline-search input { width: min(31vw, 148px); }
  .patient-header > .avatar { width: 42px; height: 42px; font-size: 15px; }
  .patient-tabs > a { font-size: 12px; padding: 8px 7px; }
  .tooth-row { grid-template-columns: repeat(8, minmax(25px, 1fr)); min-width: 0; }
  .padded { padding: 11px; }
  .report-row { grid-template-columns: 132px minmax(0, 1fr) auto; }
  .dialog-heading, .dialog-body, .dialog-footer { padding-inline: 12px; }
  .message-row { gap: 6px; }
  .message-row .button { padding: 0 6px; }
  .care-row { grid-template-columns: minmax(0, 1fr) auto; }
  .care-row > :last-child { grid-column: 1 / -1; justify-self: start; }
  .section-tabs a { font-size: 12px; padding: 7px 5px; }
  .panel-heading { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .topbar .button svg { display: none; }
  .topbar .button { padding: 0 7px; }
  .branch-control select { max-width: 112px; font-size: 11px; }
  .form-grid { grid-template-columns: 1fr; }
}
