:root{font-family:Arial,Helvetica,sans-serif;color:#172d34;background:#f4f7f6;font-synthesis:none;--accent:#176b5c;--border:#dbe5e1;--muted:#62746f}*{box-sizing:border-box}body{margin:0}[hidden]{display:none!important}.topbar{height:80px;background:#fff;border-bottom:1px solid var(--border);display:flex;justify-content:space-between;align-items:center;padding:0 5vw}.brand{font-size:18px;font-weight:700;color:inherit;text-decoration:none;display:flex;align-items:center;gap:12px}.brand-mark{width:34px;height:34px;display:grid;place-items:center;background:var(--accent);color:white;border-radius:9px;font-size:28px;font-weight:400}#account{display:flex;align-items:center;gap:18px;font-size:13px;color:var(--muted)}main{max-width:1280px;margin:54px auto;padding:0 32px;min-height:65vh}.eyebrow{font-size:11px;letter-spacing:1.6px;font-weight:700;color:var(--accent);margin:0 0 14px}h1{font-size:36px;letter-spacing:-1px;margin:0 0 12px}.muted{color:var(--muted);line-height:1.6;margin:0}.login-panel{max-width:440px;margin:70px auto;background:#fff;border:1px solid var(--border);border-radius:16px;padding:38px;box-shadow:0 8px 32px #172d3408}form{margin-top:28px}form label{display:block;font-size:13px;font-weight:700;margin:20px 0 8px}input,select{font:inherit;background:#fff;color:inherit;border:1px solid #becfc8;border-radius:7px;padding:12px;width:100%}input:focus-visible,select:focus-visible,.button:focus-visible{outline:3px solid #9bd4bd;outline-offset:2px}.button{font:inherit;font-size:13px;font-weight:700;cursor:pointer;border-radius:7px;padding:11px 17px;border:1px solid transparent}.button.primary{color:white;background:var(--accent);width:100%;margin-top:24px}.button.secondary{color:#244b40;background:white;border-color:#cddcd5}.button:hover:not(:disabled){filter:brightness(.96)}.button:disabled{opacity:.45;cursor:default}.message{font-size:14px;color:var(--muted);line-height:1.6}.error{color:#a33131}.page-heading{display:flex;align-items:center;justify-content:space-between;margin-bottom:30px}.registry{border:1px solid var(--border);border-radius:12px;background:#fff;overflow:hidden}.registry-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:20px 24px;font-size:13px;border-bottom:1px solid var(--border)}#result-summary{font-weight:700}.page-size{display:flex;align-items:center;gap:12px;color:var(--muted);white-space:nowrap}.page-size select{width:75px;padding:8px}.table-wrap{overflow-x:auto}table{border-collapse:collapse;width:100%;text-align:left;font-size:13px}th{background:#f7faf8;color:var(--muted);font-size:11px;letter-spacing:.6px;text-transform:uppercase;font-weight:700;padding:17px 24px;white-space:nowrap}td{border-top:1px solid #edf1ef;padding:20px 24px;white-space:nowrap}td:first-child{font-weight:700}td:last-child{font-family:monospace;font-size:11px;color:var(--muted)}.status{font-size:10px;font-weight:700;background:#e6f3ec;color:#287348;border-radius:5px;display:inline-block;padding:5px 8px}.status.other{background:#edf0f3;color:#596977}.table-message{padding:48px 24px;text-align:center;color:var(--muted);font-size:14px}.pagination{display:flex;justify-content:space-between;align-items:center;padding:17px 24px;border-top:1px solid var(--border);font-size:13px;color:var(--muted)}.pagination button+button{margin-left:8px}footer{text-align:center;padding:20px;color:#80918a;font-size:11px}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}@media(max-width:700px){.topbar{height:auto;min-height:70px;padding:18px 20px;gap:18px;flex-wrap:wrap}.brand{font-size:16px}#account{width:100%;justify-content:space-between}main{margin:32px auto;padding:0 16px}.login-panel{padding:28px;margin:40px auto}h1{font-size:30px}.registry-toolbar{padding:16px}.page-size{font-size:12px}.pagination{padding:16px}th,td{padding:16px}.page-heading{gap:16px}}

.search-form { margin: 0 0 24px; }
.search-controls { display: flex; gap: 10px; align-items: center; }
.search-controls input { flex: 1; margin: 0; min-width: 0; }
@media (max-width: 600px) { .search-controls { flex-wrap: wrap; } .search-controls input { flex-basis: 100%; } }

.search-controls .button.primary { width: auto; margin-top: 0; }

.patient-link { background: none; border: 0; padding: 0; color: var(--accent); text-decoration: underline; font: inherit; font-weight: 700; cursor: pointer; }
.patient-link:focus-visible { outline: 3px solid #9bd4bd; outline-offset: 3px; }
.patient-details { margin-bottom: 24px; }
.patient-details h2 { margin: 0; font-size: 20px; }
.patient-details dl { display: grid; grid-template-columns: minmax(100px, 160px) minmax(0, 1fr); gap: 16px; padding: 24px; }
.patient-details dt { color: var(--muted); }
.patient-details dd { margin: 0; overflow-wrap: anywhere; }

#permissions-panel .registry { margin-top: 24px; }
#permission-rows select { min-width: 140px; }
#permissions-panel td:last-child { font-family: inherit; }

#permissions-panel th, #permissions-panel td { padding: 12px; font-size: 12px; }

.record-actions { padding: 16px 24px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.record-actions p { font-size: 13px; }
#details-title:focus { outline: 3px solid #9bd4bd; outline-offset: 5px; }

#workspace.record-open > :not(#patient-details) { display: none; }
.patient-details h1 { margin-bottom: 12px; }

.clinical-panel { padding: 24px; border-top: 1px solid var(--border); }
.clinical-panel form { margin: 20px 0; }
.clinical-panel form button { margin-top: 12px; }
.encounter-button { display: block; margin: 12px 0; text-align: left; }
.note-card { border: 1px solid var(--border); padding: 16px; border-radius: 8px; margin: 16px 0; }
.note-card pre { white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; }
textarea { width: 100%; padding: 12px; font: inherit; border: 1px solid var(--border); border-radius: 8px; }

.unsaved-warning { margin: 24px; padding: 16px; border: 2px solid #ab7723; border-radius: 8px; background: #fff8e9; }

.module-nav {display:flex;gap:.5rem;flex-wrap:wrap;margin:1rem 0;} .module-screen {padding:1.5rem;}
.module-form {display:grid;gap:.55rem;max-width:48rem;margin:1rem 0;} .module-form fieldset {border:1px solid #dce5e2;border-radius:.5rem;padding:1rem;margin:.5rem 0;}
.module-form label {display:block;font-weight:600;} .module-form input:not([type=checkbox]), .module-form select, .module-form textarea {width:100%;padding:.6rem;border:1px solid #cbd5d1;border-radius:.4rem;font:inherit;}
.module-form input[type=checkbox] {width:auto;margin-right:.5rem;} .module-form .inline-options {display:flex;gap:.75rem;flex-wrap:wrap;}
.module-card {border:1px solid #dce5e2;border-radius:.5rem;padding:1rem;margin:.75rem 0;overflow-wrap:anywhere;} .module-card pre {white-space:pre-wrap;font:inherit;}
.module-card button {margin:.25rem .5rem .25rem 0;} .module-form button {justify-self:start;} .module-muted {color:#64736c;font-size:.9rem;}


.office-form-sheet { background:#fff; color:#182b23; border:1px solid #dce5e2; padding:2rem; max-width:54rem; margin:1.5rem auto; overflow-wrap:anywhere; }
.office-form-sheet h2 { font-size:1.7rem; margin:.6rem 0; }
.office-form-sheet h3 { font-size:1.05rem; margin:1.5rem 0 .7rem; border-bottom:1px solid #9faea7; padding-bottom:.3rem; }
.office-form-practice { font-weight:700; margin:0; }
.office-form-version { font-size:.8rem; color:#526259; }
.office-form-notice { padding:.7rem; border:1px solid #ccd7d1; font-size:.9rem; }
.office-form-notice.draft { border-color:#aa7a2d; background:#fff9ed; }
.office-form-identifiers { display:grid; grid-template-columns:1fr 1fr; gap:0 1rem; }
.office-form-field { margin:.8rem 0; break-inside:avoid; }
.office-form-label { font-weight:600; margin:.5rem 0; }
.office-form-rule { height:1.6rem; border-bottom:1px solid #9faea7; }
.office-form-check { margin:.5rem 0; }
.office-form-table { width:100%; table-layout:fixed; border-collapse:collapse; }
.office-form-table th, .office-form-table td { border:1px solid #a8b5ae; padding:.45rem; white-space:normal; font:inherit; font-size:.85rem; color:inherit; }
.office-form-table th { font-weight:600; text-transform:none; letter-spacing:normal; }
.office-form-table td { height:1.8rem; }
@media(max-width:600px) { .office-form-sheet {padding:1rem;} .office-form-identifiers {grid-template-columns:1fr;} }
@media print {
  @page { size:auto; margin:16mm; }
  body.printing-office-form {background:white;font:11pt Arial,sans-serif;color:black;}
  body.printing-office-form > :not(#office-form-print) {display:none!important;}
  body.printing-office-form #office-form-print {display:block!important;border:0;padding:0;margin:0;max-width:none;color:black;}
  body.printing-office-form .office-form-sheet h2 {font-size:18pt;}
  body.printing-office-form .office-form-section h3 {break-after:avoid;}
  body.printing-office-form .office-form-table thead {display:table-header-group;}
  body.printing-office-form .office-form-table tr {break-inside:avoid;}
  body.printing-office-form .office-form-notice {background:white;}
}

.portal-table-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:.75rem;padding:.75rem 0;border-bottom:1px solid #ddd;}
#portal-content label{display:block;margin:.5rem 0;}
#portal-content input:not([type="checkbox"]),#portal-content textarea{width:100%;}
#portal-content fieldset{margin:1rem 0;padding:1rem;min-width:0;}

/* Typeahead keeps the original field/selection authoritative. */
.typeahead {position:relative;min-width:0;width:100%;}
.search-controls > .typeahead {flex:1;}
.typeahead input {width:100%;}
.typeahead-list {position:absolute;z-index:30;top:100%;left:0;right:0;max-height:18rem;overflow:auto;background:#fff;border:1px solid #b9c7c4;border-radius:8px;box-shadow:0 6px 18px #15292720;}
.typeahead-option {padding:12px 14px;cursor:pointer;white-space:normal;overflow-wrap:anywhere;border-bottom:1px solid #edf1ef;}
.typeahead-option:hover,.typeahead-option[aria-selected="true"] {background:#e8f3ef;color:#173f35;}
.typeahead-filter {font-weight:normal;}
.sr-only {position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0;}

/* Shared controls across staff, administration, and patient forms. */
input:not([type=checkbox]):not([type=radio]), select, textarea,
.module-form input:not([type=checkbox]):not([type=radio]), .module-form select, .module-form textarea {
  font:inherit; color:inherit; background-color:#fff; border:1px solid #becfc8;
  border-radius:7px; padding:12px; min-height:44px; line-height:1.3;
}
select, .module-form select {
  appearance:none; -webkit-appearance:none; padding-right:40px;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%2362746f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline:3px solid #9bd4bd; outline-offset:2px; border-color:var(--accent);
}
input:disabled, select:disabled, textarea:disabled {background-color:#f1f5f3;color:var(--muted);cursor:not-allowed;}
.duration-options {border:1px solid var(--border);border-radius:7px;padding:12px;}
.duration-options summary {color:var(--accent);font-size:13px;font-weight:600;cursor:pointer;}
.duration-options summary:focus-visible {outline:3px solid #9bd4bd;outline-offset:3px;}
.duration-options label {margin-top:16px;}
@media (forced-colors:active) {select,.module-form select {appearance:auto;background-image:none;}}

.schedule-toolbar {max-width:none;grid-template-columns:repeat(3,minmax(140px,1fr));align-items:end;}
.schedule-navigation {display:flex;gap:8px;flex-wrap:wrap;grid-column:1/-1;}
.schedule-container {overflow-x:auto;margin:24px 0;}
.schedule-grid {display:grid;min-width:480px;border:1px solid var(--border);border-radius:8px;overflow:hidden;background:white;}
.schedule-column-heading {padding:14px 10px;background:#f1f7f4;font-weight:700;border-right:1px solid var(--border);}
.schedule-axis,.schedule-provider-column {position:relative;border-right:1px solid var(--border);}
.schedule-axis span {position:absolute;left:8px;font-size:12px;color:var(--muted);}
.schedule-slot {position:absolute;left:0;width:100%;padding:0;border:0;border-top:1px solid #e5eeea;background:transparent;text-align:center;color:var(--muted);font:inherit;font-size:12px;}
button.schedule-slot {cursor:pointer;}button.schedule-slot:hover,button.schedule-slot:focus-visible {background:#e3f3eb;outline:2px solid var(--accent);outline-offset:-2px;}
.schedule-lunch {background:#f2f3f2;}
.schedule-event {position:absolute;z-index:1;border:1px solid #8ab9a8;border-left:4px solid var(--accent);border-radius:5px;background:#e6f3ec;color:#173f35;padding:3px 6px;text-align:left;overflow:hidden;cursor:pointer;font:inherit;font-size:12px;}
.schedule-event strong,.schedule-event span {display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.schedule-event:hover,.schedule-event:focus-visible {background:#cfe7dc;outline:2px solid var(--accent);outline-offset:-2px;}
.schedule-status-arrived {background:#e4effb;border-color:#6393bd;}.schedule-status-completed {background:#edf0ed;border-color:#9ca99d;}
@media(max-width:650px){.schedule-toolbar{grid-template-columns:1fr;}}

/* Persistent workspace navigation; patient sections share the same sidebar. */
.workspace-sidebar {position:fixed;left:0;top:80px;bottom:0;width:232px;background:#fff;border-right:1px solid var(--border);padding:20px 14px;overflow-y:auto;z-index:20;}
.workspace-sidebar .module-nav {display:flex;flex-direction:column;gap:4px;margin:8px 0 20px;}
.workspace-sidebar .button {width:100%;text-align:left;white-space:normal;border:0;background:transparent;padding:11px 14px;border-radius:7px;font-weight:500;}
.workspace-sidebar .button:hover {background:#f0f6f3;}
.workspace-sidebar .button.nav-active {background:#e4f1eb;color:var(--accent);font-weight:700;box-shadow:inset 3px 0 var(--accent);}
.sidebar-label {font-size:10px;letter-spacing:1.2px;color:var(--muted);font-weight:700;margin:8px 14px 12px;}
#sidebar-record {border-top:1px solid var(--border);padding-top:16px;margin-top:16px;}
#sidebar-toggle {display:none;}
.workspace-open main {margin:28px 24px 40px 256px;padding:0;max-width:none;min-width:0;}
.workspace-open .topbar {position:sticky;top:0;z-index:25;padding:0 24px;}
.module-screen {min-width:0;padding:20px;}
.module-screen .registry-toolbar {padding:0 0 20px;}
.schedule-container {max-width:100%;}
.schedule-toolbar {gap:12px;}
.schedule-toolbar > .button.primary {width:auto;margin:0;grid-column:1/-1;}
@media(max-width:800px) {
  .workspace-sidebar {position:static;width:auto;border-right:0;border-bottom:1px solid var(--border);padding:10px 16px;}
  #sidebar-toggle {display:block;width:auto;}
  .workspace-sidebar .module-nav {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
  .workspace-open main {margin:20px 16px;padding:0;}
  .workspace-open .topbar {padding:0 16px;height:auto;min-height:72px;gap:12px;flex-wrap:wrap;}
  #account {gap:8px;font-size:12px;}
}
@media(min-width:801px) {#sidebar-content[hidden] {display:block!important;}}

/* Encounter workspace: persistent identity, chart context, and note editing. */
#patient-details > .registry-toolbar {position:sticky;top:80px;z-index:15;background:#fff;flex-wrap:wrap;}
#patient-details > .registry-toolbar h1 {font-size:28px;}
.demographics-disclosure {border-top:1px solid var(--border);padding:14px 24px;}
.demographics-disclosure summary {cursor:pointer;color:var(--accent);font-size:14px;font-weight:700;}
.encounter-workspace {display:flex;align-items:stretch;border-top:1px solid var(--border);}
.encounter-content {flex:1;min-width:0;}
.patient-module-open #clinical-panel {display:none!important;}
.patient-module-open .encounter-content {min-width:0;}
.patient-module-open #record-modules {min-height:55vh;border-top:0;}
#record-module-title:focus,#clinical-title:focus {outline:2px solid var(--accent);outline-offset:5px;}
.chart-summary {flex:0 0 240px;background:#f5f9f7;border-right:1px solid var(--border);padding:20px;overflow-wrap:anywhere;}
.chart-summary h2 {font-size:18px!important;margin:0 0 12px!important;}
.chart-summary h3 {font-size:15px;margin:0 0 8px;}
.chart-summary section {border-top:1px solid var(--border);margin-top:20px;padding-top:18px;}
.chart-summary p {font-size:14px;line-height:1.55;margin:9px 0;}
.chart-summary small {display:block;color:#52665e;font-size:12px;line-height:1.5;}
.chart-summary .button {font-size:12px;margin-top:10px;padding:9px 11px;}
.chart-summary .summary-refresh {margin-top:0;}
.note-section-nav {display:flex;gap:6px;flex-wrap:wrap;border-bottom:1px solid var(--border);padding-bottom:14px;margin-bottom:18px;}
.note-section-nav .button {margin:0!important;}
#note-form textarea {font-size:15px;line-height:1.65;scroll-margin-top:200px;}
.draft-action-bar {position:sticky;bottom:0;z-index:10;display:flex;gap:10px;align-items:center;flex-wrap:wrap;background:#fff;border-top:1px solid var(--border);padding:14px 0;margin-top:20px;}
.draft-action-bar p {flex:1;min-width:160px;font-size:13px;}
.draft-action-bar .button {margin:0!important;}
#save-draft {background:var(--accent);color:#fff;border-color:var(--accent);}
#sign-panel input[type=checkbox] {width:auto;min-height:0;}
#draft-preview {background:#f7faf8;}
@media(max-width:1150px){.chart-summary{flex-basis:210px;padding:16px;}.clinical-panel{padding:18px;}}
@media(max-width:950px){.encounter-workspace{display:block;}.chart-summary{border-right:0;border-bottom:1px solid var(--border);display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;}.chart-summary section{margin:0;}.chart-summary h2,.chart-summary .summary-refresh{grid-column:1/-1;justify-self:start;}}
@media(max-width:800px){#patient-details > .registry-toolbar{position:static;}#note-form textarea{scroll-margin-top:20px;}}
@media(max-width:480px){.chart-summary{grid-template-columns:1fr;}.draft-action-bar{position:static;}.registry-toolbar{gap:10px;}}

.vital-history {padding:24px;border-bottom:1px solid var(--border);scroll-margin-top:190px;min-width:0;}
.billing-tabs {display:flex;gap:8px;flex-wrap:wrap;margin:16px 0;}
.billing-account-totals {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;}
.billing-account-totals .module-card {margin:12px 0;}
.billing-account-section {margin:20px 0;padding:16px;border:1px solid var(--border);border-radius:8px;}
.billing-account-section summary {font-weight:700;color:var(--accent);cursor:pointer;}
@media(max-width:850px){.billing-account-totals{grid-template-columns:1fr;gap:0;}}
.billing-tabs button[aria-pressed="true"] {box-shadow:inset 0 -3px var(--accent);}
.billing-queue-filters {grid-template-columns:repeat(2,minmax(0,1fr));max-width:none;align-items:end;}
.billing-queue-filters > button {grid-column:1/-1;}
@media(max-width:650px){.billing-queue-filters{grid-template-columns:1fr;}}
.vital-history-heading {display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;}
.vital-history-controls {display:flex;gap:16px;flex-wrap:wrap;margin:20px 0;}
.vital-history-controls label {display:grid;gap:8px;flex:1;min-width:160px;font-size:13px;font-weight:700;}
.vital-history table {font-size:13px;}
.vital-history caption {text-align:left;padding:16px 0;font-weight:700;}
.vital-history td,.vital-history th {white-space:normal;padding:12px;}
.vital-history td:last-child {font:inherit;color:inherit;}
.vital-trend-chart {display:block;width:100%;height:auto;color:#172d34;}
.vital-trend-chart text {fill:currentColor;font:12px Arial,Helvetica,sans-serif;}
.vital-grid {stroke:var(--border);stroke-width:1;}
.vital-line {stroke-width:2;}
.vital-series-0 {stroke:#176b5c;}
circle.vital-series-0 {fill:#176b5c;}
.vital-series-1 {stroke:#70539c;stroke-dasharray:6 4;}
circle.vital-series-1 {fill:#70539c;stroke-dasharray:none;}
@media(max-width:800px){.vital-history{padding:16px;scroll-margin-top:16px;}}
