/* Clinic surface/form contract for Labs. Presentation only; no data or permissions. */
@media screen{
 html[data-theme=dark] body .labs-legacy-modal{background:var(--labs-ui-panel)!important;color:var(--labs-ui-ink)!important;border:1px solid var(--labs-ui-line)}
 html[data-theme=dark] body .labs-legacy-modal :is(input,select,textarea){background:var(--labs-ui-canvas)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important;color-scheme:dark}
 html[data-theme=dark] body .labs-legacy-modal :is(input,textarea)::placeholder{color:var(--labs-ui-muted);opacity:1}
 html[data-theme=dark] body .labs-legacy-modal button{background:var(--labs-ui-soft)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body .labs-legacy-modal .btn-primary,
 html[data-theme=dark] body #tf-confirm-btn[style*="cursor:pointer"]{background:#087f73!important;color:#fff!important}
 html[data-theme=dark] body #tooth-form-popup :is(#tf-items-grid button,#tf-fij-wrap button)[style*="background:var(--sky)"]{background:#173c3c!important;color:#a3f0d9!important;border-color:#67dfb8!important}
 html[data-theme=dark] body #tooth-form-popup :is(#tf-preview-nm,#tf-preview-pr){color:#a3f0d9!important}
 html[data-theme=dark] body #tooth-form-popup button[onclick^="removeToothWiz"]{background:#493039!important;color:#ffbec4!important;border-color:#ffbec4!important}
 html[data-theme=dark] body #invoice-builder-modal .labs-invoice-footer{background:var(--labs-ui-panel)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body #invoice-builder-modal .labs-invoice-total{background:var(--labs-ui-soft)!important;color:var(--labs-ui-ink)!important}
 html[data-theme=dark] body #invoice-builder-modal .labs-invoice-total>span{color:var(--labs-ui-muted)!important}
 html[data-theme=dark] body #invoice-builder-modal #inv-total-preview{color:#a3f0d9!important}
}
@media screen{
 html[data-theme=dark] body #screen-app .labs-plan-card{background:var(--labs-ui-panel)!important;border-color:var(--labs-ui-line)!important;color:var(--labs-ui-ink)!important}
 html[data-theme=dark] body #screen-app .labs-plan-card.is-featured{border-color:#67dfb8!important}
 html[data-theme=dark] body #screen-app .labs-plan-card :is(h3,.labs-plan-price){color:var(--labs-ui-ink)!important}
 html[data-theme=dark] body #screen-app .labs-plan-card :is(.labs-plan-description,.labs-plan-price span){color:var(--labs-ui-muted)!important}
 html[data-theme=dark] body #screen-app .labs-plan-badge{color:#a3f0d9!important}
 html[data-theme=dark] body #screen-app .labs-plan-included{background:#173c32!important;color:#9de8c5!important}
 html[data-theme=dark] body #screen-app .labs-plan-card button{background:var(--labs-ui-soft)!important;color:#a3f0d9!important;border-color:#67dfb8!important}
 html[data-theme=dark] body #screen-app .labs-plan-card.is-featured button{background:#087f73!important;color:#fff!important}
}
/* Configuration helpers and workflow actions keep their own explicit surfaces. */
@media screen{
 html[data-theme=dark] body #screen-app #ucs-assist{background:var(--labs-ui-soft)!important;color:var(--labs-ui-muted)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body #screen-app .olab-flow-mini-actions button{background:var(--labs-ui-soft)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body #screen-app .olab-flow-mini-actions button:hover{background:#173c3c!important;color:#a3f0d9!important;border-color:#67dfb8!important}
}
/* Shared headers live outside #screen-app; keep their dark palette explicit. */
@media screen{
 html[data-theme=dark] body :is(#screen-app .labs-load-error,#screen-app .ls-low,.lab-trace-dialog .lt-error){color:#ffbec4!important}
 html[data-theme=dark] body #screen-app .ls-alerts strong{background:#493815!important;color:#ffda87!important;border-color:#806a37!important}
 html[data-theme=dark] body :is(#screen-app,.lab-trace-dialog) .lt-scroll small{color:#b3c6da!important}
 html[data-theme=dark] body #screen-app .labs-delivery-status{background:#203449!important;color:#b3c6da!important;border-color:#344b60!important}
 html[data-theme=dark] body #screen-app .labs-delivery-list em.is-late{background:#493039!important;color:#ffbec4!important}
}
/* Financial pickers are mounted under body, independently of the active page. */
@media screen{
 html[data-theme=dark] body :is(.labs-finance-period,.labs-period-step,.labs-period-current,.labs-period-picker-card,.olab-filter-popover){background:var(--labs-ui-panel)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body #labs-period-picker-year{background:var(--labs-ui-canvas)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important;color-scheme:dark}
 html[data-theme=dark] body :is(.labs-period-all,.labs-period-months button){background:var(--labs-ui-canvas)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body :is(.labs-period-all.is-active,.labs-period-months button.is-active,.labs-period-all:hover,.labs-period-months button:hover){background:#173c3c!important;color:#a3f0d9!important;border-color:#67dfb8!important}
 html[data-theme=dark] body .labs-period-picker-head button{color:var(--labs-ui-muted)!important}
 html[data-theme=dark] body #screen-app :is(.btn-primary,.btn-teal){background:#087f73!important;color:#fff!important}
 html[data-theme=dark] body #screen-app #page-clients :is(.empty-state,.clients-table tr[id^="cli-det-"]>td,.clients-table tr[id^="cli-det-"]>td>div>div){background:var(--labs-ui-panel)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body #screen-app .labs-clinic-card header>b{background:#493039!important;color:#ffbec4!important}
}
/* Remaining dashboard, notification and form surfaces share the same palette. */
@media screen{
 html[data-theme=dark] body #screen-app :is(.labs-clinic-create,.labs-clinic-metric,.labs-delivery-day,.labs-delivery-list>button,.labs-clinic-attention>div>button,.labs-clinic-activity>div>button,.labs-patient-results,.labs-patient-result,.notification-card){background:var(--labs-ui-panel)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body #screen-app :is(.labs-clinic-tabs button,.labs-delivery-controls button,.labs-delivery-controls label,.notifications-segmented button,.notification-read-action){background:var(--labs-ui-soft)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body #screen-app :is(.labs-clinic-tabs button.active,.notifications-segmented button.is-active,.labs-delivery-day.is-selected){background:#173c3c!important;color:#a3f0d9!important;border-color:#67dfb8!important}
 html[data-theme=dark] body #screen-app :is(#labs-patient-finder-title,#clients-count,.labs-clinic-create h2,.labs-delivery-head h2,.labs-clinic-metric strong,.labs-clinic-flow strong){color:var(--labs-ui-ink)!important}
 html[data-theme=dark] body #screen-app :is(.labs-patient-finder small,.labs-patient-search-clear,.labs-clinic-create button small,.labs-delivery-day small,.labs-delivery-day span,.labs-clinic-metric small,.labs-clinic-metric em,.labs-clinic-flow small,.labs-patient-result small,.labs-patient-empty){color:var(--labs-ui-muted)!important}
 html[data-theme=dark] body #screen-app .labs-clinic-create button.primary{background:#087f73!important;color:#fff!important}
 html[data-theme=dark] body #screen-app .labs-clinic-create button.primary small{color:#fff!important}
 html[data-theme=dark] body #screen-app :is(.labs-clinic-metric>i,.labs-clinic-flow button i,.notification-icon){background:#173c3c!important;color:#a3f0d9!important;border-color:#344b60!important}
 html[data-theme=dark] body #screen-app .labs-clinic-attention button>i{background:#493815!important;color:#ffda87!important}
 html[data-theme=dark] body #screen-app .notification-card.is-read{opacity:1}
 html[data-theme=dark] body #screen-app :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),select,textarea){background:var(--labs-ui-canvas)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important;color-scheme:dark}
 html[data-theme=dark] body :is(#screen-app,.modal,.lab-trace-dialog) :is(input,textarea)::placeholder{color:var(--labs-ui-muted)!important;opacity:1}
 html[data-theme=dark] body .lab-trace-dialog .lt-scroll :is(th,td){background:var(--labs-ui-panel)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body .lab-trace-dialog .lt-scroll thead th{background:#203449!important;color:#e5edf7!important}
}
@media screen{
 html[data-theme=dark] body :is(#labs-adaptive-header,#labs-adaptive-header.is-visible){background:#172433!important;color:#e5edf7!important;border-color:#344b60!important}
 html[data-theme=dark] #labs-adaptive-header :is(.labs-adaptive-breadcrumb,.labs-adaptive-breadcrumb b){color:#b3c6da!important}
 html[data-theme=dark] body #screen-app .sidebar .sb-link.active{background:#173c3c!important;color:#a3f0d9!important}
 html[data-theme=dark] body #screen-app .sidebar .sb-link:hover{background:#203449!important;color:#e5edf7!important}
 html[data-theme=dark] body #screen-app #page-orders .labs-stage-copy,
 html[data-theme=dark] body #screen-app #page-orders .labs-stage-copy :is(span,small){color:#b3c6da!important}
 html[data-theme=dark] body #screen-app #page-orders .labs-stage-copy strong{color:#e5edf7!important;background:transparent!important}
 html[data-theme=dark] body #screen-app #page-orders .labs-stage-summary.is-selected{border-color:#67dfb8!important}
 html[data-theme=dark] body #screen-app #page-orders .labs-stage-icon{background:#173c3c!important;color:#a3f0d9!important}
 html[data-theme=dark] body #screen-app #page-orders :is(#search-orders,#labs-list-group,#labs-list-sort){background:#0d1724!important;color:#e5edf7!important;border-color:#53728c!important;color-scheme:dark}
 html[data-theme=dark] body #screen-app #page-orders #search-orders::placeholder{color:#b3c6da!important;opacity:1}
 html[data-theme=dark] body #screen-app #page-orders .labs-list-controls label{color:#b3c6da!important;border-color:#344b60!important}
}
@media screen{
 :root{--labs-ui-canvas:#f5f6f8;--labs-ui-panel:#fff;--labs-ui-soft:#f0f5f8;--labs-ui-ink:#17384b;--labs-ui-muted:#617789;--labs-ui-line:#d9e5ed;--labs-ui-action:#087f73;--labs-ui-on-action:#fff;--labs-ui-radius:14px}
 html[data-theme=dark]{--labs-ui-canvas:#0d1724;--ink2:#b3c6da;--labs-ui-panel:#172433;--labs-ui-soft:#203449;--labs-ui-ink:#e5edf7;--labs-ui-muted:#b3c6da;--labs-ui-line:#344b60;--labs-home-bg:var(--labs-ui-canvas);--labs-home-ink:var(--labs-ui-ink);--labs-home-muted:var(--labs-ui-muted);--labs-home-line:var(--labs-ui-line);--labs-home-soft:var(--labs-ui-soft);--labs-home-accent-dark:#67dfb8}
 #screen-app .page.labs-unified-page{--labs-ink:var(--labs-ui-ink);--labs-muted:var(--labs-ui-muted);--labs-line:var(--labs-ui-line);--labs-soft:var(--labs-ui-soft)}
 body :is(.overlay>.modal,.lab-trace-dialog){box-sizing:border-box;border:1px solid var(--labs-ui-line);border-radius:18px!important;background:var(--labs-ui-panel)!important;color:var(--labs-ui-ink)!important;max-height:92dvh!important;box-shadow:0 20px 70px #10293840}
 body .overlay{padding:16px;box-sizing:border-box;align-items:center;justify-content:center;background:#10293888}
 body .overlay>.modal{width:100%;min-width:0;overflow:hidden;display:flex;flex-direction:column}
 body :is(.modal-top,.modal-foot,.lab-trace-dialog>header){flex-shrink:0;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 22px!important;background:var(--labs-ui-panel)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 body :is(.modal-top,.lab-trace-dialog>header){border-bottom:1px solid var(--labs-ui-line)}
 body :is(.modal-foot,.lt-form footer){border-top:1px solid var(--labs-ui-line);gap:10px;padding-top:16px;flex-wrap:wrap}
 body :is(.modal-top,.lab-trace-dialog>header) h2{font:700 20px/1.35 Montserrat,Arial,sans-serif;overflow-wrap:anywhere;color:var(--labs-ui-ink)!important;margin:0}
 body :is(.modal-body,.lab-trace-dialog .lt-body){padding:22px!important;min-width:0;overflow:auto;overscroll-behavior:contain;color:var(--labs-ui-ink)!important;background:var(--labs-ui-panel)!important}
 body .lab-trace-dialog{width:min(1180px,calc(100vw - 32px));padding:0}
 body .lab-trace-dialog .lt-body{max-height:calc(92dvh - 80px)}
 body :is(.modal,.lab-trace-dialog,#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal) :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]),select,textarea){box-sizing:border-box;min-width:0;max-width:100%;width:100%;min-height:44px;padding:11px 12px;border:1px solid var(--labs-ui-line);border-radius:10px;background:var(--labs-ui-canvas)!important;color:var(--labs-ui-ink)!important;font:400 14px/1.5 Roboto,Arial,sans-serif}
 body :is(.modal,.lab-trace-dialog,#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal) :is(input,select,textarea):focus-visible{outline:3px solid #2682c0;outline-offset:2px}
 body :is(.modal,.lab-trace-dialog,#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal) :is(.fg,.fgrid,.lt-form,.ls-line,label){min-width:0}
 body :is(.modal,.lab-trace-dialog,#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal) :is(.fg label,.flabel,.lt-form>label){font:600 13px/1.5 Roboto,Arial,sans-serif;color:var(--labs-ui-ink)}
 body :is(.modal,.lab-trace-dialog,#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal) :is(.hint,.fsub){color:var(--labs-ui-muted)!important;line-height:1.5}
 body :is(.modal,.lab-trace-dialog,#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal) :is(.btn,.act-btn,nav button){box-sizing:border-box;min-height:44px;border-radius:10px!important;padding:10px 16px;font:600 14px/1.4 Roboto,Arial,sans-serif;white-space:normal;max-width:100%}
 body :is(.modal,.lab-trace-dialog,#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal) :is(.btn-primary,.btn-teal){background:var(--labs-ui-action)!important;color:var(--labs-ui-on-action)!important;border:1px solid transparent}
 body :is(.modal,.lab-trace-dialog,#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal) :is(.btn-ghost,.act-btn,nav button:not(.btn-primary)){background:var(--labs-ui-soft)!important;color:var(--labs-ui-ink)!important;border:1px solid var(--labs-ui-line)!important}
 body :is(.modal-top .btn-x,.lab-trace-dialog>header button){flex:0 0 44px;width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--labs-ui-line)!important;border-radius:10px;background:var(--labs-ui-soft)!important;color:var(--labs-ui-ink)!important}
 body :is(#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal)>div{box-sizing:border-box;min-width:0;width:min(900px,calc(100vw - 32px))!important;max-width:100%!important;max-height:92dvh!important;overflow:auto;background:var(--labs-ui-panel)!important;color:var(--labs-ui-ink)!important;border:1px solid var(--labs-ui-line)!important;border-radius:18px!important}
 html[data-theme=dark] body #screen-app :is(.sidebar,.sb-brand,.tb-user-menu,.topbar,#labs-adaptive-header,#mob-topbar,#mob-tabbar,#mob-more-sheet,.family-account-popup,.family-assistant-panel){background:var(--labs-ui-panel)!important;background-image:none!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body #screen-app :is(.main,.page,.labs-home-center){background:var(--labs-ui-canvas)!important;background-image:none!important;color:var(--labs-ui-ink)!important}
 html[data-theme=dark] body #screen-app :is(.labs-unified-page .kpi,.card,.lab-trace-panel,.clients-toolbar-card,.clients-directory-meta,.notifications-toolbar,.tbl-toolbar,.dent-table-finder,.labs-clinic-card,.labs-patient-finder,.labs-delivery-calendar,.labs-home-today,.labs-home-flow,.labs-home-activity,.labs-home-card,.labs-home-metric,.labs-home-create,.labs-orders-stage-summary button,.olab-finance-metric){background:var(--labs-ui-panel)!important;background-image:none!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body #screen-app :is(.family-account strong,#tb-user-display,#tb-user-name,.family-account-copy,.sb-link,.mtb-item,.labs-page-heading h2,.labs-clinic-card h3,.labs-clinic-notion-bar strong,.labs-clinic-identity h1,.labs-delivery-calendar h3){color:var(--labs-ui-ink)!important}
 html[data-theme=dark] body #screen-app :is(.dent-table-finder input,.clients-search-wrap,.filter-input,.os-unified-tabs,.ls-tabs,.notifications-segmented,.tabsbar-olabs,.tfoot,.labs-clinic-tabs,.olab-finance-note,.lab-case-trace-entry){background:var(--labs-ui-soft)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body #screen-app :is(.dent-table-finder input,.filter-input,input,select,textarea){color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body #screen-app :is(.btn-ghost,.btn-icon,.act-btn,.os-utab,.labs-theme-toggle,.labs-clinic-create button:not(.primary)){background:var(--labs-ui-soft)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body :is(.modal,.lab-trace-dialog,#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal) :is(.lab-trace-panel,.labs-order-info-card,.labs-order-summary-card,.sum-box,.olab-flow-current){background:var(--labs-ui-soft)!important;background-image:none!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body :is(.lab-trace-dialog,.modal) small{color:var(--labs-ui-muted)}
 @media(max-width:650px){
  body .overlay{padding:10px!important}
  body .overlay>.modal{max-width:100%!important;width:100%!important;max-height:94dvh!important}
  body .lab-trace-dialog{width:calc(100vw - 20px);max-height:94dvh!important}
  body :is(.modal-top,.modal-foot,.lab-trace-dialog>header){padding:14px!important}
  body :is(.modal-body,.lab-trace-dialog .lt-body){padding:14px!important}
  body :is(.modal,.lab-trace-dialog,#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal) :is(.fgrid,.lt-form,.ls-line){grid-template-columns:minmax(0,1fr)!important}
  body :is(.modal,.lab-trace-dialog,#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal) :is(.fgrid,.lt-form,.ls-line)>*{min-width:0;grid-column:auto!important}
  body :is(.modal-foot,.lt-form footer){justify-content:flex-end}
  body :is(#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal)>div{width:calc(100vw - 20px)!important}
 }
}

@media screen and (max-width:650px){body #add-doctor-form .labs-contact-grid,body :is(#invoice-builder-modal,#cc-payments-modal,#olab-payment-modal) [style*="grid-template-columns"]{grid-template-columns:minmax(0,1fr)!important}}

@media screen{
 body .lab-trace-dialog :is(.ls-line>button,[data-line]){box-sizing:border-box;min-height:44px;padding:10px 16px;border:1px solid var(--labs-ui-line);border-radius:10px;background:var(--labs-ui-soft);color:var(--labs-ui-ink);font:600 14px/1.4 Roboto,Arial,sans-serif;cursor:pointer}
 html[data-theme=dark] body .notification-toast{background:var(--labs-ui-panel)!important;color:var(--labs-ui-ink)!important;border-color:var(--labs-ui-line)!important}
 html[data-theme=dark] body .notification-toast-main :is(strong,small){color:var(--labs-ui-ink)!important}
 html[data-theme=dark] body .notification-toast-icon{background:var(--labs-ui-soft)!important}
}
