/* Screen-only dashboard theme: documents, email previews, login and product photos stay original. */
@media screen {
 #appView,.modal {--navy:#101218;--navy-deep:#101218;--ink:#101218;--muted:#626974;--line:#e0e3e7;--soft:#f4f5f6;--brand-lime:#d5f542;--brand-lime-hover:#c6e835;--brand-lime-soft:#f1f8cf;--surface:#fff;--surface-raised:#f4f5f6;--theme-text:#101218;--theme-muted:#626974;--theme-border:#e0e3e7;}
 #appView .content {background:var(--soft);color:var(--theme-text)}
 #appView .sidebar {background:var(--surface);border-color:var(--theme-border)}
 #appView .primary-button,#appView .nav-item.active,.modal .primary-button {background:#d5f542;color:#101218;border-color:transparent}
 #appView .top-actions {flex-wrap:wrap;gap:12px}
 .theme-control {display:grid;gap:3px;font-size:12px;color:var(--theme-muted);flex-shrink:0}
 .theme-control select {appearance:none;background:var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m3 4 3 3 3-3' fill='none' stroke='%237b838e' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 10px center;color:var(--theme-text);border:1px solid var(--theme-border);border-radius:9px;min-height:40px;padding:8px 28px 8px 12px;font:600 14px 'DM Sans',sans-serif}
 #appView :is(.stat-card,.panel,.product-card,.market-card,.procurement-card,.discovery-hero) {border-color:var(--theme-border)}
 #appView :is(.secondary-button,.table-action,.link-button,.text-action) {color:var(--theme-text)}
 html[data-theme=dark] #appView,html[data-theme=dark] .modal {color-scheme:dark;--navy:#d5f542;--navy-deep:#f4f5f7;--ink:#f4f5f7;--muted:#b0b7c2;--line:#353b45;--soft:#101218;--surface:#191d25;--surface-raised:#242a34;--theme-text:#f4f5f7;--theme-muted:#b0b7c2;--theme-border:#353b45;--brand-lime-soft:#323c20;}
 html[data-theme=dark] :is(#appView,.modal) :is(.panel,.stat-card,.product-card,.market-card,.procurement-card,.discovery-hero,.order-card,.sample-card,.customer-card,.task-center,.report-card,.admin-product-hero,.hr-hero,.procurement-hero,.table-panel,.notification-panel,.profile-menu,.order-filters,.staff-order-import,.employee-order-line,.order-edit-row,.sample-product-line) {background:var(--surface);color:var(--theme-text);border-color:var(--theme-border);box-shadow:none}
 html[data-theme=dark] .modal {background:var(--surface);color:var(--theme-text)}
 html[data-theme=dark] #appView :is(.sales-tracking,.sales-order,.dashboard-operation-cards article,.pricing-workspace,.operation-blank,.work-order,.order-filter-panel,.sales-map-grid article) {background:var(--surface);color:var(--theme-text);border-color:var(--theme-border)}
 html[data-theme=dark] :is(#appView,.modal) :is(.sales-filters button,.sales-map-controls,.pricing-workspace-tabs,.sales-date th,#dashboardWidgetChoices label,.work-order-summary) {background:var(--surface-raised);color:var(--theme-text);border-color:var(--theme-border)}
 html[data-theme=dark] #appView :is(.sales-scroll button,.sales-tracking button:not(.sales-stage),.dashboard-operation-cards article>span,.order-filter-panel>summary) {color:var(--theme-text)}
 html[data-theme=dark] #appView .sales-tracking .sales-stage {color:var(--stage-color);background:var(--stage-bg)}
 html[data-theme=dark] :is(#appView,.modal) :is(h1,h2,h3,h4,strong,label,td) {color:var(--theme-text)}
 html[data-theme=dark] :is(#appView,.modal) :is(p,small,.muted,.eyebrow,.hero-copy,.role-preview) {color:var(--theme-muted)}
 html[data-theme=dark] :is(#appView,.modal) :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {background-color:var(--surface-raised);color:var(--theme-text);border-color:var(--theme-border)}
 html[data-theme=dark] :is(#appView,.modal) :is(input,textarea)::placeholder {color:#a2aab7}
 html[data-theme=dark] :is(#appView,.modal) :is(th,.segmented,.detail-tabs,.product-section-tabs,.order-summary,.order-amount-summary,.line-calculation,.security-note,.import-preview,.profile-chip>span) {background:var(--surface-raised);color:var(--theme-muted);border-color:var(--theme-border)}
 html[data-theme=dark] :is(#appView,.modal) :is(.secondary-button,.table-action,.icon-button,.close-button,.mobile-nav-toggle) {background:var(--surface-raised);color:var(--theme-text);border-color:var(--theme-border)}
 html[data-theme=dark] #appView :is(.nav-item,.nav-group-toggle) {color:var(--theme-muted)}
 html[data-theme=dark] #appView .sidebar-bottom {background:var(--surface);border-color:var(--theme-border)}
 html[data-theme=dark] #appView .nav-count {color:#101218;background:#d5f542}
 html[data-theme=dark] #appView :is(.nav-item.active,.primary-button),html[data-theme=dark] .modal .primary-button {color:#101218;background:#d5f542}
 html[data-theme=dark] #appView :is(.nav-item:hover:not(.active),.nav-group-toggle:hover,.table-panel tbody tr:hover) {background:var(--surface-raised);color:var(--theme-text)}
 html[data-theme=dark] #appView .segmented button.active {background:#d5f542;color:#101218}
 html[data-theme=dark] :is(#appView,.modal) :is(.status-pill,.catalog-status) {filter:brightness(.85)}
 html[data-theme=dark] #appView .sidebar :is(.brand-logo,.brand-mark,img) {background:transparent;border-radius:0}
 html[data-theme=dark] #appView .sidebar .sidebar-logo {filter:brightness(0) invert(1)}
 html[data-theme=dark] :is(#appView,.modal) :is(button,a,input,select,textarea,summary):focus-visible {outline:2px solid #d5f542;outline-offset:3px}
 /* Components with fixed light backgrounds must switch foreground and surface together. */
 html[data-theme=dark] #appView :is(.admin-kpis,.task-kpis,.hr-kpis,.lead-kpis)>article,
 html[data-theme=dark] #appView :is(.report-kpis>button,.report-kpis>div,.report-table-wrap,.report-table-wrap tbody,.report-table-wrap td,.pricing-matrix td,.pricing-matrix th) {background:var(--surface);color:var(--theme-text);border-color:var(--theme-border)}
 html[data-theme=dark] #appView :is(.admin-kpis,.task-kpis,.hr-kpis,.lead-kpis,.report-kpis) :is(span,small) {color:var(--theme-muted)}
 html[data-theme=dark] #appView :is(.work-order-meta,.procurement-item-preview,.task-view-tabs,.sample-workflow>span,.report-empty-message) {background:var(--surface-raised);color:var(--theme-text);border-color:var(--theme-border)}
 html[data-theme=dark] #appView :is(.work-order-meta .order-piece-summary,.procurement-item-preview span) {color:#d5f542}
 html[data-theme=dark] #appView #reportRefresh,
 html[data-theme=dark] #appView :is(.task-view-tabs button,.pricing-currency-controls button,.category-filters button,.package-filters button) {background:var(--surface-raised);color:var(--theme-text);border-color:var(--theme-border)}
 html[data-theme=dark] #appView :is(.task-view-tabs button.active,.pricing-currency-controls button.active,.category-filters button.active,.package-filters button.active) {background:#d5f542;color:#101218;border-color:#d5f542;box-shadow:none}
 html[data-theme=dark] #appView .sample-workflow>span.done {background:var(--brand-lime-soft);color:#e4f2bf}
 html[data-theme=dark] #appView .report-kpis>button.selected {background:var(--brand-lime-soft);color:var(--theme-text);box-shadow:inset 0 3px #d5f542}
 html[data-theme=dark] #appView .report-kpis>button:hover {background:var(--surface-raised)}
 html[data-theme=dark] #appView :is(.report-table-wrap td,.report-table-wrap th,.report-topline,.procurement-meta) {border-color:var(--theme-border)}
 html[data-theme=dark] #appView #reportsPage {color:var(--theme-text)}
 html[data-theme=dark] #appView :is(.report-chart-title span,.report-tabs button,.sample-card-items) {color:var(--theme-muted)}
 html[data-theme=dark] #appView .report-tabs button.active {color:#d5f542;border-color:#d5f542}
 html[data-theme=dark] #appView #reportsPage .report-warning {background:#fff8e8;color:#684b16}
 html[data-theme=dark] #appView #reportsPage .report-warning :is(p,small,strong,span) {color:inherit}
 html[data-theme=dark] #appView .report-line-chart text {fill:var(--theme-muted)}
 html[data-theme=dark] #appView .report-line-chart line {stroke:#414954}
 html[data-theme=dark] #appView .report-line-chart polyline {stroke:#d5f542}
 html[data-theme=dark] #appView .report-line-chart circle {fill:var(--surface);stroke:#d5f542}
 html[data-theme=dark] .modal :is(.order-customer-info,.order-workflow-summary>div,.shipping-doc-summary,.shipping-doc-modal details) {background:var(--surface-raised);color:var(--theme-text);border-color:var(--theme-border)}
 html[data-theme=dark] .modal :is(.order-customer-info,.order-workflow-summary,.shipping-doc-summary) :is(strong,span) {color:var(--theme-text)}
 html[data-theme=dark] .modal :is(.order-customer-info,.order-workflow-summary,.shipping-doc-summary) small {color:var(--theme-muted)}
 html[data-theme=dark] .modal .order-workflow-actions {background:var(--surface-raised);border-color:var(--theme-border);color:var(--theme-text)}
 html[data-theme=dark] .modal .workflow-action-buttons {border-color:var(--theme-border)}
 html[data-theme=dark] .modal .order-stage-track .order-stage-step {color:var(--theme-muted)}
 html[data-theme=dark] .modal .order-stage-track .order-stage-step::after {background:var(--theme-border)}
 html[data-theme=dark] .modal .order-stage-track i {background:var(--surface);color:var(--theme-muted)}
 html[data-theme=dark] .modal .order-stage-track .done i {background:#173c30;color:#83e0b7}
 html[data-theme=dark] .modal .order-stage-track .current {color:#d5f542}
 html[data-theme=dark] .modal .order-stage-track .current i {background:#d5f542;color:#101218}
 html[data-theme=dark] .modal .order-stage-track .order-stage-step:not(:disabled):hover i {background:#d5f542;color:#101218}
 @media(max-width:700px){#appView .topbar{flex-wrap:wrap;gap:12px}#appView .top-actions{gap:8px;width:100%;justify-content:flex-end}.theme-control{margin-right:auto}.theme-control>span{display:none}.theme-control select{min-height:44px}}
}
