.theme-toggle{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;min-width:42px;padding:10px;border:1px solid #d4e2db;border-radius:50%;background:#fff;color:#1b4c3c;cursor:pointer}
.theme-toggle svg{width:22px;height:22px}.theme-toggle:focus-visible{outline:3px solid var(--primary-focus);outline-offset:3px}
#themeToggle{position:fixed;right:18px;bottom:calc(92px + env(safe-area-inset-bottom,0px));z-index:19;box-shadow:0 4px 18px #0002}
html[data-theme="dark"]{color-scheme:dark}
html[data-theme="dark"] body{background:#000;color:#f2f2f2}
html[data-theme="dark"] :is(aside,header,.panel,.card,dialog,.auth-card,.ui-select-menu,.product-search-menu,.device-options,.device-entry,.sale-cart-line,.store-logo-preview,.stock-detail-row:hover>td){background:#111;color:#f2f2f2;border-color:#3a3a3a}
html[data-theme="dark"] :is(h1,h2,h3,h4,strong,b,dt,dd){color:inherit}
html[data-theme="dark"] :is(input,select,textarea){background:#111;color:#eee;border-color:#444}
html[data-theme="dark"] input::placeholder,html[data-theme="dark"] textarea::placeholder{color:#aaa}
html[data-theme="dark"] :is(th,.dialoghead,.notification-dialog-header){background:#111;color:#eee;border-color:#3a3a3a}
html[data-theme="dark"] :is(td,tr,.row,.settings-section,.settings-heading,.device-editor,.payment-editor,.warranty-history-block,header,aside,.stock-detail-info){border-color:#3a3a3a}
html[data-theme="dark"] :is(small,.intro,.card em,.card>small,.admin-description,.stock-detail-info dt){color:#bbb}
html[data-theme="dark"] .ghost,html[data-theme="dark"] .theme-toggle{background:#2b2b2b;color:#eee;border-color:#444}
html[data-theme="dark"] .danger{background:#4d282c;color:#ffc4c8}
html[data-theme="dark"] .error,html[data-theme="dark"] .pin-warning,html[data-theme="dark"] .overdue{color:#ffb0af}
html[data-theme="dark"] :is(.badge,nav button.active){background:#284b3a;color:#c5f2d7}
html[data-theme="dark"] .badge.low,html[data-theme="dark"] .warn{background:#4e3b23;color:#ffdb9f}
html[data-theme="dark"] :is(.phone-link,.store-identity,.auth-brand,.product-search-stock){color:#a4e6c6}
html[data-theme="dark"] .auth-layout,html[data-theme="dark"] #authScreen{background:#000}
html[data-theme="dark"] :is(.pin-slot input,.pin-digits input){background:#111;color:#f2f2f2}
html[data-theme="dark"] .pin-dot{color:#f2f2f2}
html[data-theme="dark"] .password-eye{color:#ddd;background:transparent}
html[data-theme="dark"] .notification-card{background:#111;color:#f2f2f2;border-color:#3a3a3a}
html[data-theme="dark"] .notification-card.is-unread{background:#2b2b2b}
html[data-theme="dark"] dialog::backdrop{background:#000a}
html[data-theme="dark"] .ui-select-trigger{background:#111;color:#eee;border-color:#444}
html[data-theme="dark"] .ui-select-option:hover,html[data-theme="dark"] .ui-select-option.is-active{background:#303030}
html[data-theme="dark"] .bar{background:#333}
@media(min-width:651px){#themeToggle{bottom:22px}}
@media print{#themeToggle{display:none!important}}
html[data-theme="dark"] :is(.notification-bell,.ui-select-option,.notification-item,.party-suggestion-menu,.party-suggestion-option){background:#111;color:#eee;border-color:#444}
html[data-theme="dark"] .notification-item.unread{background:#2b2b2b}
html[data-theme="dark"] :is(#confirmDialog,#receiptUnits,#deviceDetail,#stockDetailDialog){background:#111;color:#f2f2f2;border-color:#3a3a3a}
html[data-theme="dark"] :is(#refreshToast,.notification-kind,.notification-new){background:#284b3a;color:#d3f3df;border-color:#444}
html[data-theme="dark"] .confirm-body p{color:#ccc}
/* Time-range sections are independent cards, including inside receipt history. */
html[data-theme="dark"] .date-filter{background:#111;color:#f2f2f2;border-color:#3a3a3a}
html[data-theme="dark"] .date-filter-controls>label{color:#f2f2f2}
html[data-theme="dark"] .date-range-caption{color:#bbb}
html[data-theme="dark"] .date-filter-error{color:#ffb0af}
/* Extend the sticky header paint through main's gutters and top padding. */
main{--workspace-gutter:38px}
main>header{isolation:isolate}
main>header::before{content:"";position:absolute;z-index:-1;pointer-events:none;inset:-40px calc(-1 * var(--workspace-gutter)) -1px;background:inherit;border-bottom:1px solid #e3e9e5}
html[data-theme="dark"] main>header::before{border-color:#3a3a3a}
body[data-workspace="admin"] main{--workspace-gutter:24px}
@media(max-width:1000px){main{--workspace-gutter:22px}}
@media(max-width:650px){main{--workspace-gutter:16px}body[data-workspace="admin"] main{--workspace-gutter:14px}}

html[data-theme="dark"] .confirm-actions{background:#111;border-color:#3a3a3a}
