/* ChekHealth visual system. Keep command order, clinical status colours and compact tables familiar. */
:root {
    --brand: #087f80;
    --brand-hover: #066668;
    --brand-soft: #e8f5f2;
    --ink: #203644;
    --shell-border: #dce5e8;
    --shell-muted: #536976;
    --shell-surface: #f4f7f8;
    --row-selected: #e0f2f0;
    --panel-shadow: 0 2px 8px rgb(27 55 67 / 4%);
    --bs-primary: #087f80;
    --bs-primary-rgb: 8, 127, 128;
    --bs-link-color: #066e70;
    --bs-link-hover-color: #045557;
}

body {
    color: var(--ink);
    background: var(--shell-surface);
    font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: #066e70; }
a:hover { color: #045557; }
h1, h2, h3 { color: var(--ink); font-weight: 650; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { accent-color: var(--brand); }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid var(--brand);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    left: 1rem;
    top: -5rem;
    z-index: 10001;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
}
.skip-link:focus { top: 0.5rem; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    flex-shrink: 0;
    text-decoration: none;
    color: var(--ink);
}
.brand:hover { color: var(--ink); }
.brand-mark { display: block; }
.brand-wordmark { font-size: 22px; font-weight: 700; letter-spacing: -0.8px; }
.brand-wordmark > span { color: var(--brand); font-weight: 500; }

.app-shell { height: 100dvh; min-height: 0; }
.app-header { background: white; box-shadow: var(--panel-shadow); z-index: 2; }
.app-brand-row, .account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1.25rem;
    border-bottom: 1px solid var(--shell-border);
    background: white;
}
.app-brand-row .tenant-bar, .account-header .tenant-bar { border: 0; padding: 0; }
.tenant-bar { flex-wrap: wrap; font-size: 12px; }
.tenant-bar-name { color: var(--ink); }
.tenant-bar form { margin: 0; }
.app-header-top { padding: 0 0.7rem; }
.app-menu.e-menu-wrapper .e-menu > .e-menu-item { height: 34px; line-height: 34px; font-size: 13px; }
.app-menu.e-menu-wrapper .e-menu-item.e-focused { background: var(--brand-soft); }

.app-toolbar.e-toolbar {
    padding: 0.3rem 0.75rem;
    border-top: 1px solid #edf1f3;
    border-bottom: 1px solid var(--shell-border);
    background: white;
}
.app-toolbar.e-toolbar .e-toolbar-items { background: transparent; }
.app-toolbar.e-toolbar .e-tbar-btn { border-radius: 6px; }
.app-toolbar.e-toolbar .e-tbar-btn:hover { background: var(--brand-soft); }
.app-toolbar.e-toolbar .e-tbar-btn .e-tbar-btn-text { color: var(--ink); font-weight: 600; font-size: 13px; }
.app-toolbar.e-toolbar .e-toolbar-items .e-toolbar-item .e-tbar-btn:is(:hover, :focus, :active) .e-tbar-btn-text { color: var(--ink); }
.workspace-tabs { background: var(--shell-surface); padding: 0.3rem 1rem 0; }
.workspace-tabs .e-tab .e-tab-header { border-bottom: 0; }
.workspace-tabs .e-tab .e-tab-header .e-toolbar-item .e-tab-wrap { border-radius: 7px 7px 0 0; }
.workspace-tabs .e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-wrap { background: white; }
.workspace-tabs .e-tab .e-tab-header .e-toolbar-item.e-active .e-tab-text { color: var(--brand-hover); font-weight: 650; }
.workspace-tabs .e-tab .e-tab-header .e-indicator { background: var(--brand); }
.app-main { min-height: 0; padding: 0.9rem 1.1rem; }
.status-bar { flex-wrap: wrap; flex-shrink: 0; gap: 0.25rem 1.5rem; background: white; padding: 0.4rem 1.25rem; }
.page-header { flex-wrap: wrap; margin-bottom: 0.5rem; }
.page-header h1 { font-size: 1.5rem; letter-spacing: -0.4px; }

/* Theme the existing component library without replacing its interaction patterns. */
.e-control, .e-css { font-family: inherit; }
.e-btn, .e-css.e-btn, .btn { border-radius: 7px; text-transform: none; font-weight: 600; }
.e-btn.e-primary, .e-css.e-btn.e-primary, .btn-primary {
    color: white;
    background: var(--brand);
    border-color: var(--brand);
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-hover);
    --bs-btn-hover-border-color: var(--brand-hover);
    --bs-btn-active-bg: var(--brand-hover);
    --bs-btn-active-border-color: var(--brand-hover);
    --bs-btn-disabled-bg: var(--brand);
    --bs-btn-disabled-border-color: var(--brand);
}
.e-btn.e-primary:hover, .e-btn.e-primary:focus, .e-btn.e-primary:active,
.e-css.e-btn.e-primary:hover, .e-css.e-btn.e-primary:focus {
    color: white;
    background: var(--brand-hover);
    border-color: var(--brand-hover);
}
.e-input-group, .e-float-input, .form-control, .form-select { border-radius: 6px; }
.form-control:focus, .form-select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(8 127 128 / 14%); }
.e-input-group.e-input-focus:not(.e-success):not(.e-warning):not(.e-error) { border-color: var(--brand); }
.e-dialog { border: 1px solid var(--shell-border); border-radius: 12px; box-shadow: 0 16px 56px rgb(27 55 67 / 18%); }
.e-dialog .e-dlg-header-content { border-bottom: 1px solid var(--shell-border); border-radius: 12px 12px 0 0; }
.e-dialog .e-dlg-header { color: var(--ink); font-weight: 650; }
.e-dialog .e-footer-content { border-top: 1px solid var(--shell-border); background: var(--shell-surface); }
.e-grid { border-color: var(--shell-border); border-radius: 8px; overflow: hidden; box-shadow: var(--panel-shadow); }
.e-grid .e-gridheader, .e-grid .e-headercell { background: #f3f7f8; color: var(--shell-muted); border-color: var(--shell-border); }
.e-grid .e-headertext { font-weight: 650; }
.e-grid .e-rowcell { color: var(--ink); border-color: #edf1f3; }
.e-grid .e-row:hover .e-rowcell:not(.e-selectionbackground) { background: #f5faf9; }
.e-grid .e-rowcell.e-selectionbackground { background: var(--row-selected); color: var(--ink); }
.dense-grid.e-grid .e-rowcell, .dense-grid.e-grid .e-headercell { padding-top: 4px; padding-bottom: 4px; }

.patient-banner { border-radius: 9px; border-left-color: var(--brand); padding: 0.75rem 1rem; box-shadow: var(--panel-shadow); }
.patient-banner-flagged { border-left-color: var(--shell-muted); }
.patient-banner-allergies { border-radius: 6px; }
.patient-sections { background: white; border-radius: 9px; padding: 0.4rem; }
.patient-sections .e-treeview .e-list-item.e-active > .e-fullrow { background: var(--brand-soft); border-color: transparent; border-radius: 5px; }
.patient-sections .e-treeview .e-list-item.e-active > .e-text-content .e-list-text { color: var(--brand-hover); }
/* The record tree has no nested levels, so drop the space reserved for expand icons. */
.patient-sections .e-treeview > .e-ul { padding-left: 0; }
.patient-sections .e-treeview .e-list-item .e-text-content { padding-left: 6px; }
.patient-section-content { background: white; border: 1px solid var(--shell-border); border-radius: 9px; padding: 1rem; }
.details-groups section, .visit-preview, .inbox-detail, .section-placeholder, .rx-medicine, .rx-listing {
    border-radius: 8px;
    background: white;
}
.book-toolbar { gap: 0.6rem; margin-bottom: 0.75rem; }
.appointment-book.e-schedule { border-radius: 8px; overflow: hidden; border-color: var(--shell-border); }
.appointment-book .e-appointment { border-radius: 5px; }
kbd { color: var(--shell-muted); background: #f8fafb; border-radius: 4px; border-color: var(--shell-border); font-weight: 500; }

/* Home is a quiet launch point; every action uses the existing command registry. */
.home-workspace { max-width: 1120px; margin: 0 auto; padding: 0.75rem 0; }
.welcome-panel {
    padding: clamp(1.5rem, 3vw, 3rem);
    border: 1px solid #cce5e1;
    border-radius: 14px;
    background: linear-gradient(115deg, #fff 15%, #edf8f5 100%);
    margin-bottom: 2rem;
}
.eyebrow { display: block; color: var(--brand-hover); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.6px; margin-bottom: 0.75rem; }
.welcome-panel h1 { font-size: clamp(1.8rem, 3vw, 2.5rem); letter-spacing: -1px; line-height: 1.2; margin: 0 0 0.75rem; }
.welcome-panel p { color: var(--shell-muted); font-size: 15px; margin-bottom: 1.5rem; }
.home-actions { flex-wrap: wrap; gap: 0.75rem; }
.home-actions .e-btn { padding: 0.65rem 1rem; text-decoration: none; }
.home-actions .e-btn:not(.e-primary) { background: white; color: var(--ink); border-color: var(--shell-border); }
.home-actions .e-btn:not(.e-primary):hover { background: var(--brand-soft); border-color: #75b8b2; }
.home-actions kbd { margin-left: 0.75rem; font-size: 11px; }
.home-actions .e-primary kbd { background: #066668; border-color: #559d9d; color: white; }
.home-section-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.5rem; margin-bottom: 1rem; }
.home-section-heading h2 { font-size: 18px; margin: 0; }
.home-section-heading > span { color: var(--shell-muted); font-size: 12px; }
.home-essentials { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.essential-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    padding: 1.25rem;
    background: white;
    color: var(--ink);
    border: 1px solid var(--shell-border);
    border-radius: 10px;
    box-shadow: var(--panel-shadow);
    cursor: pointer;
}
.essential-card:hover:enabled { border-color: #75b8b2; background: #fbfefd; }
.essential-card:disabled { opacity: 0.6; cursor: default; }
.essential-icon { display: grid; place-items: center; flex: 0 0 42px; height: 42px; border-radius: 10px; background: var(--brand-soft); color: var(--brand-hover); font-size: 25px; }
.essential-copy { display: flex; flex-direction: column; gap: 0.25rem; }
.essential-copy strong { font-size: 14px; font-weight: 650; }
.essential-copy > span { font-size: 12px; color: var(--shell-muted); }
.essential-arrow { margin-left: auto; color: var(--brand); font-size: 20px; }
.home-shortcuts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.75rem; padding: 1.25rem 0; border-top: 1px solid var(--shell-border); }
.home-shortcuts strong { font-weight: 600; font-size: 13px; }
.home-shortcuts p { color: var(--shell-muted); font-size: 12px; margin: 0.5rem 0 0; }
.home-shortcuts p > span { margin: 0 0.5rem; }

.static-page { max-width: 1080px; margin: 2rem auto; padding: 2rem; background: white; border: 1px solid var(--shell-border); border-radius: 12px; box-shadow: var(--panel-shadow); }
.static-page > h1 { font-size: 1.75rem; letter-spacing: -0.5px; margin-bottom: 1.5rem; }
.static-page h2, .static-page h3 { font-size: 1.1rem; }
.static-page .welcome-panel { margin: 0; }
.admin-header { background: white; border-bottom: 2px solid #8063a3; }
.admin-header-top { padding: 0.8rem 1.25rem; border-bottom: 1px solid var(--shell-border); gap: 1rem; }
.admin-brand { display: flex; align-items: center; gap: 1rem; }
.admin-title { font-size: 11px; background: #f1ecf7; padding: 0.3rem 0.6rem; border-radius: 5px; }
.admin-main { padding: 1.25rem; }

/* ---- Component theme: one accent everywhere ----
   The Syncfusion theme is built on CSS variables, so overriding them recolours every control (buttons,
   checkboxes, radios, selection, the scheduler) consistently instead of styling each one. */
:root {
    --color-sf-primary: rgba(8, 127, 128, 1);
    --color-sf-primary-shadow: 8, 127, 128;
    --color-sf-primary-bg-color-hover: #066668;
    --color-sf-primary-bg-color-pressed: #055657;
    --color-sf-primary-border-color-hover: #066668;
    --color-sf-primary-border-color-pressed: #055657;
    --color-sf-primary-bg-color-disabled: rgba(8, 127, 128, .42);
    --color-sf-primary-light: #7cc4c0;
    --color-sf-primary-lighter: #dff1ef;
    --color-sf-primary-dark: #066668;
    --color-sf-primary-darker: #044a4b;
    --color-sf-content-bg-color-selected: #087f80;
}

/* Ordinary (non-primary) buttons: a quiet outline instead of solid grey, so disabled commands recede. Styled
   explicitly because the theme's secondary colour variable also drives flat-button text. */
.e-btn:not(.e-primary):not(.e-flat):not(.e-link):not(.e-success):not(.e-danger):not(.e-warning):not(.e-info):not(.e-tbar-btn) {
    background: #fff;
    border-color: #c3cfd5;
    color: var(--ink);
    box-shadow: none;
}
.e-btn:not(.e-primary):not(.e-flat):not(.e-link):not(.e-success):not(.e-danger):not(.e-warning):not(.e-info):not(.e-tbar-btn):not(:disabled):hover {
    background: #eef6f5;
    border-color: #8fb3b0;
}
.e-btn:not(.e-primary):not(.e-flat):not(.e-link):not(.e-success):not(.e-danger):not(.e-warning):not(.e-info):not(.e-tbar-btn):not(:disabled):active,
.e-btn:not(.e-primary):not(.e-flat):not(.e-link):not(.e-success):not(.e-danger):not(.e-warning):not(.e-info):not(.e-tbar-btn).e-active {
    background: #e0efed;
    border-color: #7aa6a2;
}
.e-btn:not(.e-primary):not(.e-flat):not(.e-link):not(.e-success):not(.e-danger):not(.e-warning):not(.e-info):not(.e-tbar-btn):disabled {
    background: #fff;
    border-color: #d6dee2;
    color: #9aa8af;
}
.e-btn.e-flat:disabled, .e-btn.e-flat.e-disabled { background: transparent; border-color: transparent; color: #9aa8af; }
/* Dialog footer buttons are flat buttons the theme paints as solid secondary; give them the same outline. */
.e-dialog .e-footer-content .e-btn.e-flat:not(.e-primary):not([disabled]):not(.e-success):not(.e-danger):not(.e-warning):not(.e-info) {
    background: #fff;
    border-color: #c3cfd5;
    color: var(--ink);
}
.e-dialog .e-footer-content .e-btn.e-flat:not(.e-primary):not([disabled]):not(.e-success):not(.e-danger):not(.e-warning):not(.e-info):hover {
    background: #eef6f5;
    border-color: #8fb3b0;
}
.e-btn.e-flat { color: var(--ink); }
.e-btn.e-flat:not(:disabled):hover { background: var(--brand-soft); color: var(--ink); }
.e-btn:disabled, .e-btn.e-disabled { box-shadow: none; }

/* ---- Header: brand, menu and practice on one row (the menu stays at the top, as in Bp) ---- */
.app-header-top {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0 1rem;
    border-bottom: 1px solid #edf1f3;
}
.app-header-top .brand { gap: 0.45rem; margin-right: 0.25rem; }
.app-header-top .brand-mark { width: 24px; height: 24px; }
.app-header-top .brand-wordmark { font-size: 17px; letter-spacing: -0.5px; }
.app-header-top .app-menu { flex: 1 1 auto; min-width: 0; }
.app-header-top .tenant-bar { margin-left: auto; border: 0; padding: 0; flex-wrap: nowrap; white-space: nowrap; }

/* ---- Main toolbar: icon plus the familiar label; the shortcut is in the tooltip ---- */
.app-toolbar.e-toolbar { padding: 0.2rem 0.75rem; }
.app-toolbar.e-toolbar .e-toolbar-item .e-tbar-btn { padding: 0.25rem 0.6rem; gap: 0.35rem; }
.app-toolbar.e-toolbar .e-tbar-btn .e-icons { color: var(--brand); font-size: 15px; }
.app-toolbar.e-toolbar .e-tbar-btn:disabled .e-icons { color: #a9b6bc; }

/* ---- Page content ---- */
.app-main > h1, .app-main .page-header h1, .app-main h1 { font-size: 1.3rem; letter-spacing: -0.3px; margin: 0 0 0.75rem; }
.patient-section-content > h2 { font-size: 1.15rem; margin: 0 0 0.75rem; }
.setup-hint { color: var(--shell-muted); }
.e-grid .e-emptyrow td { color: var(--shell-muted); }

.setup-form > .e-btn, .setup-form > button { align-self: flex-start; }

/* ---- Reminders ---- */
.banner-reminders { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.5rem; margin-top: 0.35rem; font-size: 13px; }
.banner-reminders-label { color: var(--shell-muted); }
.banner-reminder { padding: 0 0.45rem; border: 1px solid #c9d8dc; border-radius: 4px; background: #f3f8f8; }
.banner-reminder-overdue { border-color: #e7a59e; background: #fdf0ee; color: #8a1c12; font-weight: 600; }
.reminder-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 0.5rem 0.75rem; margin-bottom: 0.6rem; }

/* ---- Finance ---- */
.money-owing { color: var(--danger-text); }
.debtor-totals, .bank-totals { display: flex; flex-wrap: wrap; gap: 0.35rem 1.5rem; margin: 0 0 0.6rem; padding: 0.55rem 0.85rem; background: white; border: 1px solid var(--shell-border); border-radius: 8px; }
.bank-summary { margin-top: 0.75rem; }
.holder-history { display: flex; flex-direction: column; gap: 0.35rem; }
.holder-patient { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.5rem; border: 1px solid var(--shell-border); border-radius: 6px; background: #fff; }

/* ---- Reports ---- */
.reports-layout { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 1rem; align-items: start; }
.reports-list { background: white; border: 1px solid var(--shell-border); border-radius: 9px; padding: 0.4rem; max-height: calc(100vh - 220px); overflow: auto; }
.reports-list .e-treeview .e-list-item.e-active > .e-fullrow { background: var(--brand-soft); border-color: transparent; }
.reports-list .e-treeview .e-list-item.e-active > .e-text-content .e-list-text { color: var(--brand-hover); }
.reports-list .e-treeview .e-list-item .e-list-text { white-space: normal; line-height: 1.3; padding-top: 3px; padding-bottom: 3px; }
.reports-main { background: white; border: 1px solid var(--shell-border); border-radius: 9px; padding: 0.9rem 1rem; min-width: 0; }
.report-title { font-size: 1.15rem; margin: 0 0 0.25rem; }
.preferences-form .report-title:not(:first-child) { margin-top: 1.5rem; }
.report-meta { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; margin: 0.25rem 0 0.5rem; font-size: 13px; }
.report-output .e-grid .e-row.report-row-group .e-rowcell { background: #eef5f5; font-weight: 650; color: var(--brand-hover); }
.report-output .e-grid .e-row.report-row-subtotal .e-rowcell { font-weight: 650; border-top: 1px solid #c9d8dc; }
.report-output .e-grid .e-row.report-row-total .e-rowcell { font-weight: 700; background: #f3f7f8; border-top: 2px solid #9fb5bb; }
/* Group, subtotal and total labels sit in the first column and run across the empty cells beside them. */
.report-output .e-grid .e-row:is(.report-row-group, .report-row-subtotal, .report-row-total) .e-rowcell:first-child {
    overflow: visible;
    text-overflow: clip;
    white-space: nowrap;
    position: relative;
    z-index: 1;
    text-align: left;
}
.report-output .e-grid .e-row:is(.report-row-group, .report-row-subtotal, .report-row-total) .e-rowcell:first-child .e-ellipsistooltip { overflow: visible; text-overflow: clip; }
.report-print { padding: 12mm; font-family: Arial, sans-serif; font-size: 10pt; color: #000; background: #fff; }
.report-print h1 { font-size: 15pt; margin: 0 0 2mm; }
.report-print-meta { margin: 0 0 2mm; color: #333; }
.report-print table { width: 100%; border-collapse: collapse; margin-top: 3mm; }
.report-print th, .report-print td { padding: 1mm 2mm; border-bottom: 1px solid #ddd; text-align: left; }
.report-print th { border-bottom: 2px solid #555; }
.report-print .num { text-align: right; }
.report-print tr.report-row-group td { font-weight: bold; background: #f0f0f0; }
.report-print tr.report-row-subtotal td { font-weight: bold; }
.report-print tr.report-row-total td { font-weight: bold; border-top: 2px solid #555; }
@media (max-width: 900px) { .reports-layout { grid-template-columns: minmax(0, 1fr); } }

/* ---- Messages and to do ---- */
.status-bar-link { color: var(--ink); text-decoration: none; }
.status-bar-link:hover { color: var(--brand-hover); text-decoration: underline; }
.status-bar-alert { color: var(--danger-text); font-weight: 650; }
.message-unread { font-weight: 700; }
.message-thread { display: flex; flex-direction: column; gap: 0.6rem; max-height: calc(100vh - 520px); min-height: 160px; overflow: auto; }
.message-item { border: 1px solid var(--shell-border); border-radius: 8px; padding: 0.6rem 0.8rem; background: white; }
.message-mine { background: #f5faf9; }
.message-subject { font-weight: 650; margin: 0.15rem 0 0.35rem; }
.message-body { white-space: pre-wrap; margin: 0; }
.message-body-input textarea { min-height: 140px; }
.patient-picker { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ---- Appointment book ---- */
.appointment-book.e-schedule .e-resource-cells, .appointment-book.e-schedule .e-resource-text { color: var(--ink); font-weight: 650; }
.appointment-book.e-schedule .e-date-header-wrap .e-header-cells { height: auto; padding: 2px 8px; }
.appointment-book.e-schedule .e-header-cells .e-header-day { font-size: 11px; color: var(--shell-muted); }
.appointment-book.e-schedule .e-header-cells .e-header-date { font-size: 12px; color: var(--shell-muted); }
.appointment-book.e-schedule .e-header-cells .e-header-day, .appointment-book.e-schedule .e-header-cells .e-header-date { display: inline; margin-right: 0.25rem; }
.appointment-book.e-schedule .e-work-cells.e-work-hours { background: #fff; }
.appointment-book.e-schedule .e-appointment { border-radius: 4px; box-shadow: none; }
.appointment-book.e-schedule .e-appointment.appt-urgent { box-shadow: inset 4px 0 0 #cf222e; }
.appt-card { gap: 1px; padding: 0 1px; }
.appt-card .appt-line { display: flex; align-items: baseline; gap: 0.35rem; min-width: 0; }
.appt-card .appt-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.appt-card .appt-status-text { flex: 0 0 auto; font-size: 10px; font-weight: 650; opacity: 0.85; }
.appt-card .appt-meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- Account pages (sign in, register, manage account) ----
   These Identity pages use Bootstrap class names, but Bootstrap isn't loaded; this small subset styles them. */
.static-page .row { display: flex; flex-wrap: wrap; gap: 1.5rem 3rem; }
.static-page [class*="col-md-4"], .static-page [class*="col-lg-4"] { flex: 1 1 320px; max-width: 440px; }
.static-page [class*="col-lg-6"], .static-page [class*="col-xl-6"], .static-page [class*="col-md-6"] { flex: 1 1 380px; max-width: 560px; }
.static-page .mb-3 { margin-bottom: 1rem; }
.static-page .w-100 { width: 100%; }
.static-page hr { border: 0; border-top: 1px solid var(--shell-border); margin: 1rem 0; }
.static-page h2 { margin: 0 0 0.5rem; }
.form-floating { display: flex; flex-direction: column-reverse; gap: 0.3rem; margin-bottom: 1rem; }
.form-floating > label, .form-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.form-control, .form-select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.75rem;
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid #c3cfd5;
    border-radius: 6px;
}
.form-floating > .form-control::placeholder { color: #9aa8af; text-align: start; }
.form-control:focus, .form-select:focus { outline: none; }
.form-control[readonly], .form-control:disabled { background: var(--shell-surface); }
.checkbox label, .form-check { display: inline-flex; align-items: center; gap: 0.4rem; }
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    font: inherit;
    font-weight: 600;
    line-height: 1.4;
    border: 1px solid #c3cfd5;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    text-decoration: none;
}
.btn:hover { background: #eef6f5; }
.btn-primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.btn-primary:hover { color: #fff; background: var(--brand-hover); border-color: var(--brand-hover); }
.btn-danger { color: #fff; background: #b42318; border-color: #b42318; }
.btn-danger:hover { color: #fff; background: #912018; }
.btn-lg { padding: 0.65rem 1.25rem; font-size: 15px; }
.btn-link { border-color: transparent; background: transparent; color: #066e70; padding-left: 0; padding-right: 0; }
.text-danger { color: var(--danger-text); font-size: 13px; }
.alert { padding: 0.75rem 1rem; border: 1px solid var(--shell-border); border-radius: 8px; margin-bottom: 1rem; background: var(--shell-surface); }
.alert-warning { background: #fff8e6; border-color: #e7c36b; }
.alert-danger { background: #fdecea; border-color: #f1a7a0; color: #7a1610; }
.alert-success { background: #e8f5f0; border-color: #9ccfc0; }
.static-page .nav { list-style: none; padding: 0; margin: 0; display: flex; gap: 0.25rem; }
.static-page .flex-column { flex-direction: column; }
.static-page .nav-link { display: block; padding: 0.45rem 0.75rem; border-radius: 6px; color: var(--ink); text-decoration: none; }
.static-page .nav-link:hover { background: var(--brand-soft); }
.static-page .nav-link.active { background: var(--brand-soft); color: var(--brand-hover); font-weight: 650; }
.static-page .table { width: 100%; border-collapse: collapse; }
.static-page .table th, .static-page .table td { padding: 0.5rem; border-bottom: 1px solid var(--shell-border); text-align: left; }

@media (max-width: 700px) {
    .app-brand-row, .account-header, .admin-header-top { flex-wrap: wrap; padding: 0.65rem 1rem; gap: 0.65rem; }
    .app-header-top { flex-wrap: wrap; padding: 0.25rem 0.75rem; }
    .app-header-top .tenant-bar { white-space: normal; }
    .tenant-bar { gap: 0.35rem; }
    .app-main, .admin-main { padding: 0.75rem; }
    .home-essentials { grid-template-columns: 1fr; }
    .home-workspace { padding: 0; }
    .welcome-panel { margin-bottom: 1.25rem; }
    .static-page { margin: 1rem; padding: 1.25rem; }
    .status-bar { gap: 0.25rem 0.75rem; padding: 0.35rem 0.75rem; }
    .patient-finder-search .e-input-group { width: 100%; }
    .details-groups { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

@media print {
    body { background: white; color: black; }
    .app-header, .account-header, .status-bar, .skip-link { display: none; }
    .app-shell { height: auto; }
    .app-main { overflow: visible; padding: 0; }
    .static-page { margin: 0; padding: 0; border: 0; box-shadow: none; }
}
.careplan-detail { display: grid; grid-template-columns: max-content 1fr; gap: 0.25rem 1rem; margin: 0.5rem 0 0; font-size: 13px; }
.careplan-detail dt { color: var(--shell-muted); }
.careplan-detail dd { margin: 0; white-space: pre-wrap; }
/* Template field lists and the PDF template designer */
.template-field-group { display: block; margin: 0.5rem 0 0.15rem; font-size: 12px; font-weight: 600; color: var(--shell-muted); text-transform: uppercase; letter-spacing: 0.03em; }
.tpl-designer { display: grid; grid-template-columns: 230px minmax(0, 1fr) 270px; gap: 0.75rem; height: calc(100vh - 250px); }
.tpl-palette, .tpl-props { display: flex; flex-direction: column; gap: 0.3rem; overflow-y: auto; padding: 0.6rem; background: white; border: 1px solid var(--shell-border); border-radius: 8px; }
.tpl-props-section { margin-top: 0.9rem; }
.tpl-chip { padding: 0.2rem 0.5rem; border: 1px solid #c9d8dc; border-radius: 4px; background: #f3f8f8; font-size: 13px; cursor: grab; user-select: none; }
.tpl-chip:hover { border-color: var(--color-sf-primary, #0f766e); }
.tpl-chip-ask { background: #fff7e6; border-color: #e8c27a; }
.tpl-pages { overflow: auto; padding: 0.75rem; background: #e7ecee; border-radius: 8px; }
.tpl-page-label { margin: 0.4rem 0 0.2rem; font-size: 12px; color: var(--shell-muted); }
.tpl-page { position: relative; margin-bottom: 1rem; background: white; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18); }
.tpl-page img { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; user-select: none; }
.tpl-page-loading { position: absolute; top: 1rem; left: 1rem; color: var(--shell-muted); }
.tpl-box { position: absolute; box-sizing: border-box; overflow: hidden; padding: 0 2px; border: 1px dashed #0f766e; background: rgba(15, 118, 110, 0.12); color: #0b4f4a; font-family: Helvetica, Arial, sans-serif; line-height: 1.15; white-space: nowrap; text-overflow: ellipsis; cursor: move; touch-action: none; }
.tpl-box:focus { outline: none; }
.tpl-box-selected { border-style: solid; border-width: 2px; background: rgba(15, 118, 110, 0.2); }
.tpl-box-ask { border-color: #b7791f; background: rgba(232, 194, 122, 0.25); color: #6b4a12; }
.tpl-handle { position: absolute; right: 0; bottom: 0; width: 9px; height: 9px; background: #0f766e; cursor: nwse-resize; }
.tpl-formfield { position: absolute; box-sizing: border-box; border: 1px solid #2563eb; background: rgba(37, 99, 235, 0.06); pointer-events: none; }
.tpl-formfield-mapped { background: rgba(37, 99, 235, 0.2); }
@media (max-width: 1100px) { .tpl-designer { grid-template-columns: 1fr; height: auto; } }
/* Prescribing wizard (Bp's New Rx steps) */
.rx-choose { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 0.6rem; }
.rx-brand { font-style: italic; }
.rx-dose { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.6rem; margin-bottom: 0.5rem; }
.rx-dose > div { display: flex; flex-direction: column; gap: 0.3rem; }
.rx-label { display: block; margin-top: 0.3rem; font-size: 12px; font-weight: 600; color: var(--shell-muted); }
.rx-note-type { display: flex; flex-direction: column; margin-right: 1rem; }
.rx-summary { margin: 0.6rem 0; padding: 0.6rem 0.8rem; border: 1px solid var(--shell-border); border-radius: 6px; background: #f8fbfb; }
.banner-preventive { border-color: #9fd3b4; background: #effaf3; color: #14532d; font: inherit; font-size: 13px; cursor: pointer; }
.banner-preventive:hover { border-color: #15803d; }

/* Clinical tools */
.assessment-questions { display: flex; flex-direction: column; gap: 6px; margin: 10px 0; }
.assessment-columns { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.cycle-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 24px; }
.cycle-layout h4, .diabetes-cycle h4 { margin: 12px 0 4px; }
.cycle-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.cycle-table td { padding: 3px 8px 3px 0; border-bottom: 1px solid var(--shell-border); vertical-align: top; }
.cycle-label { width: 210px; }
.cycle-date { width: 100px; white-space: nowrap; }
.cycle-status { width: 90px; text-align: right; }
.cycle-table th { text-align: left; padding: 3px 8px 3px 0; }
.cycle-table .num { text-align: right; }
.report-print h2.daysheet-heading { font-size: 11pt; margin: 5mm 0 0; }
.status-strong { font-weight: 600; }
.export-choice { display: flex; gap: 8px; align-items: center; }
.label-sheet { width: 210mm; height: 297mm; box-sizing: border-box; display: grid; background: #fff; margin: 0 auto; }
.label-cell { overflow: hidden; padding: 2mm 3mm; box-sizing: border-box; line-height: 1.25; }
@media screen { .label-cell { outline: 1px dashed #ccc; } }
.drug-sheet table { border-collapse: collapse; width: 100%; }
.drug-sheet-head th { text-align: left; width: 90px; }
.drug-sheet-grid th, .drug-sheet-grid td { border: 1px solid #666; padding: 1mm; font-size: 8pt; }
.drug-sheet-grid td { height: 11mm; }
.drug-sheet-medicine { width: 62mm; text-align: left; }
.drug-sheet-time { writing-mode: vertical-rl; transform: rotate(180deg); font-weight: normal; }
.lock-screen { position: fixed; inset: 0; z-index: 100000; background: var(--shell-surface); display: flex; align-items: center; justify-content: center; }
.lock-card { background: #fff; border: 1px solid var(--shell-border); border-radius: 12px; padding: 28px 32px; width: min(420px, calc(100vw - 32px)); box-shadow: var(--panel-shadow); }
.lock-card h2 { margin: 16px 0 8px; }
.lock-card input[type=password] { width: 100%; margin: 8px 0 12px; }
.search-builder { background: #fff; border: 1px solid var(--shell-border); border-radius: 8px; padding: 8px 16px; margin-bottom: 12px; }
.search-builder h4 { margin: 8px 0 4px; }
.search-criterion { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 0; border-bottom: 1px dashed var(--shell-border); }
.library-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; height: calc(88vh - 230px); }
.library-list { overflow-y: auto; padding-right: 8px; }
.library-list h4 { margin: 12px 0 4px; }
.library-item { display: flex; gap: 10px; align-items: flex-start; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.library-item:hover { background: var(--shell-surface); }
.library-item-active { background: var(--row-selected); }
.library-added { min-width: 44px; font-size: 0.8rem; padding-top: 2px; }
.library-preview { overflow-y: auto; background: var(--shell-surface); padding: 12px; border-radius: 6px; }
.library-preview { overflow-x: hidden; }
.library-preview .letter-sheet { margin: 0 auto; width: auto; max-width: 100%; min-height: 0; box-sizing: border-box; }
@media (max-width: 900px) { .library-layout { grid-template-columns: 1fr; height: auto; } }
.cycle-bp { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; }
@media (max-width: 900px) { .cycle-layout { grid-template-columns: 1fr; } }
.assessment-question { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; }
.assessment-result { margin: 12px 0 8px; padding: 10px 12px; border-radius: 6px; background: var(--brand-soft); border: 1px solid var(--shell-border); min-height: 44px; }
.assessment-note { margin-top: 4px; font-size: 12px; color: var(--shell-muted); }

/* Today's notes: coded terms, tools, history and examination */
.consult-term { flex: 1 1 320px; min-width: 260px; }
.consult-tools { display: flex; gap: 8px; margin: 4px 0 6px; }
.consult-earlier { margin-bottom: 10px; }
.last-visit-note, .hx-preview pre { white-space: pre-wrap; font-family: Consolas, "Cascadia Mono", Menlo, monospace; font-size: 12.5px; margin: 0; }
.last-visit-note { max-height: 55vh; overflow: auto; padding: 10px; border: 1px solid var(--shell-border); border-radius: 6px; }
.hx-layout { display: grid; grid-template-columns: 190px 1fr; gap: 14px; min-height: 0; }
.hx-systems { display: flex; flex-direction: column; gap: 2px; }
.hx-system { text-align: left; border: 0; background: transparent; padding: 6px 10px; border-radius: 6px; font: inherit; cursor: pointer; color: var(--ink); }
.hx-system:hover { background: var(--brand-soft); }
.hx-system-current { background: var(--brand-soft); font-weight: 600; }
.hx-system-done::after { content: " \2713"; color: var(--brand); }
.hx-panel h3 { font-size: 14px; margin: 0; }
.hx-heading { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 4px; }
.hx-grid { display: grid; gap: 4px 12px; align-items: center; margin-bottom: 8px; }
.hx-grid-history { grid-template-columns: 1fr 50px 50px; }
.hx-grid-exam { grid-template-columns: 180px 60px 70px 1fr; }
.hx-col { font-size: 12px; color: var(--shell-muted); }
.hx-preview { margin-top: 12px; padding: 10px 12px; border-radius: 6px; background: var(--brand-soft); border: 1px solid var(--shell-border); max-height: 160px; overflow: auto; }

/* Health summary */
.hs-options { max-width: 640px; }
.hs-option-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 24px; margin: 10px 0; }
.health-summary h1 { font-size: 16pt; margin: 0 0 2mm; }
.health-summary h2 { font-size: 11.5pt; margin: 6mm 0 2mm; padding-bottom: 1mm; border-bottom: 1px solid #000; }
.hs-practice { font-size: 9.5pt; color: #333; }
.hs-header { margin-bottom: 4mm; }
.hs-identity { width: 100%; border-collapse: collapse; font-size: 10pt; }
.hs-identity th { text-align: left; font-weight: 600; width: 22%; padding: 1mm 2mm 1mm 0; vertical-align: top; }
.hs-identity td { padding: 1mm 4mm 1mm 0; vertical-align: top; }
.hs-lines { width: 100%; border-collapse: collapse; font-size: 10pt; }
.hs-lines th { text-align: left; font-weight: 600; font-size: 9pt; color: #333; padding: 1mm 2mm 1mm 0; }
.hs-lines td { padding: 1mm 3mm 1mm 0; vertical-align: top; border-top: 1px solid #ddd; }
.hs-lines .hs-when { white-space: nowrap; width: 24mm; }
.hs-empty { font-size: 10pt; color: #444; margin: 0; }
.hs-warning { font-weight: 600; }
.hs-footer { margin-top: 8mm; font-size: 8.5pt; color: #444; }
.health-summary section { break-inside: avoid; }

/* Investigation requests */
.status-pending { color: #9a6700; }
.request-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.request-tests, .request-details { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.request-favourites { display: flex; flex-wrap: wrap; gap: 6px; }
.request-favourite { display: inline-flex; align-items: center; }
.request-favourite-remove { border: 0; background: transparent; color: var(--shell-muted); cursor: pointer; font-size: 15px; padding: 0 4px; }
.request-favourite-remove:hover { color: #cf222e; }
.request-chosen { border: 1px solid var(--shell-border); border-radius: 6px; min-height: 180px; max-height: 300px; overflow: auto; padding: 4px 8px; }
.request-chosen-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-bottom: 1px solid var(--shell-border); padding: 2px 0; }
.request-chosen-row:last-child { border-bottom: 0; }
.request-options, .request-flags { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.request-sheet h1 { font-size: 15pt; margin: 0; }
.request-sheet h2 { font-size: 9.5pt; text-transform: uppercase; letter-spacing: .04em; margin: 5mm 0 1.5mm; color: #333; border-bottom: 1px solid #000; padding-bottom: 1mm; }
.rq-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 8mm; }
.rq-meta, .rq-small { font-size: 9pt; color: #333; }
.rq-to { font-size: 10.5pt; text-align: right; }
.rq-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; font-size: 10.5pt; }
.rq-name { font-weight: 600; font-size: 11.5pt; }
.rq-tests { margin: 0; padding-left: 5mm; font-size: 11.5pt; }
.rq-tests li { margin: 1mm 0; }
.rq-flags { display: flex; gap: 6mm; margin-top: 2mm; font-weight: 600; font-size: 10.5pt; }
.rq-notes { white-space: pre-wrap; font-size: 10.5pt; margin: 0; }
.rq-sign { display: flex; gap: 12mm; margin: 14mm 0 4mm; }
.rq-sign-line { flex: 1; border-top: 1px solid #000; padding-top: 1mm; font-size: 9pt; }
.request-cancelled.letter-draft::before { content: "CANCELLED"; font-size: 72pt; }
.e-dialog .e-footer-content .e-btn.request-issue { background: var(--brand); border-color: var(--brand); color: #fff; }
.e-dialog .e-footer-content .e-btn.request-issue:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.e-dialog .e-footer-content .e-btn.request-issue:disabled { opacity: .5; }
.e-grid .e-rowcell .status-badge.status-urgent { margin-right: 6px; }

.request-cervical { margin: 12px 0 0; padding: 8px 12px 10px; border: 1px solid var(--shell-border); border-radius: 6px; display: flex; flex-direction: column; gap: 8px; }
.request-cervical legend { font-weight: 600; padding: 0 4px; }
.request-cervical-lists { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
.request-cervical-lists > div { display: flex; flex-direction: column; gap: 4px; }
.request-cervical-history { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; }
.request-cervical-heading { font-size: 12px; color: var(--shell-muted); }
.request-cervical-problem { margin: 0; color: #9a6700; font-size: 13px; }

/* Patient details form and allergies */
.patient-edit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.patient-edit-grid section { display: flex; flex-direction: column; gap: 4px; }
.patient-edit-grid h3 { font-size: 13px; margin: 8px 0 0; color: var(--shell-muted); text-transform: uppercase; letter-spacing: .04em; }
.patient-edit-row { display: flex; gap: 10px; align-items: flex-end; }
.patient-edit-row > * { flex: 1 1 0; min-width: 0; }
.patient-duplicates ul { margin: 6px 0; padding-left: 18px; }
.patient-duplicates li { margin: 4px 0; }
.allergy-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.allergy-form-heading { font-size: 13px; margin: 12px 0 4px; }

/* Find appointment, recurring bookings */
.find-appt-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.find-appt-days { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 8px 0; }
.booking-repeat { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0; }

/* Medicare Online claiming */
.claim-pill { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap; background: var(--shell-surface); color: var(--shell-muted); border: 1px solid var(--shell-border); }
.claim-pill-good, .claim-pill-active { background: #e3f4ea; color: #1d6b3c; border-color: #b9e1c8; }
.claim-pill-waiting, .claim-pill-pending { background: #eef4fb; color: #275a8c; border-color: #c8dbef; }
.claim-pill-attention, .claim-pill-locked, .claim-pill-expired { background: #fdeceb; color: #9b2c24; border-color: #f2c4c0; }
.claim-pill-muted { background: var(--shell-surface); color: var(--shell-muted); }
.claim-age-expiringsoon { color: #9a5b00; font-weight: 600; }
.claim-age-expired { color: var(--danger-text); font-weight: 600; }
.claim-dashboard { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 8px; }
.claim-card { background: #fff; border: 1px solid var(--shell-border); border-radius: 6px; padding: 12px 16px; box-shadow: var(--panel-shadow); }
.claim-card h2 { font-size: 16px; margin: 0 0 8px; }
.claim-card dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0 0 10px; }
.claim-card dt { font-weight: 400; color: var(--shell-muted); }
.claim-card dd { margin: 0; font-weight: 650; text-align: right; }
.claim-plan { margin-top: 10px; padding: 10px 14px; background: var(--shell-surface); border: 1px solid var(--shell-border); border-radius: 6px; }
.claim-plan-table { border-collapse: collapse; margin: 6px 0; font-size: 13px; }
.claim-plan-table th, .claim-plan-table td { padding: 3px 12px 3px 0; text-align: left; border-bottom: 1px solid var(--shell-border); }
.claim-messages { list-style: none; padding: 0; margin: 6px 0; font-size: 13px; }
.claim-messages li { padding: 4px 8px; margin-bottom: 3px; border-left: 3px solid var(--shell-border); background: #fff; }
.claim-messages .claim-message-error { border-left-color: #c0392b; }
.claim-messages .claim-message-warning { border-left-color: #d68910; }
.claim-messages .claim-message-informational { border-left-color: #2e86c1; }
.claim-summary { display: flex; gap: 14px; align-items: flex-start; }
.claim-facts { flex: 1; margin: 0; }
.claim-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.claim-list { padding-left: 18px; margin: 4px 0; font-size: 13px; }
.claim-list li { margin-bottom: 3px; }
.claim-raw { margin-top: 10px; font-size: 13px; }
.claim-payload { max-height: 260px; overflow: auto; background: var(--shell-surface); border: 1px solid var(--shell-border); padding: 8px; font-size: 12px; white-space: pre-wrap; word-break: break-all; }
.verify-outcome { margin-top: 8px; padding: 8px 10px; border-radius: 6px; font-size: 13px; border: 1px solid var(--shell-border); }
.verify-good { background: #e3f4ea; border-color: #b9e1c8; }
.verify-attention { background: #fdf3e6; border-color: #f0d3a6; }
.verify-returned { margin-top: 6px; }
.verify-returned ul { margin: 4px 0 6px; padding-left: 18px; }
.aob-options { display: flex; flex-wrap: wrap; gap: 16px; }
.aob-accept { padding: 8px 12px; border: 1px dashed var(--shell-border); border-radius: 6px; }
@media (max-width: 760px) { .claim-columns { grid-template-columns: 1fr; } .claim-summary { flex-direction: column; } }

/* Agency claiming documents (agreement, statement, lodgement advice, D1216S voucher) */
.cd { font-size: 12.5px; line-height: 1.45; color: #000; }
.cd h1 { font-size: 15px; margin: 6px 0 10px; }
.cd-id { float: right; font-size: 11px; font-weight: 700; border: 1px solid #000; padding: 1px 6px; }
.cd-services { width: 100%; border-collapse: collapse; margin: 8px 0; }
.cd-services th, .cd-services td { border: 1px solid #555; padding: 3px 6px; text-align: left; vertical-align: top; }
.cd-small { font-size: 10.5px; }
.cd-sign { margin-top: 26px; }
.cd-version { margin-top: 18px; font-size: 9.5px; color: #555; text-align: right; }
.claim-status { margin: 6px 0; }
.proda-steps { margin: 6px 0 10px; padding-left: 20px; font-size: 13px; } .proda-steps li { margin-bottom: 4px; }
.verify-info { background: #eef4fb; border-color: #c8dbef; }

/* Help manual */
.manual { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.manual-nav { position: sticky; top: 8px; background: #fff; border: 1px solid var(--shell-border); border-radius: 6px; padding: 12px; }
.manual-nav ol { padding-left: 18px; margin: 10px 0 0; font-size: 13px; }
.manual-nav li { margin-bottom: 4px; }
.manual-body { max-width: 860px; line-height: 1.55; }
.manual-body section { background: #fff; border: 1px solid var(--shell-border); border-radius: 6px; padding: 14px 20px; margin-bottom: 14px; }
.manual-body h2 { font-size: 18px; margin-top: 0; }
.manual-body h3 { font-size: 15px; }
.manual-body figure { margin: 12px 0; }
.manual-body img { max-width: 100%; border: 1px solid var(--shell-border); border-radius: 4px; }
.manual-body figcaption { font-size: 12px; color: var(--shell-muted); }
.manual-table { border-collapse: collapse; width: 100%; font-size: 13px; }
.manual-table th, .manual-table td { border: 1px solid var(--shell-border); padding: 5px 8px; text-align: left; vertical-align: top; }
@media (max-width: 760px) { .manual { grid-template-columns: 1fr; } .manual-nav { position: static; } }

/* Care plan rows */
.careplan-items { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.careplan-items th, .careplan-items td { border: 1px solid var(--shell-border); padding: 4px 6px; text-align: left; vertical-align: top; }
.careplan-items th { background: var(--shell-surface); font-weight: 600; }
.careplan-items td:nth-child(1) { width: 22%; } .careplan-items td:nth-child(2) { width: 26%; } .careplan-items td:nth-child(3) { width: 30%; }
.careplan-items-view td { white-space: pre-wrap; }
.careplan-sheet h1 { font-size: 18px; text-align: center; }
.careplan-head { width: 100%; border-collapse: collapse; margin-bottom: 10px; font-size: 13px; }
.careplan-head th { text-align: left; width: 14%; padding: 2px 6px 2px 0; }
.careplan-head td { padding: 2px 6px 2px 0; }
.careplan-sheet .careplan-items th, .careplan-sheet .careplan-items td { border-color: #555; }
.careplan-agreement { margin-top: 18px; }
.banner-lifestyle { margin-right: 14px; font-size: 13px; }
.banner-lifestyle .banner-reminders-label { margin-right: 4px; }
.banner-lifestyle-flag { color: var(--danger-text); font-weight: 600; }
.autofill-layout { display: grid; grid-template-columns: 260px 1fr; gap: 12px; }
.autofill-preview { margin: 0; padding: 8px; height: 320px; overflow: auto; background: var(--shell-surface); border: 1px solid var(--shell-border); white-space: pre-wrap; font-family: inherit; font-size: 13px; }
.letter-select { border: 1px solid var(--shell-border); border-radius: 6px; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow: auto; } .letter-select legend { font-size: 12px; color: var(--shell-muted); padding: 0 4px; }

/* Invoice print (Find invoice / Billing history › Print invoice). */
.invoice-print .invoice-head { display: flex; justify-content: space-between; gap: 8mm; border-bottom: 2px solid #555; padding-bottom: 3mm; }
.invoice-print .invoice-title { text-align: right; }
.invoice-print h2 { font-size: 14pt; margin: 0 0 1mm; }
.invoice-print h3 { font-size: 9pt; text-transform: uppercase; color: #555; margin: 0 0 1mm; }
.invoice-print .invoice-flag { font-weight: bold; margin-top: 1mm; }
.invoice-print .invoice-parties { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6mm; margin: 4mm 0; }
.invoice-print .num { text-align: right; }
.invoice-print tfoot th, .invoice-print tfoot td { border-bottom: none; }
.invoice-print .invoice-balance th { border-top: 2px solid #555; font-size: 11pt; }
.invoice-print .invoice-claim { border: 1px solid #999; padding: 2mm 3mm; margin-bottom: 3mm; }

/* Antenatal visits and birth details. */
.antenatal-panel { margin-top: 1rem; }
.antenatal-title { margin: 0; font-size: 1rem; }
.birth-details h3 { margin: 0.75rem 0 0.25rem; font-size: 1rem; }

/* Export patient (File › Export patient). */
.export-controls .form-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin-bottom: 0.5rem; }
.patient-export h2 { font-size: 12pt; margin: 5mm 0 1mm; border-bottom: 1px solid #555; }
.patient-export h3 { font-size: 10pt; margin: 2mm 0 1mm; }
.patient-export .export-lines { margin: 0 0 0 5mm; padding: 0; }
.patient-export .export-none { color: #555; margin: 0; }
.patient-export .export-visit { break-inside: avoid; margin-bottom: 3mm; }
.patient-export .export-note { white-space: pre-wrap; }
.patient-export .export-amend { font-style: italic; }
.report-print .num { text-align: right; }
.invoice-print .invoice-footer { margin-top: 6mm; border-top: 1px solid #999; padding-top: 2mm; white-space: pre-wrap; }

/* Travel medicine. */
.travel-heading { margin-top: 1rem; }
.travel-vaccines { display: grid; grid-template-columns: 1fr; gap: 0.25rem; max-height: 260px; overflow-y: auto; }
.travel-schedule { width: 100%; margin: 0.5rem 0; }
.travel-schedule .travel-late td { color: #b42318; font-weight: 600; }

/* Process bulk payment. */
.bulk-payment .form-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: end; margin-bottom: 0.5rem; }
.bulk-payment .payment-summary { display: flex; gap: 1rem; align-items: center; margin: 0.75rem 0; flex-wrap: wrap; }
.import-files { width: 100%; margin: 0.5rem 0; }
.import-files .import-done td { color: var(--shell-muted); }

/* Asthma action plan. */
.asthma-plan h4 { margin: 0.6rem 0 0.1rem; }
.asthma-print .asthma-zone { border: 2px solid; border-radius: 3mm; padding: 2mm 4mm; margin: 3mm 0; break-inside: avoid; }
.asthma-print .asthma-zone h2 { font-size: 12pt; margin: 0 0 1mm; }
.asthma-print .asthma-well { border-color: #2e7d32; background: #edf7ee; }
.asthma-print .asthma-unwell { border-color: #f9a825; background: #fff8e1; }
.asthma-print .asthma-severe { border-color: #e65100; background: #fff1e6; }
.asthma-print .asthma-emergency { border-color: #c62828; background: #fdecea; }
.request-previous { margin-top: 10px; border-top: 1px solid var(--shell-border); padding-top: 6px; }
.request-previous summary { cursor: pointer; font-weight: 600; }
.request-previous-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.request-previous h4 { margin: 6px 0 2px; }
.request-previous ul { margin: 0; padding-left: 18px; }

/* Health assessments. */
.health-assessment h4 { margin: 0.6rem 0 0.2rem; }
.ha-questions { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 6px 18px; }
.ha-question { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.rx-check-allergy { color: var(--danger, #b42318); font-weight: 600; }

.admission-line { flex-wrap: nowrap; gap: 0.5rem; align-items: flex-end; }

.draft-scripts { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0.25rem 0 0.5rem; padding: 0.4rem 0.6rem; border: 1px solid #e3c26b; border-radius: 6px; background: #fff8e1; }
.draft-script { display: inline-flex; align-items: center; gap: 0.4rem; }
/* Syncfusion uploaders are 100% wide plus a border, which made pages scroll sideways by 2px. */
.e-upload.e-control-wrapper { box-sizing: border-box; }

.request-additional { margin: 0.4rem 0; padding: 0.3rem 0.5rem; border: 1px solid var(--shell-border, #d0d7de); border-radius: 6px; }
.request-additional summary { cursor: pointer; font-weight: 600; }

.workspace-tab-label { display: inline-block; padding: 0.35rem 0.1rem; cursor: pointer; }
.admin-tabs { margin-bottom: 0.75rem; }
