:root { --teal: #0B4F5C; --teal-dark: #083B45; --teal-soft: #E6F1F3; --orange: #FF8A3D; --orange-soft: #FFF1E6; --text: #1C2B2F; --muted: #5F7378; --line: #D7E2E4; --bg: #F4F7F8; --ready: #2E8B57; --warn: #D98A00; --attention: #C2410C; }
* { box-sizing: border-box; }
body { margin: 0; font: 14px/1.45 "Segoe UI", system-ui, sans-serif; color: var(--text); background: var(--bg); }
.muted { color: var(--muted); }
.btn-link { background: none; border: 0; color: var(--teal); cursor: pointer; font: inherit; font-weight: 600; letter-spacing: .02em; padding: .3rem 0; text-decoration: none; }
.btn-primary { background: var(--teal); border: 1px solid var(--teal); color: #fff; border-radius: 4px; padding: .5rem 1rem; font: inherit; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-primary[disabled] { opacity: .45; cursor: not-allowed; }

/* Login and Updraft ID */
.soar-auth, .updraft-auth { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 16px; background: linear-gradient(160deg, var(--teal) 0%, #127080 55%, var(--orange) 140%); }
.updraft-auth { background: #EEF3F4; }
.auth-card { width: min(380px, 100%); background: #fff; border-radius: 10px; padding: 28px 28px 20px; box-shadow: 0 18px 50px rgba(8, 59, 69, .25); display: grid; gap: 10px; }
.auth-card form, .auth-card form > div { display: grid; gap: 8px; }
.auth-card label { font-size: 13px; color: var(--muted); font-weight: 600; }
.auth-card input { font: inherit; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 4px; width: 100%; }
.auth-card input:focus { outline: 2px solid var(--orange); border-color: transparent; }
.auth-card h1 { margin: 6px 0 0; font-size: 22px; }
.auth-brand { display: flex; align-items: center; gap: 10px; color: var(--teal); font-size: 22px; margin-bottom: 6px; }
.auth-brand b { font-weight: 300; }
.auth-error { background: #FDECEA; color: #A12A1B; border-radius: 4px; padding: 8px 10px; margin: 0; }
.required-marker { color: #A12A1B; font-size: 12px; }
.password-row { display: flex; gap: 8px; align-items: center; }
.password-row input { flex: 1; min-width: 0; }
.auth-foot { color: rgba(255, 255, 255, .85); font-size: 12px; margin-top: 14px; }
[hidden] { display: none !important; }

/* App shell */
.environmentBanner { background: #FFE58F; color: #5C4400; text-align: center; font-size: 12px; font-weight: 600; padding: 2px 8px; }
.navbar { display: flex; align-items: center; gap: 12px; background: var(--teal); color: #fff; padding: 0 16px; min-height: 48px; flex-wrap: wrap; }
.navbar ul { list-style: none; margin: 0; padding: 0; }
.navbar .nav { display: flex; align-items: center; }
.navbar .navbar-right { margin-left: auto; }
.navbar-brand { display: flex; align-items: center; gap: 6px; color: #fff; font-weight: 700; font-size: 18px; text-decoration: none; margin-right: 8px; }
.navbar .dropdown { position: relative; }
.navbar .dropdown-toggle { display: flex; align-items: center; gap: 6px; color: #fff; text-decoration: none; padding: 14px 12px; }
.navbar .dropdown-toggle:hover { background: var(--teal-dark); }
.caret { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid var(--orange); }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 220px; background: #fff; color: var(--text); border: 1px solid var(--line); border-radius: 0 0 6px 6px; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); padding: 6px 0; z-index: 50; }
.navbar-right .dropdown-menu { left: auto; right: 0; }
.dropdown-menu.show { display: block; }
.dropdown-menu a, .dropdown-menu .btn-link { display: block; padding: 7px 16px; color: var(--text); text-decoration: none; width: 100%; text-align: left; font-weight: 400; }
.dropdown-menu a:hover { background: var(--teal-soft); }
.searchField input { font: inherit; border: 0; border-radius: 4px; padding: .4rem .7rem; width: 220px; }
.currentLocationName { display: flex; flex-direction: column; line-height: 1.2; font-weight: 600; }
.currentRole, .roleName { display: block; font-size: 11px; font-weight: 400; opacity: .8; }
.locationDropdownMenu { max-height: 70vh; overflow: auto; }
.location-search-wrapper { padding: 6px 10px; }
.location-search-wrapper input { width: 100%; font: inherit; padding: .4rem .6rem; border: 1px solid var(--line); border-radius: 4px; }
a.locationNavigationLink .locationName { display: block; font-weight: 600; }
a.locationNavigationLink.current { background: var(--orange-soft); }
.page-content { padding: 20px 24px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 18px 22px; }
h1 { font-size: 22px; font-weight: 600; margin: 0 0 14px; }

/* Dashboard */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.tile { display: grid; gap: 4px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--orange); border-radius: 8px; padding: 14px 16px; text-decoration: none; color: var(--text); }
.tile.muted { border-top-color: var(--line); }
.tile-title { font-weight: 600; }
.tile-count { font-size: 32px; font-weight: 700; color: var(--teal); }
.tile-sub { font-size: 12px; color: var(--muted); }

/* Unsent Claims */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.warn-icon { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: var(--warn); color: #fff; font-size: 12px; font-weight: 700; vertical-align: middle; }
.claim-state-key { display: flex; gap: 14px; margin: 4px 0 12px; font-size: 12px; font-weight: 700; }
.claim-state-key span { padding-left: 14px; border-left: 4px solid; }
.claim-state-key .claim-state-ready { border-color: var(--ready); }
.claim-state-key .claim-state-warning { border-color: var(--warn); }
.claim-state-key .claim-state-needs-attention { border-color: var(--attention); }
.unsent-claims { overflow-x: auto; }
table.gridtable { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); }
.gridtable th { text-align: left; background: var(--teal-soft); color: var(--teal-dark); font-weight: 600; padding: 8px; white-space: nowrap; }
.gridtable td { padding: 8px; border-top: 1px solid var(--line); }
.table-striped tbody tr:nth-child(even) { background: #FAFCFC; }
.table-hover tbody tr.unsent-claim-row:hover { background: var(--orange-soft); cursor: pointer; }
tr.claim-state-ready td:first-child { box-shadow: inset 4px 0 var(--ready); }
tr.claim-state-warning td:first-child { box-shadow: inset 4px 0 var(--warn); }
tr.claim-state-needs-attention td:first-child { box-shadow: inset 4px 0 var(--attention); }
.go-to-ledger { font-size: 12px; color: var(--teal); margin-left: 6px; }
.gridtable-td-totalAmount { text-align: right; white-space: nowrap; }
.flash { position: fixed; bottom: 20px; right: 20px; background: var(--teal); color: #fff; padding: 10px 16px; border-radius: 6px; z-index: 200; }
.flash.bad { background: #A12A1B; }

/* Claim window */
.ui-dialog { padding: 0; border-radius: 8px; overflow: hidden; }
.ui-dialog .ui-dialog-titlebar { background: var(--teal); color: #fff; border: 0; border-radius: 0; }
.ui-dialog .ui-dialog-content { padding: 10px 14px; }
#claimsMain { display: flex; flex-direction: column; }
#claimsMain .claim-tabs { flex: 1; border: 0; }
#claimsMain .ui-tabs-nav { background: none; border: 0; border-bottom: 1px solid var(--line); }
#claimsMain .ui-tabs-nav li.hidden { display: none; }
#claimsMain .ui-tabs-nav .ui-tabs-active { background: #fff; border-color: var(--line); }
#claimsMain .ui-tabs-nav .ui-tabs-active a { color: var(--teal); }
.claim-buttons { display: flex; gap: 8px; justify-content: flex-end; padding-top: 10px; border-top: 1px solid var(--line); }
.btn { font: inherit; border-radius: 4px; padding: .4rem .8rem; cursor: pointer; border: 1px solid var(--line); background: #fff; color: var(--text); }
.btn.btn-primary { background: var(--teal); border-color: var(--teal); color: #fff; }
.btn.btn-danger { background: #fff; border-color: #C0392B; color: #C0392B; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.attachment-buttons { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.attachment-buttons .dropdown { position: relative; }
table.clinicalNotesList { width: 520px; max-height: 300px; overflow: auto; border-collapse: collapse; }
table.clinicalNotesList.show { display: table; }
table.clinicalNotesList td { padding: 8px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
table.clinicalNotesList td:hover { background: var(--teal-soft); }
.clinicalNotesList span { margin-right: 6px; }
.clinicalNotesList .show-details { color: var(--teal); font-size: 12px; }
.clinicalNotesList .created { font-weight: 600; }
.attachments-warning { background: #FFF8DB; border: 1px solid #F0D27A; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; }
.attachments-warning p { margin: 0 0 6px; }
.required-attachments-types-table td { padding: 3px 10px 3px 0; }
.attachment-types-cell { font-weight: 600; }
table.attachments-table-head, table.attachments-table-body { width: 100%; border-collapse: collapse; table-layout: fixed; }
.attachments-table-head th, .attachments-table-body td { padding: 6px 8px; text-align: left; }
.attachments-table-head th { background: var(--teal-soft); color: var(--teal-dark); }
.attachments-table-head th:first-child, .attachments-table-body td:first-child { width: 36px; }
.attachments-table-body td { border-bottom: 1px solid var(--line); }
.attachments-table-body td.check { position: relative; }
.attachments-table-body td.check input { position: absolute; opacity: 0; }
.attachments-table-body td.check label { display: block; width: 16px; height: 16px; border: 2px solid var(--teal); border-radius: 3px; cursor: pointer; }
.attachments-table-body td.check input:checked + label { background: var(--orange); border-color: var(--orange); }
.attachments-table-body select { font: inherit; max-width: 100%; }
.procedures-grid .amount { text-align: right; }
.total-charges { text-align: right; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }
#unusualServicesRemarks { width: 100%; font: inherit; }
.add-from-imaging { padding: 0 !important; }
#rciClaimAttachments { width: 100%; height: 100%; border: 0; display: block; }

/* Claim window: General, Claim Info, Status/Notes, Add Perio Exam, Add from Document Manager */
.form-row { display: grid; grid-template-columns: 170px 1fr; align-items: center; gap: 10px; margin-bottom: 10px; }
.form-row input, .form-row select { font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-radius: 4px; max-width: 360px; }
.ui-combobox { display: inline-flex; max-width: 360px; }
.ui-combobox-input { font: inherit; padding: .35rem .5rem; border: 1px solid var(--line); border-right: 0; border-radius: 4px 0 0 4px; flex: 1; min-width: 200px; background: #fff; cursor: pointer; }
.ui-combobox-toggle { display: flex; align-items: center; padding: 0 10px; border: 1px solid var(--line); border-radius: 0 4px 4px 0; color: var(--teal); text-decoration: none; background: var(--teal-soft); }
#claimInfoTab dl.facts { margin-bottom: 16px; }
.notes-toolbar { margin-bottom: 10px; }
table.fixed-layout { table-layout: fixed; width: 100%; border-collapse: collapse; background: #fff; }
table.fixed-layout th { text-align: left; background: var(--teal-soft); padding: 6px 8px; }
table.fixed-layout th:nth-child(1), table.fixed-layout th:nth-child(2), table.fixed-layout th:nth-child(3) { width: 110px; }
table.fixed-layout td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.note-editor { display: flex; gap: 6px; align-items: flex-start; }
.note-editor textarea { flex: 1; font: inherit; }
ul.examsList a.examName { white-space: nowrap; }
.doc-manager-picker { display: grid; gap: 8px; }
.uploadedImages.file { display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--line); border-radius: 6px; }
.uploadedImages.file input.areaCheck { position: absolute; opacity: 0; }
label.areaCheckLabel { width: 18px; height: 18px; border: 2px solid var(--teal); border-radius: 3px; cursor: pointer; }
input.areaCheck:checked + label.areaCheckLabel { background: var(--teal); box-shadow: inset 0 0 0 3px #fff; }

/* Patient search and the patient pages */
.searchField { position: relative; }
.patientSearchResults { min-width: 300px; }
.patientSearchResults a { display: grid !important; }
.patientSearchResults .empty { padding: 7px 16px; }
body.patientHeaderIsShown .page-content { padding-top: 0; }
.patient-header-next-gen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; background: #fff; border-bottom: 3px solid var(--orange); margin: 0 -24px 18px; padding: 10px 24px; }
.patient-name a { font-size: 20px; font-weight: 600; color: var(--teal); text-decoration: none; }
.patient-facts { display: flex; flex-wrap: wrap; gap: 4px 8px; margin: 0; }
.patient-facts dt { color: var(--muted); }
.patient-facts dd { margin: 0 12px 0 0; font-weight: 600; }
.patient-quick-links { list-style: none; margin: 0 0 0 auto; padding: 0; }
#patientHeaderQuickLinksContainerIcons { display: flex; gap: 6px; }
#patientHeaderQuickLinksContainerIcons a { padding: 4px 10px; border-radius: 4px; background: var(--teal-soft); color: var(--teal); text-decoration: none; font-weight: 600; }
.ledger-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 12px; }
.ledger-view { margin-left: auto; color: var(--muted); }
table.aging-balance { width: 100%; border-collapse: collapse; background: #fff; margin-bottom: 14px; border: 1px solid var(--line); }
table.aging-balance th, table.aging-balance td { padding: 6px 8px; text-align: right; }
table.aging-balance th { background: var(--teal-soft); font-weight: 600; font-size: 12px; }
.ledger-grid td.amount { text-align: right; white-space: nowrap; }
tr.ledger-claim td { color: var(--muted); font-style: italic; }
.edit-patient-page .patient-info-tabs { display: flex; gap: 0; border: 0; background: none; }
.edit-patient-page .patient-info-tabs > ul { display: block; width: 190px; flex: none; padding: 0; border: 0; background: none; }
.edit-patient-page .patient-info-tabs > ul li { float: none; display: block; width: 100%; margin: 0 0 4px; }
.edit-patient-page .patient-info-tabs .ui-tabs-nav .ui-tabs-anchor { float: none; display: block; }
.edit-patient-page .patient-info-tabs > div { flex: 1; background: #fff; border: 1px solid var(--line); }
.phones { display: grid; gap: 6px; margin: 10px 0; }
.phone-row { display: flex; gap: 6px; }
.phone-row input, .phone-row select { font: inherit; padding: .3rem .5rem; border: 1px solid var(--line); border-radius: 4px; }
.edit-buttons { display: flex; gap: 8px; margin-top: 14px; }
.document-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.document-tile { display: grid; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 10px; }
.document-tile .thumb { display: flex; align-items: center; justify-content: center; height: 110px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.document-tile .thumb img { max-width: 100%; max-height: 100%; }
.file-type { font-weight: 700; color: var(--attention); }
.document-name { font-weight: 600; color: var(--teal); overflow-wrap: anywhere; }
.document-count { color: var(--muted); }
.upload-form .bad { color: #A12A1B; }

/* Schedule day view */
.scheduleHeader { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.scheduleHeader h1 { margin: 0 8px; }
.scheduleHeader button { font: inherit; border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: .3rem .7rem; cursor: pointer; }
.schedule-grid { overflow: auto; max-height: calc(100vh - 170px); background: #fff; border: 1px solid var(--line); }
.resourceListHeader, .resourceListBody { display: grid; width: max-content; }
.resourceListHeader { position: sticky; top: 0; z-index: 2; background: var(--teal-soft); }
a.resourceListHeaderContent { padding: 8px; font-weight: 600; color: var(--teal-dark); text-decoration: none; border-left: 1px solid var(--line); }
.timeGutter, .resourceColumn { position: relative; }
.resourceColumn { border-left: 1px solid var(--line); background: repeating-linear-gradient(#fff 0 59px, var(--line) 59px 60px); }
.hour { position: absolute; right: 6px; font-size: 11px; color: var(--muted); }
.event.appointmentDayView { position: absolute; z-index: 1; left: 30px; right: 4px; overflow: hidden; border-radius: 4px; padding: 2px 6px; font-size: 12px; background: var(--orange-soft); border-left: 3px solid var(--orange); }
.event.appointmentDayView.providerBlock { left: 2px; width: 24px; right: auto; padding: 4px 2px; background: var(--teal); color: #fff; border: 0; writing-mode: vertical-rl; }
.event.appointmentDayView.blockEvent { z-index: 0; background: repeating-linear-gradient(45deg, #EEF3F4 0 6px, #fff 6px 12px); border-left-color: var(--line); color: var(--muted); }
.appointment-name { display: block; font-weight: 600; }
.appointment-reason { display: block; color: var(--muted); }
.ui-combobox-toggle::after { content: "\25BE"; }
.attachments-table-body .ui-combobox-input { min-width: 0; width: 130px; flex: none; }
.all-warnings { background: var(--orange-soft); border: 1px solid var(--orange); border-radius: 6px; padding: 4px 12px; margin: 10px 0; }
