/* Receipt / invoice controls are opaque UI chrome; original PDF/XML sheets stay unchanged. */
@media screen {
html[data-theme=dark] #root .receipt-workspace,
html[data-theme=dark] #root .invoice-pdf-capture,
html[data-theme=dark] #root .invoice-quantity-ledger--compact,
html[data-theme=dark] #root .dossier-invoices :is(.dossier-cfdi-card,.dossier-fiscal-allocation,.dossier-document-list,.dossier-inline-select,.dossier-detected-supplier) {
  --surface:#101827;--surface-soft:#141e30;--surface-strong:#1a273b;
  --surface-alt:#141e30;--surface-muted:#141e30;
  --text:#f5f7fb;--muted:#b4c1d6;--border:#40516c;--accent:#c8aff8;
  color:#f5f7fb;color-scheme:dark;
}
/* The glass dossier defines light surfaces locally, including in dark theme. */
html[data-theme=dark] #root .receipt-workspace :is(.receipt-materials,.receipt-date,.receipt-proof,.receipt-comments,.receipt-search,.receipt-order-select select,.receipt-quantity-control),
html[data-theme=dark] #root .receipt-workspace .receipt-materials>header,
html[data-theme=dark] #root .receipt-workspace .receipt-comments textarea,
html[data-theme=dark] #root .receipt-submit-bar {
  background:#101827!important;color:#f5f7fb!important;border-color:#40516c!important;
}
html[data-theme=dark] #root .receipt-submit-bar {--text:#f5f7fb;--muted:#b4c1d6;--border:#40516c;color-scheme:dark}
html[data-theme=dark] #root .receipt-workspace :is(.receipt-context p,.receipt-material-amount>span,.receipt-quantity-control>span,.receipt-evidence-limits,.receipt-proof>header>span,.receipt-empty),
html[data-theme=dark] #root .receipt-submit-bar small {color:#b4c1d6!important}
html[data-theme=dark] #root .receipt-workspace :is(.receipt-material-identity>strong,.receipt-fill-all,.receipt-quantity-control>button) {color:#c8aff8!important}
html[data-theme=dark] #root .receipt-workspace .receipt-complete-mark {color:#80e1bc!important}
html[data-theme=dark] #root .receipt-workspace .receipt-filter-tabs>button[aria-pressed=true] {background:#35264f!important;color:#dccbfc!important}
html[data-theme=dark] #root .receipt-workspace .receipt-message.is-error {background:#3c2330!important;color:#ffc2d1!important;border-color:#8b4a61!important}
html[data-theme=dark] #root .receipt-workspace .receipt-message.is-success {background:#143c34!important;color:#b2ead7!important;border-color:#3e806c!important}
html[data-theme=dark] #root .dossier-invoices .dossier-dropzone,
html[data-theme=dark] #root .dossier-fiscal-workspace.is-empty .dossier-dropzone {
  background:#241c38!important;color:#dccbfc!important;border-color:#80699f!important;
}
html[data-theme=dark] #root .dossier-invoices .dossier-dropzone--secondary,
html[data-theme=dark] #root .dossier-fiscal-workspace.is-empty .dossier-dropzone--secondary {background:#101827!important;color:#b4c1d6!important;border-color:#40516c!important}
html[data-theme=dark] #root .dossier-invoices .dossier-dropzone:hover {background:#35264f!important;color:#e7ddff!important;border-color:#b89ae9!important}
html[data-theme=dark] #root .dossier-invoices :is(.invoice-pdf-capture,.invoice-quantity-ledger--compact,.dossier-cfdi-card,.dossier-fiscal-allocation,.dossier-document-list) {background:#101827!important;border-color:#40516c!important}
html[data-theme=dark] #root .dossier-invoices :is(.dossier-fiscal-allocation>header,.invoice-quantity-ledger--compact th) {background:#141e30!important;color:#f5f7fb!important}
html[data-theme=dark] #root .dossier-invoices :is(.invoice-pdf-capture input,.invoice-pdf-capture select,.dossier-allocation-fields input,.dossier-inline-select select) {background:#141e30!important;color:#f5f7fb!important;border-color:#40516c!important;color-scheme:dark}
html[data-theme=dark] #root .dossier-invoices :is(.invoice-material>strong,.dossier-document-row span) {color:#c8aff8!important}
html[data-theme=dark] #root .invoice-quantity-ledger--compact .invoice-quantity-difference {background:#42321a;color:#ffd184}
html[data-theme=dark] #root .invoice-pdf-capture [role=alert] {color:#ffc2d1}
/* Native date trigger only; leave calendar dropdown styling and behavior intact. */
html[data-theme=dark] #root .receipt-workspace .receipt-date .portal-date-picker,
html[data-theme=dark] #root .receipt-workspace .receipt-date .portal-date-picker>.portal-date-trigger {
  background:var(--rx-surface-2,#141e30)!important;color:#f5f7fb!important;border-color:#40516c!important;
}
/* Linked invoice navigation and preview toolbar, outside the document page. */
html[data-theme=dark] #root :is(.invoice-inline-list,.invoice-inline-main,.invoice-inline-toolbar,.invoice-inline-detail) {background:#101827!important;color:#f5f7fb!important;border-color:#40516c!important}
html[data-theme=dark] #root .invoice-inline-list nav>button[aria-current] {background:#35264f!important;border-color:#b89ae9!important}
html[data-theme=dark] #root :is(.invoice-inline-list nav span,.invoice-inline-toolbar span,.invoice-inline-facts dt) {color:#b4c1d6!important}
html[data-theme=dark] #root .invoice-inline-toolbar :is(button,a) {color:#f5f7fb!important}
html[data-theme=dark] #root .invoice-inline-toolbar button[aria-pressed=true] {background:#35264f!important;color:#dccbfc!important}
html[data-theme=dark] #root .invoice-inline-table th {background:#141e30!important;color:#f5f7fb!important}
html[data-theme=dark] #root .invoice-inline-status {background:#143c34!important;color:#b2ead7!important}
html[data-theme=dark] #root .invoice-inline-alerts {color:#ffd184!important}
html[data-theme=dark] #root .invoice-inline-alerts summary span {background:#42321a!important;color:#ffd184!important}
#root :is(.invoice-inline-toolbar,.invoice-inline-list>header,.invoice-inline-alerts) :is(button,a,summary) {min-height:44px!important}
#root .invoice-inline-workspace :is(button,a,summary):focus-visible {outline:2px solid var(--focus-ring,#a98ff8)!important;outline-offset:3px!important}
/* Small labels and controls remain usable in either theme. */
#root .dossier-invoices :is(.invoice-quantity-ledger--compact>summary>small,.invoice-quantity-ledger--compact th,.invoice-material>strong,.invoice-quantity-value>small,.invoice-quantity-difference) {font-size:12px!important}
#root .dossier-invoices :is(.button,.dossier-inline-select select,.dossier-allocation-fields input,.invoice-quantity-ledger--compact>summary) {min-height:44px!important}
#root :is(.receipt-workspace,.dossier-invoices) :is(button,a,input,select,textarea,summary,[role=button]):focus-visible,
#root .receipt-submit-bar button:focus-visible {outline:2px solid var(--focus-ring,#a98ff8)!important;outline-offset:3px!important}
}
