/* Shared by daily care work screens. Clinical statuses keep text as well as color. */
html[data-staff-theme] .staff-theme-toggle{font:inherit;font-size:14px;min-height:44px;padding:9px 12px;border:1px solid #6652a5;border-radius:10px;background:#fff;color:#59469b;cursor:pointer;white-space:nowrap}
html[data-staff-theme] .staff-theme-toggle:focus-visible{outline:3px solid #826bea;outline-offset:3px}
html[data-staff-theme="dark"]{color-scheme:dark}
html[data-staff-theme="dark"] body{background:#101624;color:#e5eaf4}
html[data-staff-theme="dark"] body :is(header,main,.panel,.progress>div,.filter-panel,.calculation-dialog,.clinical-average){background:#1a2233;color:#e5eaf4;border-color:#43516a;box-shadow:none}
html[data-staff-theme="dark"] body :is(h1,h2,h3,.brand,.heart,.eyebrow,.progress strong,.summary,.patient-count,.clinical-help-label,.filter-control label){color:#e5eaf4}
html[data-staff-theme="dark"] body :is(.muted,.label,.intro,.worklist-note,.capacity-help,.empty,th){color:#bfcbe0}
html[data-staff-theme="dark"] body :is(a,header a){color:#c9b9ff}
html[data-staff-theme="dark"] body a.primary-link{color:white}
html[data-staff-theme="dark"] body .patient{color:#c9b9ff}
html[data-staff-theme="dark"] body :is(.bulk-toolbar,[role="status"]){background:#28334a;color:#e5eaf4}
html[data-staff-theme="dark"] body tbody tr:hover{background:#242f43}
html[data-staff-theme="dark"] body .daily-status{background:#344258;color:#e5eaf4}
html[data-staff-theme="dark"] body .daily-status.done{background:#184735;color:#b5f1cd}
html[data-staff-theme="dark"] body :is(.capacity-panel,.patient-list-panel,.operator-worklist) td:nth-child(n)::before{color:#bfcbe0}
html[data-staff-theme="dark"] body :is(input,select,textarea){background:#101827;color:#edf2ff;border-color:#65738d}
html[data-staff-theme="dark"] body :is(th,.summary,.patient-count){background:#242f43}
html[data-staff-theme="dark"] body :is(td,th,.activity-entry,.clinical-average){border-color:#43516a}
html[data-staff-theme="dark"] body :is(button.secondary,.calculation-help,.staff-theme-toggle,.report-pagination a,nav[aria-label="Assignment filter"] a){background:#28334a;color:#e1d8ff;border-color:#7887a3}
html[data-staff-theme="dark"] body button{color:#fff}
html[data-staff-theme="dark"] body .success{background:#193d32;color:#b7f2d5}
html[data-staff-theme="dark"] body .done{color:#a0e9c4}
html[data-staff-theme="dark"] body .skip-controls summary{color:#c9b9ff}
html[data-staff-theme="dark"] body .skip-reason{background:#28334a;color:#e5eaf4;border-color:#65738d}
html[data-staff-theme="dark"] body :is(.bp-status.status-normal,.status-normal){background:#184735;color:#b5f1cd}
html[data-staff-theme="dark"] body :is(.bp-status.status-elevated,.status-elevated){background:#514315;color:#ffe795}
html[data-staff-theme="dark"] body :is(.bp-status.status-high,.status-high){background:#60302b;color:#ffcfbd}
html[data-staff-theme="dark"] body :is(.bp-status.status-critical,.status-critical){background:#692331;color:#ffe0e6}
html[data-staff-theme="dark"] body .status-nodata{background:#344258;color:#e5eaf4}
html[data-staff-theme="dark"] body .graph text{fill:#bfcbe0}
html[data-staff-theme="dark"] body .graph line{stroke:#43516a}
html[data-staff-theme="dark"] body .graph polyline[stroke="#ac4138"],html[data-staff-theme="dark"] body .graph circle[fill="#ac4138"]{stroke:#ff9c90}
html[data-staff-theme="dark"] body .graph circle[fill="#ac4138"]{fill:#ff9c90}
html[data-staff-theme="dark"] body .graph polyline[stroke="#316fa5"],html[data-staff-theme="dark"] body .graph circle[fill="#316fa5"]{stroke:#91c9ff}
html[data-staff-theme="dark"] body .graph circle[fill="#316fa5"]{fill:#91c9ff}
html[data-staff-theme="dark"] body .legend .red{color:#ff9c90}html[data-staff-theme="dark"] body .legend .blue{color:#91c9ff}
html[data-staff-theme="dark"] body :is(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid #b8a5ff;outline-offset:3px}
@media print{html[data-staff-theme="dark"] body,html[data-staff-theme="dark"] body :is(header,main,.panel,th,td,.progress>div,.muted,a,h1,h2,h3){background:white;color:black}html[data-staff-theme] .staff-theme-toggle{display:none}}

html[data-staff-theme="dark"] body .bp-status.status-low{background:#163b61;color:#c1e4ff}

/* Legacy staff surfaces share the same preference and explicit dark palette. */
html[data-staff-theme="dark"] body.legacy-staff{
 --card-background:#1a2233;--text-color:#e5eaf4;--text-dark:#e5eaf4;--text-light:#bfcbe0;
 --border-color:#43516a;--bg-light:#242f43;--light-bg:#242f43;
 background:#101624;color:#e5eaf4;
}
html[data-staff-theme="dark"] body.legacy-staff :is(.container,.login-container,.register-container,.header,.top-navbar,.navbar-collapsible,.patient-panel,.main-panel,.card,.summary-card,.modal-content,.modal-body,.modal-header,.modal-overlay>.modal,.side-panel,.side-content,.billing-summary,.billing-controls,.billing-table-container,.clinic-health-summary,.guides-content,.guides-sidebar,.doc-section,.stat-card,.chart-container,.chart-wrapper,.integration-panel,.overview-column,.overview-card,.analytics-section,.table-header,.table-content,.readings-table,.time-log-history,.archives-container,.details-column,.details-summary-card,.details-data-container){background:#1a2233;color:#e5eaf4;border-color:#43516a;box-shadow:none}
html[data-staff-theme="dark"] body.legacy-staff :is(h1,h2,h3,h4,h5,h6,label,.patient-name,.patient-info h3,.metric-value,.big-number,.count,.name,.ov-name,.summary-header,.navbar-brand,.nav-link,.welcome-message,.card-title,.chart-title,.clinic-name,.form-title,.member-name){color:#e5eaf4}
html[data-staff-theme="dark"] body.legacy-staff :is(.patient-id,.patient-meta,.metric-label,.time-log-meta,.time-log-staff,.no-logs,.overview-header,.ov-meta,.stat-label,.subtitle,.footer-links,.login-header p,.register-header p,.secondary,.info-note,.archives-instruction,.summary-top,.card-subtitle){color:#bfcbe0}
html[data-staff-theme="dark"] body.legacy-staff :is(.patient-item,.metric-card,.time-log-item,.timeline-item,.info-highlight,.notice,.search-container,.tab-container,.tab,.accordion-header,.accordion-content,.month-tab,.manager-patient-list,.manager-toggle-bar,.activity-option,.archive-item,.log-item,.details-summary-grid,.filter-indicator,.summary-avatar){background:#242f43;color:#e5eaf4;border-color:#43516a}
html[data-staff-theme="dark"] body.legacy-staff :is(.patient-item.active,.patient-item:hover,.tab.active,.activity-option.selected,.period-btn.active,.manager-toggle-btn.active,.nav-link.active,.guides-sidebar a.active){background:#3b355e;color:#f0eaff;border-color:#a08bd7}
html[data-staff-theme="dark"] body.legacy-staff :is(td,th,section,.form-section,.side-header,.modal-header,.patient-header){border-color:#43516a}
html[data-staff-theme="dark"] body.legacy-staff :is(.btn-secondary,.btn-edit,.action-btn,.act-btn,.period-btn,.manager-toggle-btn,.close-side,.close-info,.info-btn,.card-info-btn,.tab){background:#28334a;color:#e1d8ff;border-color:#7887a3}
html[data-staff-theme="dark"] body.legacy-staff :is(.alert-error,.alert-danger,.error-message,.status-no){background:#572632;color:#ffe0e6;border-color:#b76076}
html[data-staff-theme="dark"] body.legacy-staff :is(.alert-success,.status-yes,.metric-card.goal-met,.badge-active){background:#184735;color:#b5f1cd;border-color:#579477}
html[data-staff-theme="dark"] body.legacy-staff :is(.metric-card.goal-met .metric-value,.metric-card.goal-met .metric-label){color:#b5f1cd}
html[data-staff-theme="dark"] body.legacy-staff :is(.badge-inactive,.badge:not(.badge-active),.empty-state){background:#344258;color:#e5eaf4}
html[data-staff-theme="dark"] body.legacy-staff :is(.login-header h1,.register-header h1,.header h1){background:none;-webkit-text-fill-color:#e5eaf4;color:#e5eaf4}
html[data-staff-theme="dark"] body.legacy-staff :is(input,select,textarea)::placeholder{color:#aab8ce;opacity:1}
html[data-staff-theme] :is(.login-container,.register-container)>.staff-theme-toggle{display:block;margin:0 0 16px auto}
html[data-staff-theme] body.legacy-staff:has(.login-container){overflow-y:auto;padding-block:20px}
html[data-staff-theme] .navbar-user-area{flex-wrap:wrap;gap:10px}
@media(max-width:600px){html[data-staff-theme] .staff-theme-toggle{white-space:normal}html[data-staff-theme] :is(.login-container,.register-container){max-width:calc(100vw - 24px)}}
@media print{html[data-staff-theme="dark"] body.legacy-staff,html[data-staff-theme="dark"] body.legacy-staff :is(.container,.card,.summary-card,.patient-panel,.main-panel,.guides-content,.doc-section,.metric-card){background:white;color:black}}
html[data-staff-theme="dark"] body.legacy-staff{--success-color:#b5f1cd;--warning-color:#ffe795}
html[data-staff-theme="dark"] body.legacy-staff :is(#page-loader,.code-generator,.form-grid,.warning-box,.revenue-impact-container,.revenue-card,.separate-view-section,.model-option label){background:#242f43;color:#e5eaf4;border-color:#43516a}
html[data-staff-theme="dark"] body.legacy-staff :is(.doc-section code){background:#28334a;color:#ffb8ab}
html[data-staff-theme="dark"] body.legacy-staff :is(.code-generator p,.section-heading p,.card>p,.model-option-desc,.section-description,.legacy-muted){color:#bfcbe0}
html[data-staff-theme="dark"] body.legacy-staff .notice strong{color:#e1d8ff}
html[data-staff-theme="dark"] body.legacy-staff :is(.btn,.btn-submit,.btn-download,.btn-dash){background:#514187;color:#fff;border-color:#8a7aba}
html[data-staff-theme="dark"] body.legacy-staff :is(.btn-danger,.btn-delete,.danger-zone summary){background:#7b293b;color:#ffe0e6;border-color:#b76076}
html[data-staff-theme="dark"] body.legacy-staff :is(.btn-success,.btn-special){background:#184735;color:#b5f1cd;border-color:#579477}
html[data-staff-theme="dark"] body.legacy-staff :is(.btn-primary,.btn-info){background:#3b4f9c;color:#fff;border-color:#8496da}
body.staff-mfa-page{font:16px/1.5 system-ui,sans-serif;margin:0;padding:16px;background:#f5f5fb;color:#232339}
body.staff-mfa-page main{max-width:640px;margin:32px auto;padding:24px;background:white;border:1px solid #d4cfe4;border-radius:14px;overflow-wrap:anywhere}
body.staff-mfa-page label{display:block;font-weight:600}
body.staff-mfa-page :is(input,button){font:inherit;min-height:44px;padding:9px 12px;border:1px solid #65738d;border-radius:8px}
body.staff-mfa-page input:not([type=checkbox]){display:block;width:100%;margin:8px 0 16px}
body.staff-mfa-page input[type=checkbox]{min-height:0}
body.staff-mfa-page button{background:#514187;color:white;cursor:pointer}
body.staff-mfa-page .staff-theme-toggle{display:block;margin-top:24px}
body.staff-mfa-page li{margin:10px 0}
body.staff-mfa-page *{box-sizing:border-box}
/* Neutral inline colors in legacy-generated dialogs must follow the preference. */
html[data-staff-theme="dark"] body.legacy-staff :is([style*="color:#2c3e50"],[style*="color: #2c3e50"],[style*="color: #6c757d"],[style*="color:#777"],[style*="color: #777"],[style*="color:#999"],[style*="color: #999"],[style*="color: black"]){color:#bfcbe0!important}
html[data-staff-theme="dark"] body.legacy-staff :is(.val-critical,[style*="color: #e74c3c"],[style*="color:red"]){color:#ffb8ab!important}
html[data-staff-theme="dark"] body.legacy-staff :is([style*="background-color: #f0f2f5"],[style*="background: #f8f9fa"]){background:#242f43!important;color:#e5eaf4!important}
html[data-staff-theme="dark"] body.legacy-staff .overview-count{background:#344258;color:#e5eaf4}

/* Authentication continues the original app's gradient and rounded card style. */
body.staff-mfa-page{font-family:'Segoe UI',Tahoma,Geneva,Verdana,sans-serif;background:linear-gradient(135deg,#667eea,#764ba2);min-height:100vh}
body.staff-mfa-page main{border-radius:20px;padding:32px;box-shadow:0 8px 32px #0000001a}
body.staff-mfa-page h1{color:#554ea0;font-size:26px}
body.staff-mfa-page button{background:linear-gradient(135deg,#667eea,#764ba2);border-radius:10px;font-weight:600}
body.staff-mfa-page a{color:#59469b}.staff-auth-brand{font-size:24px;font-weight:750;margin-bottom:24px}.staff-auth-brand span{color:#764ba2}
@media(max-width:600px){body.staff-mfa-page main{padding:20px;margin:16px auto}}
html[data-staff-theme="dark"] body.legacy-staff :is(.table-wrap,.lifecycle-brand,.staff-auth-brand){background:transparent;color:#e5eaf4}
html[data-staff-theme="dark"] body.legacy-staff :is(.lifecycle-brand span,.staff-auth-brand span){color:#c9b9ff}
/* Keep the original dashboard navigation readable with the appearance control. */
#topNavbar .navbar-brand{flex-shrink:0;white-space:nowrap}
@media(min-width:821px) and (max-width:1450px){
 body:has(#topNavbar){padding-top:140px}
 #topNavbar{height:auto;min-height:110px;gap:20px;padding:10px 24px}
 #topNavbar .navbar-collapsible{flex-direction:column;align-items:flex-end;gap:6px;min-width:0}
 #topNavbar .nav-link{padding:10px 12px;font-size:14px;white-space:nowrap}
 #topNavbar .navbar-user-area{justify-content:flex-end}
}

body.staff-mfa-page .mfa-enrollment-qr{display:block;width:320px;max-width:100%;height:auto;margin:20px auto;background:#fff;border-radius:0;image-rendering:pixelated}
body.staff-mfa-page details{margin:20px 0;padding:12px;border:1px solid #65738d;border-radius:10px}
body.staff-mfa-page summary{cursor:pointer;font-weight:600;min-height:32px}
body.staff-mfa-page details code{user-select:all}
/* Directory filters need their own surfaces: generic white button text cannot
   be paired with the legacy light-gray backgrounds in dark mode. */
html[data-staff-theme="dark"] body.legacy-staff .filter-btn{background:#28334a;color:#edf2ff;border-color:#65738d}
html[data-staff-theme="dark"] body.legacy-staff .filter-btn:hover{background:#344258;border-color:#a08bd7}
html[data-staff-theme="dark"] body.legacy-staff .filter-btn.active{background:#514187;color:#fff;border-color:#b8a5ff}
html[data-staff-theme="dark"] body.legacy-staff .filter-btn .count{background:#101827;color:#edf2ff}
html[data-staff-theme="dark"] body.legacy-staff .filter-btn.active .count{background:#332657;color:#fff}

/* Reserve room for the dropdown indicator consistently across native browsers. */
html[data-staff-theme] body select:not([multiple]):not([size]){appearance:none;-webkit-appearance:none;box-sizing:border-box;min-height:44px;line-height:1.4;padding:10px 40px 10px 12px;background-repeat:no-repeat;background-position:right 12px center;background-size:16px 16px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23495057' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
html[data-staff-theme="dark"] body select:not([multiple]):not([size]){background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23edf2ff' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")}
@media(forced-colors:active){html[data-staff-theme] body select:not([multiple]):not([size]){appearance:auto;-webkit-appearance:auto;background-image:none;padding-right:12px}}
/* Navigation owns its own pill background in every state; the legacy moving
   slider must not compete with a second active-link background. */
html[data-staff-theme] body.legacy-staff .navbar-links .nav-background-slider{display:none}
html[data-staff-theme] body.legacy-staff .navbar-links .nav-link{border-radius:999px;background:transparent;box-shadow:none}
html[data-staff-theme] body.legacy-staff .navbar-links .nav-link:is(.active,:hover){background:linear-gradient(135deg,#5b5fc5,#764ba2);color:#fff;box-shadow:0 4px 12px #764ba233}

/* Keep account actions together and give Logout/appearance the same geometry. */
html[data-staff-theme] body :is(.header-controls,.navbar-user-area,.top-navbar .nav-links,header nav:has(form[action$="/auth/logout"])){display:flex;align-items:center;flex-wrap:wrap;gap:12px}
html[data-staff-theme] body :is(.header-controls,.navbar-user-area,.top-navbar .nav-links,header nav:has(form[action$="/auth/logout"])) form[action$="/auth/logout"]{display:flex;margin:0}
html[data-staff-theme] body :is(header,.top-navbar) :is(.staff-theme-toggle,form[action$="/auth/logout"] button){box-sizing:border-box;display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:10px 16px;border:1px solid #7887a3;border-radius:999px;font-family:inherit;font-size:14px;font-weight:600;line-height:22px;margin:0;white-space:nowrap;cursor:pointer}
html[data-staff-theme] body form[action$="/auth/logout"] button{background:#fff1f2;color:#912538;border-color:#d58b98}
html[data-staff-theme="dark"] body form[action$="/auth/logout"] button{background:#7b293b;color:#ffe0e6;border-color:#b76076}

/* Keep directory name text legible in every row state. */
html[data-staff-theme="dark"] body.legacy-staff #patientDirectoryView .patient-name>span{color:#e5eaf4}
html[data-staff-theme="dark"] body.legacy-staff #patientDirectoryView .patient-item:is(.active,:hover) .patient-name>span{color:#f0eaff}
html[data-staff-theme="dark"] body.legacy-staff #patientDirectoryView .patient-item:focus-within{outline-color:#a08bd7}

/* Progress and monthly surfaces must switch with their inherited text colors. */
html[data-staff-theme="dark"] body.legacy-staff :is(.compliance-column,.monthly-averages-container){background:#1a2233;color:#e5eaf4;box-shadow:none;border-color:#43516a}
html[data-staff-theme="dark"] body.legacy-staff .compliance-patient-card{background:#242f43;color:#e5eaf4;border-left-color:#a99bff}
html[data-staff-theme="dark"] body.legacy-staff .compliance-patient-card:hover{background:#3b355e}
html[data-staff-theme="dark"] body.legacy-staff .compliance-patient-card :is(.name,.days){color:#e5eaf4;background:transparent}
html[data-staff-theme="dark"] body.legacy-staff .compliance-patient-card :is([style*="color: #555"],[style*="color:#555"]){color:#bfcbe0!important}
html[data-staff-theme="dark"] body.legacy-staff :is(#currentYear,.year-selector,.year-arrow,.monthly-averages-header h4){color:#e5eaf4}
html[data-staff-theme="dark"] body.legacy-staff .year-arrow{background:#28334a;border-color:#7887a3}
html[data-staff-theme="dark"] body.legacy-staff #complianceLow h3{color:#ffb8ab}
html[data-staff-theme="dark"] body.legacy-staff #complianceMedium h3{color:#ffe795}
html[data-staff-theme="dark"] body.legacy-staff #complianceComplete h3{color:#b5f1cd}
html[data-staff-theme="dark"] body.legacy-staff #onlineDisclaimer{background:#443818!important;color:#fff0bb;border-color:#9e853e!important}
html[data-staff-theme="dark"] body.legacy-staff select option{background:#101827;color:#edf2ff}
html[data-staff-theme] body.legacy-staff .side-header{position:relative;padding-right:72px}
html[data-staff-theme] body.legacy-staff .close-side{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;padding:0;border:1px solid #ffffff80;border-radius:50%;background:#ffffff1f;color:#fff;font-size:28px;line-height:1;top:16px;right:16px}
html[data-staff-theme] body.legacy-staff .close-side:focus-visible{outline:3px solid #fff;outline-offset:3px}
html[data-staff-theme] body.legacy-staff .side-panel{max-width:100vw}
html[data-staff-theme] body.legacy-staff .year-arrow{min-width:44px;min-height:44px}
/* Keep wrapped navigation in flow so it cannot overlap page content. */
html[data-staff-theme] body.legacy-staff:has(#topNavbar){padding-top:12px}
html[data-staff-theme] body.legacy-staff #topNavbar{position:sticky;top:0;height:auto;min-height:65px;margin-top:0;padding:12px 20px;gap:12px;flex-wrap:wrap;box-sizing:border-box}
html[data-staff-theme] body.legacy-staff #topNavbar .navbar-brand{flex-shrink:0}
html[data-staff-theme] body.legacy-staff #topNavbar .navbar-collapsible{min-width:0;flex-wrap:wrap;gap:12px;flex:1 1 720px;justify-content:flex-end}
html[data-staff-theme] body.legacy-staff #topNavbar .navbar-links{flex-wrap:wrap;gap:4px}
html[data-staff-theme] body.legacy-staff #topNavbar .nav-link{white-space:nowrap}
html[data-staff-theme] body.legacy-staff #topNavbar .navbar-user-area{min-width:0;justify-content:flex-end}
html[data-staff-theme] body.legacy-staff #topNavbar .welcome-message{overflow-wrap:anywhere;white-space:normal}
@media(max-width:820px){
 html[data-staff-theme] body.legacy-staff #topNavbar{padding:10px 12px}
 html[data-staff-theme] body.legacy-staff #topNavbar .navbar-collapsible{flex-basis:100%;max-height:75vh;overflow-y:auto}
 html[data-staff-theme] body.legacy-staff #topNavbar .navbar-user-area{justify-content:center}
 html[data-staff-theme] body.legacy-staff .manager-grid{grid-template-columns:minmax(0,1fr)}
 html[data-staff-theme] body.legacy-staff .manager-toggle-bar{flex-wrap:wrap;gap:12px;height:auto;padding:12px}
 html[data-staff-theme] body.legacy-staff .monthly-averages-header{flex-wrap:wrap;gap:12px}
 html[data-staff-theme] body.legacy-staff .months-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
}
html[data-staff-theme="dark"] body.legacy-staff .period-info{color:#bfcbe0}
html[data-staff-theme="light"] body.legacy-staff .compliance-patient-card .days{color:#5146a5}
html[data-staff-theme] body.legacy-staff #topNavbar{margin-bottom:24px}
html[data-staff-theme="dark"] body.legacy-staff .time-row span{color:#bfcbe0}
html[data-staff-theme="dark"] body.legacy-staff .time-row strong{color:#c9b9ff}
html[data-staff-theme="dark"] body.legacy-staff :is(.time-row,.monthly-averages-header){border-color:#43516a}
html[data-staff-theme="dark"] body.legacy-staff .mobile-nav-toggle .icon-bar{background:#e5eaf4}
html[data-staff-theme="dark"] body.legacy-staff :is(.modal-content,.side-content) :is([style*="color:#555"],[style*="color:#666"],[style*="color:#4b5563"]){color:#bfcbe0!important}
/* Canvas intrinsic widths must not force responsive grid tracks wider than the viewport. */
html[data-staff-theme] body.legacy-staff :is(.stat-card,.chart-wrapper,.overview-column,.analytics-section){min-width:0}
html[data-staff-theme] body.legacy-staff .chart-wrapper canvas{max-width:100%}
/* Wide administrative tables scroll inside their card instead of widening the page. */
html[data-staff-theme] body.legacy-staff .table-responsive{max-width:100%;overflow-x:auto}
html[data-staff-theme] body.legacy-staff .summary-header{max-width:100%;min-width:0;scrollbar-width:thin}
html[data-staff-theme="dark"] body.legacy-staff :is(.revenue-value,.total-revenue-display){color:#e5eaf4}
html[data-staff-theme="dark"] body.legacy-staff .main-title{color:#c9b9ff}
html[data-staff-theme="dark"] body.legacy-staff .revenue-period-label{color:#bfcbe0}
/* Care-team navigation also wraps; reserve its actual height above the page heading. */
html[data-staff-theme] body.legacy-staff:has(>.top-navbar:not(#topNavbar)){padding-top:12px}
html[data-staff-theme] body.legacy-staff>.top-navbar:not(#topNavbar){position:sticky;top:0;height:auto;margin:0 0 24px;box-sizing:border-box;gap:12px}
/* Overview pagination is a secondary action in both themes. */
html[data-staff-theme="light"] body.legacy-staff .load-more-btn{color:#5146a5}
html[data-staff-theme="dark"] body.legacy-staff :is(.load-more-btn,.btn-summary--secondary){background:#28334a;color:#e1d8ff;border-color:#7887a3}
html[data-staff-theme="dark"] body.legacy-staff :is(.load-more-btn,.btn-summary--secondary):hover{background:#3b355e;color:#f0eaff;border-color:#a08bd7}
html[data-staff-theme] body.legacy-staff .load-more-btn{min-height:44px}
html[data-staff-theme] body.legacy-staff .load-more-btn:focus-visible{outline:3px solid #826bea;outline-offset:3px}
html[data-staff-theme="dark"] body.legacy-staff .load-more-btn:focus-visible{outline-color:#c9b9ff}

html[data-staff-theme] body.legacy-staff .btn-summary--secondary:focus-visible{outline:3px solid #826bea;outline-offset:3px}
html[data-staff-theme="light"] body.legacy-staff #summaryPanel .status-connected{color:#21633f}
html[data-staff-theme="dark"] body.legacy-staff #summaryPanel .status-connected{background:#184735;color:#b5f1cd;border-color:#579477}
html[data-staff-theme="light"] body.legacy-staff .no-logs{color:#596568}
html[data-staff-theme="dark"] body.legacy-staff .time-log-desc{color:#bfcbe0}
html[data-staff-theme="dark"] body.legacy-staff #logTimePatientName{color:#c9b9ff!important}
