[hidden] { display: none !important; }
body #pointValuesDialog:not([open]) { display: none !important; }
.catalog-fixed-price { display: inline-flex; align-items: center; gap: 4px; }
.catalog-fixed-price input { width: 80px; min-width: 0; }
.catalog-fixed-price button { width: auto; padding: 5px 8px; }
.directory-alphabet { display: flex; flex-wrap: wrap; gap: 4px; margin: 12px 0; }
.directory-alphabet button { width: auto; min-width: 30px; padding: 6px 8px; border-radius: 6px; }
.directory-alphabet button[aria-pressed="true"] { background: #acd9f6; font-weight: bold; outline: 2px solid #4c93bf; }
.directory-pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0; }
.directory-pager button { width: 36px; height: 34px; padding: 0; }
.directory-pager label { display: flex; align-items: center; gap: 8px; }
.directory-pager input { width: 80px; }
#employees > .split { display: flex; flex-direction: column; }
#employees > .split > * { width: 100%; min-width: 0; box-sizing: border-box; }
#employeeList table { width: 100%; border-collapse: collapse; }
#employeeList th, #employeeList td { padding: 8px; border-bottom: 1px solid #dce8ef; text-align: left; }
#employeeList tbody tr:nth-child(even) { background: #f6f7f8; }
#employeeDialog, .personnel-dialog { width: min(800px,92vw); max-height: 88vh; overflow: auto; border: 1px solid #acd9f6; border-radius: 8px; padding: 20px; background: white; }
#employeeDialog:not([open]), .personnel-dialog:not([open]) { display: none !important; }
#employeeDialog::backdrop, .personnel-dialog::backdrop { background: #0006; }
.personnel-add { background: #137bbb !important; color: white !important; width: 36px !important; height: 36px; padding: 0 !important; font-size: 24px; border-radius: 6px; }
#pointValuesDialog { width: min(1100px, 94vw); max-height: 90dvh; overflow: auto; border: 1px solid #a8d4f2; border-radius: 8px; }
#pointValueForm { display: grid; gap: 10px; }
#pointValueForm > label { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(100px, 220px); align-items: center; gap: 10px; }
#servicePlanForm { display: none !important; }
#servicePlanHeaderForm { display: none !important; }
#records .record-grid:has(#servicePlanForm[hidden]) .service-plan-panel { grid-column: 1 / -1; }
.plan-day-input { width: 2.4rem; min-width: 2.4rem; padding: .2rem; text-align: center; }
.service-plan-list { display: grid; grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); gap: 14px; }
.service-plan-list { max-height: calc(100dvh - 170px); overflow: auto; align-items: start; }
.service-protocol-list { border-right: 1px solid #cfe3f3; padding-right: 10px; min-height: 420px; }
.service-protocol-list { position: sticky; top: 0; max-height: calc(100dvh - 205px); overflow: auto; }
.service-protocol-list input { width: 100%; margin-bottom: 8px; }
.service-protocol-item { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid #dfe8ef; background: #fff; padding: 8px; border-radius: 0; }
.service-protocol-item:hover { background: #eaf5fc; }
.service-protocol-item span { display: inline-block; min-width: 36px; color: #356b91; }
.service-plan-main { min-width: 0; }
#records .service-plan-panel { grid-column: 1 / -1; }
body.locked { display: block; }
#mobileNavigation { display: none; }
body.locked > :not(.login-screen) { display: none !important; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef2f0; }
.login-form { width: min(100%, 380px); display: grid; gap: 18px; background: white; padding: 28px; border: 1px solid #ccd6d1; border-radius: 6px; }
.login-form h1, .login-form h2 { margin: 0; }
.login-form h1 { font-size: 26px; color: #16634c; }
.login-form h2 { font-size: 18px; }
.login-form label, .admin-user-form label { display: grid; gap: 6px; font-size: 14px; }
#loginError { color: #a32131; margin: 0; }
.admin-user-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 20px 0; max-width: 860px; }
.admin-user-form button { align-self: end; }
.operations-table-wrap { overflow-x: auto; margin-top: 18px; }
.operations-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.operations-table th, .operations-table td { padding: 10px 12px; border-bottom: 1px solid #dbe1dd; text-align: left; overflow-wrap: anywhere; }
.operations-table th { background: #eef2f0; color: #36483e; }
.operations-table tr:nth-child(even) { background: #f6f8f7; }
.due-label { white-space: nowrap; font-weight: 600; }
.due-label.overdue { color: #a32131; }
.due-label.upcoming { color: #856000; }
#sessionName { max-width: 220px; font-size: 13px; overflow-wrap: anywhere; }
.patient-name-link { padding: 0; background: transparent; color: #126557; text-align: left; font-weight: 600; }
.patient-name-link:hover { background: transparent; text-decoration: underline; }
@media(max-width: 700px) {
  .admin-user-form { grid-template-columns: 1fr; }
  .top-actions { flex-wrap: wrap; }
  .operations-table { min-width: 600px; }
}
@media(max-width: 1050px) {
  .sidebar { position: sticky; z-index: 20; min-height: 0; height: auto; padding: 12px 18px; overflow: visible; }
  .sidebar .brand { margin: 0; min-height: 44px; padding-right: 90px; }
  #mobileNavigation { display: block; position: absolute; right: 18px; top: 15px; }
  #mainNavigation { display: none; }
  .sidebar.navigation-open #mainNavigation { display: grid; max-height: 55vh; overflow-y: auto; margin-top: 12px; }
}
@media print { #mobileNavigation { display: none !important; } }
.nav-submenu { padding: 6px 10px; font-size: 13px; }
.nav-submenu summary { cursor: pointer; padding: 5px 0; }
.nav-submenu button { display: block; width: 100%; text-align: left; padding: 7px 8px; background: transparent; color: inherit; border: 0; border-left: 2px solid #a9b9b4; border-radius: 0; margin: 2px 0; }
.nav-submenu button:hover { background: #e4efeb; color: #174d40; }
.record-edit-state { border-bottom: 2px solid #2d745e; padding: 10px 0; margin-bottom: 12px; }
.record-edit-state[hidden] { display: none !important; }
.record-history { margin-top: 16px; border-top: 1px solid #c8d0ce; padding-top: 12px; }
.record-history summary { cursor: pointer; padding: 8px 0; }
.record-history dt { font-weight: 600; }
.record-history dd { margin: 2px 0 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
#contractDetailsDialog { width:min(850px,94vw); max-height:90vh; overflow:auto; border:1px solid #c8d0ce; border-radius:4px; }
.contract-actions { display:flex; justify-content:flex-end; gap:8px; position:sticky; top:0; background:white; padding:8px; }
#contractDetailsContent { padding:20px; color:#111; }
#contractDetailsContent h1 { font-size:22px; }
#contractDetailsContent h2 { font-size:16px; margin:20px 0 8px; }
.contract-text { white-space:pre-wrap; overflow-wrap:anywhere; line-height:1.6; }
.contract-metadata { display:grid; grid-template-columns:minmax(100px,1fr) minmax(0,2fr); gap:8px 20px; }
.contract-metadata dt { font-weight:600; }
.contract-metadata dd { margin:0; overflow-wrap:anywhere; }
@media print {
  body.printing-contract > :not(#contractDetailsDialog) { display:none !important; }
  body.printing-contract #contractDetailsDialog { display:block !important; position:static; width:auto; max-height:none; height:auto; overflow:visible; border:0; margin:0; padding:0; }
  .contract-actions { display:none !important; }
  #contractDetailsContent { padding:0; page:contract-sheet; }
  #contractDetailsContent h2 { break-after:avoid; }
  @page contract-sheet { size:A4 portrait; margin:15mm; }
}
/* Screen theme only: paper forms and print layouts retain their own colors. */
@media screen {
  :root { --bg:#fff; --panel:#fff; --ink:#000; --muted:#000; --line:#a8d4f2; --shadow:none; }
  body, body main, body .sidebar, body .topbar, body .login-screen { background:#fff; color:#000; }
  body .sidebar { border-right:1px solid #a8d4f2; }
  body .brand-mark { background:#fff; color:#000; border:1px solid #a8d4f2; }
  body .brand span:last-child, body .login-form h1, body .meta, body .hint, body .eyebrow, body .nav-submenu { color:#000; }
  body .panel, body .card, body .tour-card, body .login-form, body dialog, body .record-header, body .month-scroll { background:#fff; color:#000; border-color:#a8d4f2; box-shadow:none; }
  body button, body button.secondary, body button.danger, body .sidebar .nav-button,
  body .sidebar .nav-submenu button, body .record-tab, body .shift-cell, body .patient-name-link {
    color:#000; background:#fff; border:1px solid #a8d4f2; box-shadow:none;
  }
  body button:hover, body button.secondary:hover, body button.danger:hover,
  body .sidebar .nav-button:hover, body .sidebar .nav-submenu button:hover { color:#000; background:#fff; border-color:#438fc5; }
  body .sidebar .nav-button.active, body .record-tab.active, body .shift-cell.missing-actual {
    color:#000; background:#fff; border-color:#438fc5;
  }
  body .sidebar .nav-button.active, body .record-tab.active { box-shadow:inset 0 -2px #438fc5; }
  body input, body select, body textarea { color:#000; background:#fff; border-color:#a8d4f2; }
  body input::placeholder, body textarea::placeholder { color:#595959; opacity:1; }
  body button:focus-visible, body input:focus-visible, body select:focus-visible, body textarea:focus-visible, body summary:focus-visible { outline:2px solid #438fc5; outline-offset:2px; }
  body button:disabled { opacity:.5; cursor:not-allowed; }
  body button, body .sidebar .nav-button, body .sidebar .nav-submenu button, body .record-tab { border-radius:10px; }
  body input, body select, body textarea, body .panel, body .card, body .tour-card, body .login-form, body dialog { border-radius:8px; }
  body th, body td { color:#000; border-color:#a8d4f2; }
  body .patient-table th, body .operations-table th, body .month-roster thead th,
  body .patient-table tr:nth-child(even), body .operations-table tr:nth-child(even) { background:#fff; color:#000; }
  body .record-edit-state, body .record-history, body .tour-stops li, body .visit-pool { border-color:#a8d4f2; }
}
@media screen {
  #tourDayArea [draggable="true"] { cursor: grab; }
  #tourDayArea [draggable="true"]:active { cursor: grabbing; }
  #tourBoard .tour-drop-active { outline: 2px solid #438fc5; outline-offset: 2px; }
  #tourBoard .tour-drop-before { box-shadow: 0 -4px 0 #438fc5 !important; }
  #tourBoard .tour-drop-after { box-shadow: 0 4px 0 #438fc5 !important; }
}
#patientCareAreas { border: 1px solid #a8d4f2; border-radius: 8px; grid-column: 1 / -1; }
.care-area-options { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.care-area-options label { display: inline-flex; align-items: center; gap: 6px; color: #000; }
.care-area-options input[type="checkbox"] { width: 18px; height: 18px; margin: 0; }
#mobileVisitDialog { width: min(640px, 94vw); max-height: 90vh; overflow: auto; }
#mobileResultFields fieldset { border: 1px solid #a8d4f2; border-radius: 8px; margin: 12px 0; }
#mobileVisits { display: grid; grid-template-columns: 1fr; }
#mobileVisits .card { overflow-wrap: anywhere; }
.month-roster td.shift-range-target { background: #ccecff !important; outline: 2px solid #438fc5; outline-offset: -2px; }
.shift-cell[draggable="true"] { cursor: ew-resize; }
#shiftTemplateDialog { width: min(640px, 94vw); max-height: 90vh; overflow: auto; }
#shiftTemplateForm { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
#shiftTemplateForm label { display: grid; gap: 4px; }
#shiftTemplateError { grid-column: 1 / -1; }
/* Shared compact action style; links can opt in with ui-button. */
.company-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px,100%),1fr)); gap: 16px 24px; margin: 16px 0 24px; }
#companyForm fieldset { border: 0; padding: 0; min-width: 0; }
#companyForm legend { font-size: 20px; font-weight: 600; }
#companyForm label { display: grid; gap: 5px; font-size: 13px; }
#companyForm .table-wrap { overflow: auto; margin: 16px 0; }
#companyForm td input { min-width: 145px; }
#companyForm table { width: 100%; }
#companyForm .button-row { margin-top: 24px; }
#companyForm .company-logo { display: grid; gap: 16px; justify-items: start; padding: 16px 0; }
#companyForm .company-logo img { max-width: min(100%, 640px); max-height: 300px; object-fit: contain; }
#companyForm .company-fields { grid-template-columns: repeat(2,minmax(0,1fr)); }
#companyForm .record-tabs { flex-wrap: wrap; }
@media (max-width: 700px) { #companyForm .company-fields { grid-template-columns: minmax(0,1fr); } }
body .catalog-table { width: 100%; min-width: 1100px; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
body .catalog-table th, body .catalog-table td { padding: 8px 10px; height: 34px; box-sizing: border-box; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border: 0; border-bottom: 1px solid #e3e6e9; font-weight: 400; color: #222; }
body .catalog-table th { background: #fff; border-right: 1px solid #d8dce0; text-align: left; }
body .catalog-table tbody tr:nth-child(even) { background: #f5f6f7; }
body .catalog-table tbody tr:hover { background: #e5eff7; }
body .catalog-table .numeric { text-align: right; font-variant-numeric: tabular-nums; }
body .catalog-table .catalog-col-title { width: 26%; }
body .catalog-table .catalog-col-catalogCode { width: 8%; }
body .catalog-table .catalog-col-active { width: 5%; }
body .catalog-table-wrap { overflow: auto; }
body #serviceCatalog > .panel { border: 0; padding: 0; box-shadow: none; }
body #serviceCatalog .catalog-toolbar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; align-items: end; }
body #serviceCatalog .catalog-toolbar input, body #serviceCatalog .catalog-toolbar select { font-size: 13px; min-height: 34px; padding: 7px; }
body .catalog-table th { text-transform: none; letter-spacing: 0; }
@media (max-width: 650px) { body #serviceCatalog .catalog-toolbar { grid-template-columns: 1fr; } }
.medication-paper { width: 100%; border-collapse: collapse; table-layout: fixed; color: #000; background: #fff; font: 12px Arial, sans-serif; }
.medication-paper th, .medication-paper td { border: 1px solid #555; padding: 6px 4px; vertical-align: top; overflow-wrap: anywhere; white-space: pre-wrap; text-align: left; }
.medication-paper thead th { background: #eee; color: #000; }
.medication-paper .dose-column { width: 4%; font-size: 10px; }
.medication-paper .medication-group th { background: #f2f2f2; font-weight: bold; }
.medication-heading { display: flex; justify-content: space-between; gap: 20px; padding: 12px; background: #fff; }
.medication-heading h2 { margin: 0; font-size: 24px; }
#medicationSheet { min-width: 0; }
#medicationSheet .table-wrap { overflow-x: auto; }
#medicationSheet .medication-paper { min-width: 1000px; margin-top: 12px; }
.medication-print { margin: 0; background: white; color: black; }
@media print {
  @page medication { size: A4 landscape; margin: 10mm; }
  .medication-print { page: medication; }
  .medication-print .medication-paper { font-size: 10pt; }
  .medication-print thead { display: table-header-group; }
  .medication-print tr { break-inside: avoid; }
  .medication-print .medication-heading { padding: 3mm; }
}
@media screen {
  body button:not(.shift-cell), body button.secondary, body button.danger,
  body .sidebar .nav-button, body .sidebar .nav-submenu button,
  body .record-tab, body a.ui-button {
    background: #e3f2fc; color: #111; border: 0; border-radius: 8px;
    padding: 7px 11px; min-height: 32px; font-size: 13px; line-height: 1.35;
    font-weight: 500; box-shadow: none; letter-spacing: 0;
  }
  body a.ui-button { display: inline-flex; align-items: center; text-decoration: none; }
  body button:not(.shift-cell):hover, body a.ui-button:hover { background: #cce7fa; color: #111; }
  body .sidebar .nav-button.active, body .record-tab.active,
  body #clientDetails [aria-selected="true"] { background: #b9ddf5; box-shadow: none; font-weight: 600; }
  body .sidebar .nav-button { text-align: left; padding: 9px 12px; }
  body .record-tabs { gap: 6px; }
  body #clientDetails h2 { font-size: 18px; margin: 10px 0; }
  body #clientDetails h3 { font-size: 15px; }
  body .client-detail-fields { grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 8px 24px; margin: 14px 0; font-size: 13px; }
  body .client-detail-fields dt { color: #4b5963; font-weight: 500; font-size: 12px; }
  body .client-detail-fields dd { color: #111; margin-top: 3px; }
  body .patient-table td, body .patient-table th { padding: 8px 10px; font-size: 13px; }
  body .patient-table tr:nth-child(even) { background: #f5f7f9; }
  body .patient-table .patient-row { cursor: pointer; }
  body .patient-table .patient-row:hover { background: #e6f2fa; }
  body .patient-row:focus-visible { outline: 2px solid #387ca9; outline-offset: -2px; }
  body .patient-name { color: #175786; }
}
/* Compact demo-style navigation tree, with independent disclosure and page links. */
body #mainNavigation { gap: 3px; }
body #mainNavigation .nav-button,
body #mainNavigation .navigation-unavailable { width: 100%; min-height: 34px; padding: 7px 10px; text-align: left; font-size: 13px; font-weight: 500; border: 0; border-radius: 8px; white-space: normal; overflow-wrap: anywhere; }
body #mainNavigation .navigation-group { min-width: 0; }
body #mainNavigation .navigation-group > summary { display: flex; align-items: center; gap: 4px; min-height: 34px; cursor: pointer; list-style: none; color: #000; background: #e5f3ff; border-radius: 8px; font-size: 13px; }
body #mainNavigation .navigation-group > summary::-webkit-details-marker { display: none; }
body #mainNavigation .navigation-group > summary::before { content: '\203a'; display: inline-block; flex: 0 0 18px; text-align: center; font-size: 20px; }
body #mainNavigation .navigation-group[open] > summary::before { transform: rotate(90deg); }
body #mainNavigation .navigation-group > summary > span { padding: 7px 6px; }
body #mainNavigation .navigation-group > summary > button { flex: 1; min-width: 0; }
body #mainNavigation .navigation-children { display: grid; gap: 3px; padding: 4px 0 4px 16px; margin-left: 8px; border-left: 1px solid #b7daf3; }
body #mainNavigation .navigation-unavailable { color: #686868; background: #f3f5f7; cursor: not-allowed; opacity: 1; }
body #mainNavigation .navigation-pending { color: #777; }
body #mainNavigation [aria-current="page"] { background: #c1e4fc; color: #000; font-weight: 650; }
body #mainNavigation :focus-visible { outline: 2px solid #2479b7; outline-offset: 1px; }
body #mainNavigation [hidden] { display: none !important; }
body .record-register { display: none; }
body .view.register-mode > :not(.record-register.active) { display: none !important; }
body .view.register-mode > .record-register.active { display: block; }
.register-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.register-toolbar label { display: flex; align-items: center; gap: 6px; }
.register-toolbar input { width: 220px; }
.record-register table { width: 100%; border-collapse: collapse; font-size: 13px; }
.record-register th, .record-register td { border: 1px solid #dfe3e6; padding: 7px; max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body .record-register th button { padding: 0; background: transparent; color: #000; border: 0; text-align: left; font-weight: 500; }
.record-register tbody tr:nth-child(even) { background: #f5f6f7; }
.record-register tr[data-register-id] { cursor: pointer; }
.record-register tr[data-register-id]:hover, .record-register tr[data-register-id]:focus { background: #e5f2fc; }
.record-register tr.register-expiring-yellow { background: #fff3cc !important; }
.record-register tr.register-expiring-red { background: #ffe2e2 !important; }
.service-plan-week-grid { min-width: 980px; }
.service-plan-week-grid th, .service-plan-week-grid td { vertical-align: top; white-space: nowrap; }
.service-plan-week-grid td:first-child, .service-plan-week-grid th:first-child { min-width: 280px; white-space: normal; }
.service-plan-week-grid td small { display: block; color: #64748b; }
.service-plan-group-title th { background: #eef7ff; color: #111827; text-transform: lowercase; font-size: 1rem; text-align: left; }
.service-plan-subhead th { font-weight: 600; background: #f8fbff; }
body #servicePlanList .service-plan-week-grid th,
body #servicePlanList .service-plan-week-grid td,
body #servicePlanList .service-plan-week-grid tr,
body #servicePlanList .service-protocol-item { background: #fff; color: #000; }
#servicePlanList .service-plan-main { min-height: 300px; }
.service-plan-tabs { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .75rem; }
