* { box-sizing: border-box; }
.portal-loader { position: fixed; z-index: 1000; inset: 0; display: flex; gap: 10px; align-items: center; justify-content: center; background: #ffffffb8; color: #144a71; font-weight: 600; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity .15s, visibility .15s; }
.portal-loader.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.portal-loader-spinner, .portal-image-pending::after { display: inline-block; width: 26px; height: 26px; border: 3px solid #c9dce9; border-top-color: #144a71; border-radius: 50%; animation: portal-spin .75s linear infinite; }
@keyframes portal-spin { to { transform: rotate(360deg); } }
.portal-image-pending { position: relative; }
.portal-image-pending::after { content: ''; position: absolute; top: 50%; left: 50%; margin: -13px; z-index: 2; }
.portal-image-pending > img { opacity: .3; }
.patient-avatar img { display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.patient-signature img { display: block; max-width: 200px; max-height: 90px; margin-top: 4px; object-fit: contain; }
.patient-profile-photo img { display: block; width: 250px; height: 250px; max-width: 100%; border-radius: 50%; object-fit: cover; }
.dropbox-dialog-body .portal-loader-spinner { margin: 35px; }
.save-status .portal-loader-spinner, .patient-search-results .portal-loader-spinner { width: 14px; height: 14px; border-width: 2px; vertical-align: -2px; }
.patient-search-results .portal-loader-spinner { margin: 10px; }
.table-sort-button { display: inline-flex; align-items: center; gap: 5px; min-height: 28px; padding: 0; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.table-sort-button[href] { text-decoration: none; }
.table-sort-button[href]:hover { color: #14537c; text-decoration: underline; }
.table-sort-button::after { content: '↕'; color: #738899; font-size: 13px; }
.table-sort-button[href]::after { content: none; }
th[aria-sort="ascending"] .table-sort-button::after { content: '↑'; color: #144a71; }
th[aria-sort="descending"] .table-sort-button::after { content: '↓'; color: #144a71; }
th[aria-sort] .table-sort-button[href]::after { content: none; }
.table-action { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 4px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #14537c; cursor: pointer; vertical-align: middle; text-decoration: none; }
.table-action:hover { border-color: #cadbe7; background: #edf5fa; }
.table-action:focus-visible, .table-sort-button:focus-visible { outline: 2px solid #14537c; outline-offset: 2px; }
.table-action-icon { width: 18px; height: 18px; }
.table-action-muted { color: #6d7884; }
body { margin: 0; color: #111; background: #fff; font: 14px/1.5 Arial, Helvetica, sans-serif; }
button, input { font: inherit; }
.topbar { position: relative; z-index: 20; height: 66px; display: flex; align-items: center; gap: 24px; padding: 0 30px; background: #f8f9fa; box-shadow: 0 2px 8px #00000013; }
.brand img { display: block; width: 140px; max-height: 50px; object-fit: contain; }
.patient-search { display: flex; align-items: stretch; height: 36px; flex: none; }
.patient-search-control { height: 36px; }
.patient-search input { display: block; width: 188px; height: 36px; margin: 0; padding: 0 12px; border: 1px solid #ced4da; border-radius: 3px 0 0 3px; background: #fff; line-height: 34px; }
.patient-search button { width: 36px; height: 36px; margin: 0; padding: 0; border: 0; border-radius: 0 3px 3px 0; color: #fff; background: #144a71; font-size: 25px; line-height: 1; }
.patient-search-control { position: relative; }
.patient-search button { display: grid; place-items: center; cursor: pointer; }
.patient-search-results { position: absolute; z-index: 40; top: calc(100% + 2px); left: 0; width: min(330px, 80vw); max-height: 360px; overflow-y: auto; border: 1px solid #ccd5dd; border-radius: 3px; background: #fff; box-shadow: 0 8px 22px #142a3f24; font-size: 13px; }
.patient-search-results[hidden] { display: none; }
.patient-search-results a { display: block; padding: 8px 11px; border-bottom: 1px solid #edf0f2; color: #1e3344; text-decoration: none; }
.patient-search-results a:hover, .patient-search-results a[aria-selected="true"] { background: #e6f1f8; }
.patient-search-empty { padding: 9px 11px; color: #65727d; }
.primary-nav { display: flex; gap: 13px; margin-left: auto; white-space: nowrap; }
.primary-nav button, .primary-nav a { border: 0; background: transparent; padding: 9px 3px; color: #333; text-decoration: none; }
.nav-menu { position: relative; }
.nav-menu summary { display: block; padding: 9px 3px; color: #333; cursor: pointer; list-style: none; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary::after { content: ''; display: inline-block; margin-left: 6px; vertical-align: 3px; border: 4px solid transparent; border-top-color: currentColor; border-bottom: 0; }
.nav-menu[open] summary, .nav-menu summary:hover { color: #00486e; }
.nav-dropdown { position: absolute; z-index: 50; top: 100%; right: 0; min-width: 195px; padding: 5px 0; border: 1px solid #d5dce2; border-radius: 3px; background: #fff; box-shadow: 0 8px 20px #142a3f20; white-space: nowrap; }
.nav-dropdown a, .nav-dropdown button { display: block; width: 100%; padding: 7px 14px; color: #263643; font-size: 13px; text-align: left; cursor: pointer; }
.nav-dropdown a:hover, .nav-dropdown button:hover { background: #eef4f8; }
.nav-dropdown form { margin: 0; }
.schedule { margin: 32px auto 0; width: calc(100% - 120px); max-width: 1550px; }
.calendar-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 20px; }
.calendar-toolbar h1 { font-size: 24px; font-weight: 400; line-height: 1.3; margin: 0; }
.date-navigation, .view-switch { display: flex; align-items: center; }
.date-navigation a, .view-switch button { color: #fff; background: #26384c; border: 1px solid #26384c; text-decoration: none; padding: 6px 10px; line-height: 21px; }
.date-navigation a:first-child, .view-switch button:first-child { border-radius: 3px 0 0 3px; }
.date-navigation a:nth-child(2), .view-switch button:last-child { border-radius: 0 3px 3px 0; }
.date-navigation .today-button { margin-left: 10px; background: #7e8790; border-color: #7e8790; border-radius: 3px; }
.view-switch { justify-self: end; }
.view-switch button { cursor: default; }
.view-switch button[aria-current] { background: #1b2939; }
.resource-heading { display: grid; grid-template-columns: 64px 1fr; height: 27px; background: #efefef; border: 1px solid #ddd; text-align: center; font-weight: 700; }
.resource-heading span + span { border-left: 1px solid #ddd; }
.time-slot { display: grid; grid-template-columns: 64px 1fr; height: 22px; }
.time-label { padding: 0 5px; text-align: right; border-left: 1px solid #ddd; border-right: 1px solid #ddd; border-bottom: 1px solid #eee; }
.appointment-space { background: #fff; border-right: 1px solid #ddd; border-bottom: 1px solid #eee; }
.time-slot:nth-child(2n) .appointment-space { border-bottom-color: #e5e5e5; }
.calendar-enhanced .calendar-toolbar { display: none; }
.calendar-enhanced .calendar { border: 0; }
.calendar-enhanced .fc { font-family: Arial, Helvetica, sans-serif; }
.calendar-enhanced .fc .fc-toolbar { margin-bottom: 20px; }
.calendar-enhanced .fc .fc-toolbar-title { font-size: 24px; font-weight: 400; }
.calendar-enhanced .fc .fc-button-primary { background: #26384c; border-color: #26384c; }
.calendar-enhanced .fc .fc-button-primary:not(:disabled).fc-button-active { background: #1b2939; border-color: #1b2939; }
.calendar-enhanced .fc .fc-timegrid-slot { height: 22px; }
.calendar-enhanced .fc .fc-timegrid-slot-lane { background: #fff; }
.calendar-enhanced .fc .fc-col-header-cell { background: #efefef; }
.calendar-enhanced.schedule-empty .fc .fc-col-header-cell { background: #fff; }
.calendar-enhanced.schedule-empty .fc .fc-col-header-cell-cushion { visibility: hidden; }
.patients-page { margin: 100px 48px 40px; }
.patients-page h1 { font-size: 24px; font-weight: 500; margin: 0 0 20px; }
.table-controls, .table-footer { display: flex; align-items: center; justify-content: space-between; margin: 12px 0; }
.table-controls select, .table-controls input { border: 1px solid #aaa; border-radius: 3px; padding: 5px; background: #fff; }
.table-scroll { width: 100%; overflow-x: auto; }
.patients-table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
.patients-table th, .patients-table td { border-top: 1px solid #dee2e6; padding: 8px 10px; }
.patients-table thead th { border-bottom: 2px solid #dee2e6; }
.patients-table tbody tr:nth-child(odd) { background: #f2f2f2; }
.patients-table .empty-table { text-align: center; padding: 15px; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid #144a71; outline-offset: 2px; }
@media (max-width: 900px) { .topbar { gap: 10px; padding: 8px 12px; flex-wrap: wrap; height: auto; min-height: 66px; } .primary-nav { flex-wrap: wrap; width: 100%; margin: 0; } .schedule { width: calc(100% - 24px); } .calendar-toolbar { grid-template-columns: 1fr auto; } .calendar-toolbar h1 { grid-column: 1 / -1; grid-row: 1; text-align: center; } .date-navigation { grid-column: 1; grid-row: 2; } .view-switch { grid-column: 2; grid-row: 2; } }
.patient-layout { display: grid; grid-template-columns: 258px minmax(0, 1fr); min-height: calc(100vh - 66px); }
.patient-menu-icon { color: #8a949d; font-size: 19px; }
.top-patient-name { color: #e84252; font-size: 13px; white-space: nowrap; }
.appointment-picker { width: 270px; height: 38px; padding: 5px 8px; border: 1px solid #e84252; background: #fff; color: #444; font-size: 13px; }
.print-control { padding: 7px 0; border: 0; background: transparent; color: #222; white-space: nowrap; font-size: 13px; cursor: pointer; }
.primary-nav span { padding: 9px 3px; color: #333; }
.patient-sidebar { color: #fff; background: #1b97b8; padding: 8px 0 24px; }
.patient-sidebar-header { margin: 0 18px 22px; padding: 22px 10px 16px; background: #00486e; text-align: center; }
.patient-sidebar-header strong { display: block; font-size: 19px; font-weight: 500; }
.patient-sidebar-header small { font-size: 13px; font-weight: 400; }
.patient-avatar { display: grid; place-items: center; width: 120px; height: 120px; margin: 14px auto; border: 3px solid #fff; border-radius: 50%; background: #d7e8eb; color: #00486e; font-size: 32px; }
.patient-sidebar h2 { margin: 16px 14px 7px; font-size: 17px; font-weight: 500; }
.surgery-list { margin: 0 18px; border-radius: 3px; overflow: hidden; background: #fff; }
.surgery-list a { display: block; padding: 8px 10px; border-bottom: 1px solid #d9dfe3; color: #273f53; text-decoration: none; font-size: 12px; }
.surgery-list a:hover, .surgery-list a[aria-current] { background: #f8f9d7; }
.surgery-list strong, .surgery-list span { display: block; }
.surgery-list span { margin-top: 4px; color: #333; line-height: 1.35; }
.patient-summary { margin: 0 12px 18px; padding: 8px 10px; background: #fff; color: #333; font-size: 13px; }
.patient-allergies { background: #cd4b4b; color: #fff; }
.patient-sidebar nav a { display: block; padding: 8px 28px 8px 12px; color: #fff; text-align: right; text-decoration: none; }
.patient-sidebar nav a:hover, .patient-sidebar nav a[aria-current] { color: #333; background: #fff; }
.patient-main { min-width: 0; padding: 22px 24px 80px; }
.preview-note { margin: 0 0 12px; color: #536270; font-size: 12px; }
.save-status { min-height: 20px; margin-bottom: 6px; color: #1c6846; font-size: 12px; }
.patient-appointment { min-width: 0; border: 1px solid #ddd; padding: 10px 14px 18px; }
.patient-appointment > legend { padding: 0 7px; color: #333; font-size: 16px; }
.patient-tabs { display: flex; flex-wrap: wrap; border-bottom: 1px solid #ddd; }
.patient-tabs a { padding: 9px 12px; border: 1px solid #fff; border-radius: 4px 4px 0 0; background: #00486e; color: #fff; font-size: 12px; text-decoration: none; }
.patient-tabs a[aria-current] { border-color: #ddd #ddd #fff; background: #fff; color: #333; font-weight: 600; }
.patient-tabs a:hover { background: #f4f8fa; color: #00486e; }
.patient-tab-content { padding: 18px 5px; }
.patient-tab-content h1 { margin: 0 0 18px; font-size: 18px; font-weight: 500; }
.patient-fields { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
.patient-field-group { width: calc(100% * var(--field-span, 12) / 12 - 12px); min-width: 0; margin: 0 0 12px; padding: 12px; border: 1px solid #ddd; }
.patient-field-group legend { padding: 0 5px; font-size: 16px; }
.patient-field { display: flex; flex-direction: column; gap: 4px; width: calc(100% * var(--field-span, 3) / 12 - 12px); min-width: 125px; font-size: 13px; }
.patient-field input, .patient-field select, .patient-field textarea { width: 100%; min-height: 34px; padding: 5px 8px; border: 1px solid #ced4da; border-radius: 3px; background: #f8f9fa; }
.patient-field textarea { min-height: 88px; }
.patient-checkbox { flex-direction: row; align-items: center; }
.patient-checkbox input { width: auto; min-height: auto; }
.patient-field-break { flex-basis: 100%; }
.patient-diagram { width: 100%; min-width: 0; margin: 0 0 12px; padding: 10px; border: 1px solid #ddd; }
.patient-diagram h2 { margin: 0 0 8px; font-size: 16px; font-weight: 400; }
.patient-diagram-scroll { max-width: 100%; overflow-x: auto; }
.patient-diagram-canvas { position: relative; }
.patient-diagram-canvas > img { display: block; max-width: none; height: auto; }
.patient-diagram-point { position: absolute; z-index: 1; display: block; line-height: 1; }
.patient-diagram-point input[type="checkbox"] { width: 16px; height: 16px; margin: 0; cursor: pointer; }
.patient-diagram-point input[type="text"] { width: 45px; height: 25px; padding: 2px 4px; border: 1px solid #bbb; background: #fff; }
.patient-topography-link img { display: block; max-width: 100%; height: auto; border: 6px solid #efefef; }
.patient-field-label { width: 100%; font-weight: 600; }
.patient-field-table { width: 100%; overflow-x: auto; margin: 8px 0 16px; }
.patient-field-table h2 { margin: 0 0 8px; font-size: 16px; }
.patient-field-table-row { display: grid; grid-template-columns: repeat(var(--column-count), minmax(150px, 1fr)); border-top: 1px solid #ddd; min-width: max-content; }
.patient-field-table-row:last-child { border-bottom: 1px solid #ddd; }
.patient-field-table-heading, .patient-field-table-cell { padding: 8px; border-left: 1px solid #ddd; }
.patient-field-table-heading:last-child, .patient-field-table-cell:last-child { border-right: 1px solid #ddd; }
.patient-field-table-cell .patient-field { width: 100%; min-width: 0; }
.patient-module { width: calc(100% * var(--field-span, 12) / 12 - 12px); min-width: 0; padding: 8px; border: 1px solid #d9e1e6; }
.patient-attachments-module { width: 100%; }
.patient-module h2 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.patient-module p { margin: 0; color: #63727d; font-size: 12px; }
.patient-attachment-table { width: 100%; margin: 10px 0; border-collapse: collapse; font-size: 12px; }
.patient-attachment-table th, .patient-attachment-table td { padding: 7px 8px; border-bottom: 1px solid #d9e1e6; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.patient-attachment-table th { background: #eef3f7; }
.patient-notes form { display: grid; gap: 8px; margin-bottom: 18px; }
.patient-notes textarea { min-height: 100px; padding: 8px; border: 1px solid #ced4da; }
.patient-notes button { justify-self: start; padding: 7px 14px; border: 0; border-radius: 3px; color: #fff; background: #00486e; cursor: pointer; }
.patient-note { padding: 12px 0; border-top: 1px solid #d9e1e6; }
.patient-note time { margin-left: 8px; color: #63727d; font-size: 12px; }
.patient-note p { margin-top: 6px; white-space: pre-wrap; color: #222; font-size: 13px; }
.workflow-page { padding: 24px 14px 60px; }
.workflow-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.workflow-heading h1 { margin: 0; font-size: 23px; font-weight: 500; }
.workflow-heading form { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; }
.workflow-heading label { display: grid; gap: 2px; font-size: 12px; }
.workflow-heading input { padding: 6px; border: 1px solid #bac6d0; }
.workflow-heading button { padding: 7px 12px; border: 0; color: #fff; background: #00486e; cursor: pointer; }
.workflow-lanes { display: grid; grid-template-columns: repeat(var(--lane-count), minmax(210px, 1fr)); overflow-x: auto; border-top: 1px solid #ddd; }
.workflow-lane { min-height: 600px; padding: 5px; border-right: 1px dotted #ccc; }
.workflow-lane h2 { display: grid; place-items: center; min-height: 60px; margin: 0 0 7px; font-size: 13px; font-weight: 700; text-align: center; }
.workflow-card { margin: 2px 0; padding: 13px; border: 1px dotted #333; border-left: 5px solid navy; border-radius: 5px; background: aliceblue; font-size: 13px; }
.workflow-card a { color: #00486e; font-weight: 700; }
.workflow-card time { display: block; margin-top: 6px; font-size: 10px; }
.workflow-move { display: flex; align-items: end; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.workflow-move label { display: grid; gap: 2px; font-size: 11px; }
.workflow-move select { max-width: 150px; padding: 3px; border: 1px solid #bac6d0; }
.workflow-move button { padding: 4px 7px; border: 0; background: #00486e; color: #fff; cursor: pointer; }
.workflow-status { margin: 0 0 10px; color: #1c6846; }
.patient-portal-header { display: flex; align-items: center; gap: 28px; min-height: 66px; padding: 6px 30px; border-bottom: 2px solid #ddd; background: #f8f9fa; }
.patient-portal-header img { width: 140px; max-height: 50px; object-fit: contain; }
.patient-portal-header nav a { color: #00486e; text-decoration: none; }
.patient-portal-header form { margin-left: auto; }
.patient-portal-header button { padding: 7px 11px; border: 1px solid #bac6d0; background: #fff; cursor: pointer; }
.patient-dashboard, .patient-self-form { width: min(1140px, calc(100% - 32px)); margin: 42px auto 70px; }
.patient-welcome { margin: 0 0 40px; text-align: center; font-size: 18px; }
.patient-dashboard section { margin-bottom: 55px; }
.patient-dashboard h1, .patient-self-form h1 { font-size: 25px; font-weight: 500; }
.patient-form-link { display: inline-block; padding: 7px 11px; border-radius: 3px; background: #28a745; color: #fff; text-decoration: none; }
.patient-self-form > a { color: #00486e; }
.patient-self-form .patient-tabs { margin-top: 25px; }
.patient-bottom-bar { position: fixed; z-index: 5; bottom: 0; left: 0; right: 0; display: flex; align-items: center; min-height: 52px; padding: 6px 16px; border-top: 1px solid #ddd; background: #f9f9f9; color: #333; font-size: 12px; }
.patient-bottom-bar a { margin: 0 auto; padding: 9px 16px; border-radius: 3px; background: #1caf50; color: #fff; text-decoration: none; font-size: 14px; }
@media (max-width: 1400px) { .topbar { gap: 10px; padding: 0 16px; } .appointment-picker { width: 230px; } .patient-search input { width: 155px; } .primary-nav { gap: 6px; } }
@media (max-width: 800px) { .patient-layout { grid-template-columns: 1fr; } .patient-sidebar { min-height: auto; } .patient-sidebar nav { display: flex; flex-wrap: wrap; } .patient-sidebar nav a { text-align: left; } .patient-main { padding: 15px; } }
@media print { .topbar, .patient-sidebar, .patient-bottom-bar, .preview-note, .save-status, .portal-loader { display: none !important; } .patient-layout { display: block; } .patient-main { padding: 0; } .patient-appointment { border: 0; } .patient-tabs { display: none; } .patient-field input, .patient-field select, .patient-field textarea { border-color: #aaa; background: #fff; } }
.login-page { width: min(400px, calc(100% - 32px)); margin: 10vh auto; padding: 30px; border: 1px solid #d8dfe5; border-radius: 5px; box-shadow: 0 8px 25px #0000000d; }
.login-page img { display: block; width: 190px; margin: 0 auto 24px; }
.login-page h1 { margin: 0 0 20px; font-size: 24px; font-weight: 500; text-align: center; }
.login-page form, .login-page label { display: flex; flex-direction: column; gap: 6px; }
.login-page form { gap: 16px; }
.login-page input { width: 100%; padding: 9px 10px; border: 1px solid #bac6d0; border-radius: 3px; }
.login-page button { padding: 10px; border: 0; border-radius: 3px; background: #00486e; color: #fff; cursor: pointer; }
.login-page [role=alert] { margin: 0; color: #b72929; }
.reports-page { width: min(1240px, calc(100% - 32px)); margin: 84px auto; }
.reports-page h1 { margin: 0 0 25px; font-size: 25px; font-weight: 500; }
.reports-form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 18px; background: #f8f9fa; border: 1px solid #e0e5e9; }
.reports-form label { display: grid; gap: 5px; min-width: 165px; font-size: 13px; }
.reports-form label:first-child { min-width: min(360px, 100%); flex: 1; }
.reports-form select, .reports-form input { width: 100%; min-height: 38px; padding: 7px 9px; border: 1px solid #bac6d0; border-radius: 3px; background: #fff; }
.reports-form button { min-height: 38px; padding: 7px 18px; border: 0; border-radius: 3px; background: #00486e; color: #fff; cursor: pointer; }
