.accounting-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 28px; padding: 10px; border: 1px solid #dce4dc; background: #f8faf6; }
.accounting-tabs a { color: #31564a; border-radius: 4px; padding: 10px 12px; font-size: 13px; font-weight: 700; text-decoration: none; }
.accounting-tabs a[aria-current="page"] { color: #fff; background: #14342e; }
.data-table-shell { margin: 18px 0 34px; border: 1px solid #dce4dc; background: #fff; }
.data-table-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 12px; border-bottom: 1px solid #dce4dc; background: #f8faf6; }
.data-table-toolbar .data-table-controls { flex: 1; border-bottom: 0; }
.data-table-toolbar > .button { margin: 14px; white-space: nowrap; }
.data-table-controls, .bulk-actions { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; padding: 14px; border-bottom: 1px solid #dce4dc; background: #f8faf6; }
.data-table-controls label { display: grid; gap: 5px; color: #52665d; font-size: 12px; font-weight: 700; }
.data-table-controls input, .data-table-controls select { min-height: 36px; border: 1px solid #ccd8cc; border-radius: 3px; padding: 7px 9px; color: #14342e; background: #fff; font: inherit; }
.data-table-controls > .button { white-space: nowrap; }
.data-table-search input { min-width: min(300px, 70vw); }
.data-table-count { margin-left: auto; color: #64766d; font-size: 12px; }
.data-table th button { appearance: none; border: 0; padding: 0; color: inherit; background: transparent; cursor: pointer; font: inherit; font-weight: inherit; text-align: inherit; }
.data-table th button::after { content: ' ↕'; color: #8b9c93; font-size: 11px; }
.bulk-form { display: none; }
.bulk-actions { border-top: 0; }
.bulk-actions > label { color: #52665d; font-size: 13px; font-weight: 700; }
.button-danger { border-color: #a93f3f; color: #fff; background: #a93f3f; }
.button-danger:hover { background: #862f2f; }
.data-table-pagination { display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding: 13px; border-top: 1px solid #dce4dc; }
.data-table-pagination button { min-width: 32px; min-height: 31px; border: 1px solid #ccd8cc; border-radius: 3px; background: #fff; color: #31564a; cursor: pointer; font: inherit; font-size: 12px; }
.data-table-pagination button[aria-current="page"] { color: #fff; border-color: #14342e; background: #14342e; }
.data-table-pagination button:disabled { cursor: not-allowed; opacity: .45; }
.action-icons { white-space: nowrap; }
.inline-action-form { display: inline; }
.icon-action { display: inline-grid; width: 32px; height: 32px; place-items: center; margin: 1px; border: 1px solid #b8c7bd; border-radius: 3px; color: #245044; background: #fff; text-decoration: none; cursor: pointer; }
.icon-action:hover { color: #fff; border-color: #14342e; background: #14342e; }
.icon-action.danger:hover { border-color: #a93f3f; background: #a93f3f; }
.icon-action:disabled { cursor: not-allowed; opacity: .42; pointer-events: none; }
.status-muted { display: inline-block; padding: 4px 7px; border-radius: 999px; color: #5f6f67; background: #e8ece8; font-size: 12px; font-weight: 700; }
.accounting-dialog { width: min(620px, calc(100vw - 36px)); border: 0; padding: 0; box-shadow: 0 18px 70px rgba(14, 42, 35, .28); }
.accounting-dialog::backdrop { background: rgba(12, 29, 24, .58); }
.accounting-dialog form { display: grid; gap: 14px; padding: 28px; background: #fffefa; }
.accounting-dialog h3 { margin: 0 0 4px; }
.accounting-dialog label { display: grid; gap: 7px; color: #31564a; font-size: 13px; font-weight: 700; }
.accounting-dialog input, .accounting-dialog select { width: 100%; box-sizing: border-box; border: 1px solid #ccd8cc; border-radius: 3px; padding: 11px; background: #fff; color: #14342e; font: inherit; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.patient-history-dialog > div { padding: 28px; background: #fffefa; }
.patient-history-list { display: grid; max-height: min(58vh, 560px); gap: 12px; overflow: auto; }
.patient-history-item { padding: 15px; border: 1px solid #dce4dc; background: #fff; }
.patient-history-item header { display: flex; justify-content: space-between; gap: 12px; color: #14342e; }
.patient-history-item header small { color: #60746a; text-align: right; }
.patient-history-item p { margin: 10px 0 0; line-height: 1.55; white-space: pre-wrap; }
.patient-history-item .clinical-note { margin-top: 14px; }
.completion-clinical-note { display: grid; gap: 14px; padding: 14px 0; border-top: 1px solid #dce4dc; border-bottom: 1px solid #dce4dc; }
.completion-clinical-note h4 { margin: 0; color: #14342e; }
.completion-clinical-note p { margin: 0; }
.work-dashboard:has([data-dialog-open="manual-queue-create"]) > .work-columns > div { min-width: 0; }
.queue-completion-dialog { white-space: normal; max-height: calc(100dvh - 36px); overflow-y: auto; }
.queue-completion-dialog form, .queue-completion-dialog label, .completion-clinical-note { min-width: 0; }
.queue-completion-dialog textarea { display: block; width: 100%; resize: vertical; box-sizing: border-box; border: 1px solid #ccd8cc; border-radius: 3px; padding: 11px; background: #fff; color: #14342e; font: inherit; }
.completion-clinical-note .consent { grid-template-columns: 18px minmax(0, 1fr); gap: 9px; align-items: start; font-weight: 500; }
.completion-clinical-note .consent input { width: 18px; height: 18px; padding: 0; margin: 3px 0 0; }
.patient-contact-fields { display: grid; gap: 14px; margin: 4px 0; }
.patient-contact-fields h4 { margin: 0; color: #14342e; }
.patient-contact-fields [hidden] { display: none !important; }
[data-stock-form] [hidden] { display: none !important; }
[data-stock-change-fields] { display: grid; gap: 14px; }
th[aria-sort="ascending"] [data-grid-sort]::after { content: " ↑"; }
th[aria-sort="descending"] [data-grid-sort]::after { content: " ↓"; }
.patient-address-cell { min-width: 200px; max-width: 300px; white-space: normal; overflow-wrap: anywhere; }
.patient-history-item .clinical-note h4 { margin: 0; padding: 14px 18px; color: #14342e; }
.therapist-avatar { display: grid; width: 42px; height: 42px; border: 1px solid #c7d5c8; border-radius: 50%; object-fit: cover; overflow: hidden; background: #eef3ee; }
.therapist-avatar-placeholder { place-items: center; color: #648071; font-size: 16px; }
.therapist-avatar-large { width: 82px; height: 82px; margin: 0 auto 4px; }

@media (max-width: 680px) {
  .accounting-tabs { margin-left: -4px; margin-right: -4px; }
  .accounting-tabs a { padding: 8px; font-size: 12px; }
  .data-table-controls, .bulk-actions { align-items: stretch; }
  .data-table-toolbar { display: block; }
  .data-table-toolbar > .button { width: calc(100% - 28px); }
  .data-table-controls label { flex: 1 1 130px; }
  .data-table-search { flex-basis: 100%; }
  .data-table-search input { min-width: 0; width: 100%; box-sizing: border-box; }
  .data-table-count { width: 100%; margin-left: 0; }
  .bulk-actions .button { flex: 1 1 135px; }
}

/* Keep booking check-in and deletion forms together in the action column. */
.work-table[data-booking-table] td:last-child{white-space:nowrap}
.work-table[data-booking-table] td:last-child>form:not([hidden]){display:inline-flex;align-items:center;vertical-align:middle;margin:0}
.work-table[data-booking-table] td:last-child>form:not([hidden])+form:not([hidden]){margin-inline-start:8px}
.work-table[data-booking-table] td:last-child>small{display:inline-block;vertical-align:middle;margin:0 8px 0 0}
.manual-patient-dialog{width:min(820px,calc(100vw - 28px));max-height:calc(100dvh - 28px);overflow:auto}.manual-patient-dialog fieldset[data-manual-patient-fields]{border:0;padding:0;margin:20px 0;min-width:0}.manual-patient-dialog fieldset>legend{font-weight:700;font-size:13px;padding:0;margin-bottom:15px}.manual-patient-dialog [hidden]{display:none!important}.manual-patient-dialog [data-manual-search-status]{font-size:12px;color:#718568;line-height:1.7;margin:8px 0}.manual-patient-dialog .manual-patient-selected{display:flex;align-items:center;gap:12px;justify-content:space-between;flex-wrap:wrap}.manual-patient-dialog .manual-patient-selected span{flex:1;min-width:160px;overflow-wrap:anywhere}.manual-patient-dialog .form-error{color:#a8423d;font-size:13px;line-height:1.7}.manual-patient-dialog .patient-contact-fields{min-width:0}.manual-patient-dialog input,.manual-patient-dialog select,.manual-patient-dialog textarea{max-width:100%}@media(max-width:600px){.manual-patient-dialog{padding:22px 18px}.manual-patient-dialog .form-row{grid-template-columns:1fr}}
