:root {
  font: 12px/1.35 "Segoe UI", Tahoma, Arial, sans-serif;
  color: #292b2e;
  background: #fff;
  --ink: #292b2e;
  --muted: #62666a;
  --line: #c9c9cc;
  --light-line: #dedee1;
  --blue: #006fb1;
  --link: #00669d;
  --selected: #c9e0f0;
  --purple: #513384;
  --lavender: #eae6f1;
  --header: 32px;
  --context: 48px;
  --rail: 122px;
  --sidebar: 228px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button, select, summary { cursor: pointer; }
button { color: var(--ink); }
button:disabled { color: #929292; cursor: default; }
:where(button, a, summary, input, select, textarea):focus-visible { outline: 2px solid #0b80be; outline-offset: 1px; }
a { color: var(--link); }

.app-header { height: var(--header); display: flex; align-items: center; gap: 12px; padding: 0 10px; color: white; background: var(--purple); }
.nav-toggle { display: grid; place-items: center; width: 18px; padding: 1px; border: 0; color: white; background: transparent; }
.nav-toggle span { display: block; width: 13px; height: 9px; border-block: 1px solid; background: linear-gradient(currentColor, currentColor) center / 100% 1px no-repeat; }
.nav-toggle:focus-visible { outline-color: white; }
.brand { display: flex; align-items: center; gap: 2px; font-size: 16px; line-height: 1; letter-spacing: -.48px; white-space: nowrap; }
.athena-mark { position: relative; width: 15px; height: 16px; display: inline-block; color: #adc348; }
.athena-mark::after { content: ""; position: absolute; width: 1.5px; height: 12px; left: 7px; bottom: 0; transform: rotate(-10deg); background: currentColor; }
.athena-mark i { display: block; position: absolute; bottom: 3px; width: 5px; height: 10px; background: currentColor; border-radius: 90% 15% 85% 20%; transform-origin: bottom center; }
.athena-mark i:nth-child(1) { left: 3px; transform: rotate(-44deg); }
.athena-mark i:nth-child(2) { left: 7px; transform: rotate(30deg) scale(.85); }
.athena-mark i:nth-child(3) { left: 6px; bottom: 7px; transform: rotate(-10deg) scale(.62); }
.app-title { margin-left: 8px; font-weight: 600; }
.environment { border-left: 1px solid #fff9; padding-left: 7px; margin-left: -5px; font-size: 10px; }
.header-right { margin-left: auto; font-size: 11px; white-space: nowrap; }

.app-layout { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: calc(100vh - var(--header)); min-width: 0; }
.app-layout.rail-collapsed { grid-template-columns: minmax(0, 1fr); }
.rail-collapsed .navigation { display: none; }
.navigation { min-width: 0; display: flex; flex-direction: column; background: #ededed; border-right: 1px solid #d6d6d6; }
.rail-label { display: flex; align-items: center; gap: 4px; justify-content: space-between; margin: 11px 4px 9px; padding: 3px 5px; height: 24px; background: white; border: 1px solid #d6d6d6; border-radius: 2px; font-size: 11px; white-space: nowrap; }
.rail-label span { color: #2379a7; }
.navigation nav, .navigation-tools { display: grid; }
.navigation button { width: 100%; padding: 5px; border: 0; border-bottom: 1px solid #d4d4d4; color: #25272a; background: transparent; text-align: left; line-height: 1.1; min-height: 24px; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.navigation button:hover:not(:disabled) { background: #dceaf3; }
.navigation button[aria-current=page] { background: #c6dbec; }
.navigation button:disabled { color: #505056; }
.navigation button:focus-visible { outline-offset: -2px; }
.navigation-tools { margin-top: auto; border-top: 1px solid #d6d6d6; }
.navigation-tools button { border-bottom-color: #d8d6dd; color: #533880; }
.app-content { display: flex; flex-direction: column; min-width: 0; }
.context-strip { display: flex; align-items: center; min-height: var(--context); padding: 3px 10px; background: var(--lavender); border-bottom: 1px solid #dfdce4; }
.patient-banner { display: flex; align-items: center; gap: 10px; }
.patient-identity { display: grid; line-height: 1.12; }
.patient-identity strong { color: #36343c; font-size: 22px; font-weight: 400; letter-spacing: -.3px; }
.patient-identity span { color: #716979; font-size: 10px; margin-top: 2px; }
.patient-avatar { position: relative; display: block; width: 38px; height: 38px; flex: 0 0 auto; background: #987eaa; border-radius: 50%; }
.patient-avatar::before, .patient-avatar::after { content: ""; position: absolute; background: #fcf9ff; }
.patient-avatar::before { width: 10px; height: 10px; left: 14px; top: 7px; border-radius: 50%; }
.patient-avatar::after { width: 21px; height: 11px; left: 8.5px; bottom: 7px; border-radius: 55% 55% 45% 45%; }
.patient-facts { display: grid; color: #35313b; font-size: 10px; line-height: 1.3; }
.patient-facts b { font-weight: 600; margin-right: 3px; }
#workspace { display: flex; flex: 1; min-width: 0; }

.window-pane { width: 100%; background: white; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) var(--sidebar); }
.workbench { display: flex; flex-direction: column; gap: 6px; min-width: 0; min-height: max(420px, calc(100vh - var(--header) - var(--context))); padding: 6px 9px 7px; }
.workbench-head { display: flex; gap: 8px; align-items: center; justify-content: space-between; min-height: 22px; }
.titlebar { margin: 0; color: #35363a; font-size: 14px; line-height: 1.25; font-weight: 650; }
.toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; }
.toolbar-search { padding: 1px 0; }
.toolbar-search label { color: #52565b; font-size: 11px; }
.toolbar-search input { width: clamp(98px, 13vw, 170px); }
.toolbar-search select { min-width: 92px; max-width: 160px; }
.toolbar-spacer { flex: 1; }
.refresh-stamp { color: var(--muted); font-size: 10px; white-space: nowrap; }
.refresh-tools { display: flex; align-items: center; gap: 5px; }
.workbench-actions { margin-top: auto; padding-top: 1px; }
.queue-actions { position: relative; }
.queue-actions summary { display: list-item; list-style: none; text-align: center; }
.queue-actions summary::-webkit-details-marker { display: none; }
.action-list { position: absolute; bottom: calc(100% + 3px); z-index: 1; left: 0; padding: 4px; display: grid; gap: 3px; width: max-content; background: white; border: 1px solid var(--line); box-shadow: 0 2px 6px #0002; }
.form-label { color: #484b4e; }

input:not([type=checkbox]):not([type=radio]), textarea, select { min-height: 23px; padding: 2px 5px; border: 1px solid #c8c9cc; border-radius: 2px; color: #28292d; background: #fff; }
input[readonly] { background: #fff; }
select:disabled { background: #e9e9eb; cursor: default; }
input[type=radio], input[type=checkbox] { accent-color: var(--blue); margin: 0; vertical-align: middle; }
.button { min-width: 58px; min-height: 21px; padding: 2px 8px; border: 1px solid #87b4ce; border-radius: 2px; background: white; color: #00689e; font-size: 11px; font-weight: 500; line-height: 1.35; white-space: nowrap; }
.button:hover:not(:disabled) { border-color: #367fa6; background: #eaf5fc; }
.button:disabled { background: #f8f8f8; border-color: #d6d6d6; }
.button.primary { background: var(--blue); border-color: var(--blue); color: white; }
.button.primary:hover:not(:disabled) { background: #035990; }
.button.primary:disabled { background: #dbe6ee; border-color: #c6d6e1; color: #5c7281; }
.link-button { border: 0; padding: 0; text-align: left; background: transparent; color: var(--link); font-weight: 500; }
.link-button:hover:not(:disabled) { text-decoration: underline; }
.tabs { display: flex; align-items: center; gap: 4px; border-bottom: 1px solid #e4e4e4; }
.tab-button { min-height: 24px; padding: 3px 5px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: #646468; font-size: 11px; white-space: nowrap; }
.tab-button:hover { color: var(--link); }
.tab-button[aria-selected=true], .active-form-tab { border-bottom-color: var(--blue); color: #222; font-weight: 700; }
.task-status { color: #3d3e41; font-size: 11px; }

.grid-scroll { overflow: auto; border: 1px solid #a5b2ba; border-radius: 1px; background: white; }
.task-grid-frame { display: flex; flex: 1; min-height: 250px; min-width: 0; margin: 2px; border: 1px solid #a7b8c1; outline: 1px solid #498caf; outline-offset: 1px; }
.task-grid-frame > .grid-scroll { flex: 1; min-width: 0; border: 0; }
.task-grid-rail { flex: 0 0 16px; background: #f1f3f4; border-left: 1px solid #c0cbd0; }
.grid-filter-button { display: grid; place-items: center; gap: 1px; width: 100%; padding: 0 0 3px; border: 0; border-bottom: 1px solid #c3cdd2; background: #f9fbfc; color: #505c62; line-height: 10px; }
.grid-filter-button i { display: block; width: 8px; height: 7px; background: currentColor; clip-path: polygon(0 0, 100% 0, 62% 50%, 62% 100%, 39% 82%, 39% 50%); }
.grid-filter-button[aria-expanded=true] { background: #c9e0f0; }
.task-filters { flex: 0 0 153px; padding-bottom: 2px; border-left: 1px solid #b9c6cc; background: #e9eff0; font-size: 11px; }
.task-filters details { border-bottom: 1px solid #c3ced2; }
.task-filters summary { padding: 3px 4px; color: #48565d; }
.task-filters label { display: block; padding: 2px 4px 0; background: #f8f9fa; }
.task-filters input { width: calc(100% - 8px); margin: 2px 4px 5px; }
.filter-footer { display: flex; justify-content: end; gap: 3px; padding: 5px 4px; }
.filter-footer .button { min-width: 0; }
table { width: 100%; border-collapse: collapse; font: 11px/1.3 "Segoe UI", Tahoma, Arial, sans-serif; font-variant-numeric: tabular-nums; }
th, td { padding: 2px 5px; border-bottom: 1px solid #d8dde0; border-right: 1px solid #e1e2e3; text-align: left; vertical-align: top; }
th { color: #323337; background: #f3f5f6; font-size: 10px; font-weight: 700; white-space: nowrap; }
th:last-child, td:last-child { border-right: 0; }
tbody tr:nth-child(even) { background: #f5f7f8; }
tbody tr:hover { background: #e6f3fc; }
tbody tr.row-selected { background: var(--selected); }
.select-cell { width: 20px; text-align: center; }
td.money, th.money { text-align: right; white-space: nowrap; }
td.empty { color: var(--muted); padding: 8px; }
.queue table { min-width: 690px; }
.queue td { white-space: nowrap; }
.queue table[aria-label="Task list"] { min-width: 758px; }
.queue input[type=radio] { appearance: none; width: 12px; height: 12px; border: 1px solid #b9c9d1; border-radius: 2px; background: #fff; }
.queue input[type=radio]:checked { background: #0a76ad; border-color: #0a76ad; }
.queue input[type=radio]:checked::after { content: "✓"; display: block; color: white; font: 10px/10px Arial, sans-serif; }

.invoice-main { min-width: 0; }
.invoice-main > .grid-scroll { min-height: 139px; }
.invoice-lines { min-width: 610px; }
.invoice-main > .tabs { margin-bottom: 5px; }
.invoice-detail-heading { margin: 0; }
.invoice-lines .charge-row { background: #e6edf2; }
.invoice-lines .charge-row:first-child { background: #d0e3f1; }
.invoice-lines .transaction-row { background: #f4f5f6; }
.transaction-fields { display: grid; grid-template-columns: 80px 84px 1fr; margin: 0 0 0 37px; padding: 2px 0 3px; font-size: 10px; }
.transaction-fields dt { color: #545a61; }
.transaction-fields dd { margin: 0; }
.line-toggle { display: block; width: 14px; height: 14px; margin: 0 auto; padding: 0; color: #2b6383; border: 1px solid #a7b8c3; border-radius: 2px; background: #fff; font: 12px/11px Arial, sans-serif; }
.invoice-lines .denied { color: #5c3731; }
.invoice-meta { display: flex; flex-wrap: wrap; gap: 5px 14px; align-items: center; padding: 6px 0; color: var(--muted); font-size: 11px; }
.invoice-meta output { font-weight: 650; color: var(--ink); }
.fields { display: grid; grid-template-columns: 115px minmax(0, 1fr) 115px minmax(0, 1fr); gap: 4px 8px; align-items: baseline; margin: 0; padding: 6px 5px; }
.fields dt { color: #64676b; font-size: 11px; }
.fields dd { margin: 0; overflow-wrap: anywhere; }
.customer-fields { margin-bottom: 5px; border-top: 1px solid #dedde1; border-bottom: 1px solid #dedde1; }
.section-bar { margin: 0 0 4px; padding: 3px 0; font-size: 11px; font-weight: 700; color: #333; }

.invoice-side { min-width: 0; border-left: 1px solid #dedee2; background: #fff; }
.invoice-side .tabs { padding: 1px 8px 0; box-shadow: 0 2px 3px #0001; }
.side-panel { padding: 8px 10px; font-size: 11px; }
.side-box { margin-bottom: 16px; }
.side-heading { margin: 0 0 5px; padding: 3px 0; color: #303135; font-size: 11px; font-weight: 650; }
.side-box .link-button { display: block; padding: 0 0 2px; color: var(--link); font-size: 11px; font-weight: 650; }
.side-box ul { margin: 0; padding-left: 0; list-style: none; }
.outcome-group { margin: 9px 0 1px; color: #ad231f; font-size: 10px; font-weight: 700; }
.muted { color: var(--muted); font-size: 11px; }
.summary { margin: 5px 0; font-size: 11px; }
.summary dt { font-weight: 650; color: #575a5f; }
.summary dd { margin: 0 0 6px; }
.selected-outcome { margin: 4px 0; padding: 3px 5px; border-left: 2px solid var(--blue); background: var(--selected); }

.notice { position: fixed; right: 14px; bottom: 14px; max-width: calc(100vw - 28px); padding: 6px 9px; border: 1px solid #7bafce; border-radius: 2px; background: #f5fafc; color: #06486c; box-shadow: 0 3px 12px #0002; z-index: 4; }
.notice:empty { display: none; }

dialog { color: var(--ink); background: white; margin: auto; padding: 0; width: min(var(--window-width, 760px), calc(100vw - 22px)); max-height: calc(100vh - 22px); overflow: auto; border: 1px solid #b4b4b4; border-radius: 2px; box-shadow: 0 4px 18px #0006; }
dialog::backdrop { background: #0009; }
#popup::backdrop { background: #0008; }
.dialog-title { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; min-height: 35px; padding: 4px 10px; border-bottom: 1px solid #e3e3e3; background: #fff; }
.dialog-title h2 { margin: 0; font: inherit; }
.close { padding: 0 5px; border: 1px solid transparent; border-radius: 2px; background: transparent; font-size: 18px; line-height: 19px; }
.close:hover { background: #f0f0f1; border-color: #d3d3d3; }
.dialog-body { padding: 10px 11px; }
.dialog-body > :first-child { margin-top: 0; }
.dialog-body > :last-child { margin-bottom: 0; }
.dialog-footer { display: flex; justify-content: flex-end; align-items: center; gap: 4px; padding: 6px 11px 9px; border-top: 1px solid #eee; }
.dialog-message { margin: 0; }
dialog .tabs { padding: 0 9px; box-shadow: 0 2px 3px #0001; }
form { margin: 0; }
.field-row { display: grid; grid-template-columns: 118px minmax(0, 1fr); align-items: center; gap: 6px; margin: 5px 0; }
.field-row > label { color: #60636a; font-size: 11px; }
.field-row :is(select, input:not([type=radio]):not([type=checkbox])) { width: min(100%, 255px); }
.lookup { display: flex; align-items: center; max-width: 300px; }
.lookup input:not([type=hidden]) { border-right: 0 !important; border-radius: 2px 0 0 2px !important; }
.lookup input:focus { z-index: 1; }
.lookup-button { display: grid; place-items: center; min-width: 23px; min-height: 23px; flex-shrink: 0; margin-right: 4px; padding-inline: 4px; border-color: #c8c9cc; border-radius: 0 2px 2px 0; }
.lookup-filter { display: flex; align-items: center; gap: 7px; margin-bottom: 7px; color: #4b545a; }
.lookup-filter input { flex: 1; max-width: 250px; }
.lookup-results > .grid-scroll { border: 1px solid #79a7c3; min-height: 85px; }
.line-results > .grid-scroll { min-height: min(331px, 56vh); }
.picker-row:has(input:checked) { background: var(--selected); }
.search-icon { display: block; position: relative; width: 8px; height: 8px; border: 1px solid currentColor; border-radius: 50%; transform: translate(-1px, -1px); color: #337ea7; }
.search-icon::after { content: ""; position: absolute; right: -3px; bottom: -2px; width: 4px; height: 1px; transform: rotate(45deg); background: currentColor; }
.note-label { display: block; margin: 10px 0 4px; font-weight: 650; font-size: 11px; }
textarea { display: block; width: 100%; min-height: 88px; resize: vertical; }
.note-editor { min-height: 185px; line-height: 1.45; }
.compact { padding: 0 0 6px; }
.task-form-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; max-width: 900px; }
.task-field-column { grid-template-columns: 118px minmax(0, 1fr); grid-auto-rows: minmax(23px, auto); gap: 0 6px; align-content: start; padding: 0; }
.task-form-fields .field-row { margin-block: 0; }
.note-context { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); column-gap: 7px; max-width: 710px; margin-top: 22px; }
.note-context .field-row { grid-template-columns: 77px minmax(0, 1fr); margin: 2px 0; }
.note-context .field-row input { width: 100%; }
.request-header { max-width: 910px; grid-template-columns: 70px 1fr 64px 1fr 64px 1fr; min-height: 96px; }
.request-fields { display: grid; grid-template-columns: minmax(0, 2.55fr) minmax(0, 1fr); gap: 0 14px; max-width: 930px; }
.request-fields > .field-row { align-self: start; grid-template-columns: 42px minmax(0, 1fr); }
#wo-fsc { max-width: 67px; }
#wo-type { max-width: 99px; }
#pay-code { max-width: 84px; }
#wo-comments { max-width: min(82%, 700px); min-height: 82px; }
.rejection-fields { margin-top: 56px; padding-left: 0; max-width: 565px; row-gap: 9px; }
.line-picker-toolbar { display: flex; align-items: center; gap: 10px; margin: 0 0 22px; font-size: 11px; }
#write-off-lines { min-height: 110px; }
#write-off-lines table { min-width: 615px; }
#write-off-lines th:first-child { width: 146px; }
#write-off-lines .empty-amount { color: #717171; background: #eee; }
#write-off-lines input { min-height: 20px; text-align: right; }
#write-off-lines #line-invoice { width: 108px; text-align: left; }
#write-off-lines .lookup-button { min-height: 20px; }
.form-error { margin: 6px 0 0; color: #9e2824; }
.form-error:empty { display: none; }
.attention-dialog { border-left: 6px solid #f1a62c; }
.attention-dialog .dialog-title { justify-content: start; gap: 12px; border-bottom: 0; padding: 13px 15px 6px; font-size: 18px; }
.attention-dialog .dialog-title::before { content: "!"; display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: #e89b21; color: white; font: bold 13px/1 Arial, sans-serif; }
.attention-dialog .dialog-title .close { display: none; }
.attention-dialog .attention { padding: 16px 16px 24px 54px; }
.attention-dialog .dialog-footer { justify-content: center; border: 0; padding-bottom: 17px; }
.attention-dialog .dialog-footer .button { min-width: 111px; }
.details-block { margin: 7px 0; padding: 5px 8px; border: 1px solid var(--light-line); }
.details-block pre { margin: 0; font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; }
.prompts { display: grid; gap: 8px; }
.prompt-card { border: 1px solid #c9c9cc; padding: 8px; }
.prompt-card h3 { margin: 0 0 4px; font-size: 13px; }
.prompt-card textarea { margin: 5px 0; min-height: 129px; font-size: 11px; }
.prompt-actions { display: flex; flex-wrap: wrap; gap: 5px; }

@media (min-width: 901px) {
  dialog.docked { position: fixed; inset: calc(var(--header) + var(--context) + 1px) calc(var(--sidebar) + 1px) 0 var(--rail); width: auto; height: auto; max-width: none; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  body:has(.rail-collapsed) dialog.docked { left: 0; }
  dialog.docked::backdrop { background: transparent; }
  dialog.docked .dialog-title { min-height: 28px; padding: 4px 8px; border: 0; }
  dialog.docked .dialog-footer { justify-content: center; padding-top: 16px; border-top: 0; }
  dialog.docked .dialog-title .close { display: none; }
  dialog.docked .note-editor { width: 73%; max-width: 672px; }
  dialog.docked #note-form .dialog-footer { justify-content: flex-start; padding-left: min(74%, 695px); padding-top: 5px; }
  dialog.docked #write-off-form .dialog-footer { justify-content: flex-end; padding-top: 11px; }
}
@media (max-width: 900px) {
  :root { --rail: 105px; --sidebar: 175px; }
  .fields { grid-template-columns: 96px minmax(0, 1fr) 92px minmax(0, 1fr); }
  .toolbar-search select { min-width: 70px; max-width: 115px; }
}
@media (max-width: 720px) {
  :root { --context: 42px; }
  .app-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .rail-label, .navigation nav button:disabled { display: none; }
  .navigation { display: flex; flex-direction: row; justify-content: space-between; flex-wrap: wrap; border: 0; }
  .navigation nav, .navigation-tools { display: flex; flex-wrap: wrap; }
  .navigation-tools { margin: 0; border: 0; }
  .navigation button { width: auto; padding-inline: 6px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr); }
  .workbench { min-height: auto; padding: 6px; }
  .task-grid-frame { min-height: 150px; }
  .task-filters { flex-basis: 126px; }
  .invoice-side { border-left: 0; border-top: 1px solid #dedee2; }
  .fields, .request-header { grid-template-columns: max-content minmax(0, 1fr); }
  .request-fields { grid-template-columns: minmax(0, 1fr); }
  .task-form-fields { grid-template-columns: minmax(0, 1fr); }
  .task-field-column { grid-template-columns: 118px minmax(0, 1fr); }
  #wo-comments { max-width: 100%; }
  .patient-identity strong { font-size: 17px; }
  .patient-avatar { display: none; }
}
@media (max-width: 420px) {
  .operator { display: none; }
  .field-row { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .lookup { flex-wrap: wrap; }
}
