/* Layered important declarations outrank legacy theme utility overrides.
   The earlier action-buttons layer retains the orange action palette. */
@layer control-contrast {
  html[data-theme] body[data-module] main :is(a,button)[class*="bg-gradient-"] {
    background:var(--ui-accent)!important;color:var(--ui-accent-text)!important;border-color:var(--ui-accent)!important;
  }

  html[data-theme] body[data-module] main :is(a,button):is(.bg-blue-500,.bg-blue-600,.bg-blue-700,.bg-blue-800,.bg-indigo-500,.bg-indigo-600,.bg-indigo-700,.bg-indigo-800,.bg-violet-500,.bg-violet-600,.bg-violet-700,.bg-purple-500,.bg-purple-600,.bg-purple-700,.btn-primary,.primary-action,.open-button) {
    background:var(--ui-accent)!important;color:var(--ui-accent-text)!important;border-color:var(--ui-accent)!important;
  }
  html[data-theme] body[data-module] main :is(a,button):is(.bg-green-500,.bg-green-600,.bg-green-700,.bg-emerald-500,.bg-emerald-600,.bg-emerald-700,.bg-teal-500,.bg-teal-600,.bg-teal-700,.bg-cyan-500,.bg-cyan-600,.bg-cyan-700,.quick-share-visit) {
    background:#065f46!important;color:#fff!important;border-color:#065f46!important;
  }
  html[data-theme] body[data-module] main :is(a,button):is(.bg-red-500,.bg-red-600,.bg-red-700,.bg-rose-500,.bg-rose-600,.bg-rose-700,.danger-action,.btn-danger) {
    background:#b91c1c!important;color:#fff!important;border-color:#b91c1c!important;
  }
  html[data-theme] body[data-module] main :is(a,button):is(.bg-orange-400,.bg-orange-500,.bg-orange-600,.bg-orange-700,.bg-amber-400,.bg-amber-500,.bg-amber-600,.bg-amber-700,.bg-yellow-400,.bg-yellow-500,.bg-yellow-600) {
    background:#fbbf24!important;color:#451a03!important;border-color:#b45309!important;
  }
  html[data-theme] body[data-module] main :is(a,button):is(.bg-white,.bg-slate-50,.bg-slate-100,.bg-gray-50,.bg-gray-100,.bg-blue-50,.bg-blue-100,.bg-indigo-50,.bg-indigo-100,.bg-violet-50,.bg-violet-100,.bg-purple-50,.bg-purple-100) {
    background:var(--ui-surface)!important;color:var(--ui-card-text)!important;
  }
  html[data-theme] body[data-module] main :is(a,button):is(.bg-red-50,.bg-red-100) {background:#fff1f2!important;color:#991b1b!important;}
  html[data-theme] body[data-module] main :is(a,button):is(.bg-green-50,.bg-green-100,.bg-emerald-50,.bg-emerald-100) {background:#ecfdf5!important;color:#065f46!important;}
  html[data-theme] body[data-module] main :is(a,button):is(.bg-amber-50,.bg-amber-100,.bg-orange-50,.bg-orange-100) {background:#fffbeb!important;color:#78350f!important;}
  html[data-theme] body[data-module] main .system-page-hero-actions :is(a,button) {background:var(--ui-accent)!important;color:var(--ui-accent-text)!important;}
  html[data-theme] body[data-module] main .system-page-hero-navigation a {background:var(--ui-surface)!important;color:var(--ui-card-text)!important;}
  html[data-theme] body[data-module] main .system-page-hero-actions :is(.print-action,[onclick*="window.print"],[onclick*="printInvoiceReport"]) {background:#065f46!important;color:#fff!important;}
  html[data-theme] body[data-module] main .system-page-hero-actions :is(.danger-action,.btn-danger,form[action*="delete"] button) {background:#b91c1c!important;color:#fff!important;}
  html[data-theme] body[data-module] main :is(a,button):is([class*="bg-"],.btn-primary,.primary-action,.open-button,.quick-share-visit) :is(i,span,b,strong,small),
  html[data-theme] body[data-module] main :is(.system-page-hero-actions,.system-page-hero-navigation) :is(a,button) :is(i,span,b,strong,small) {
    color:inherit!important;-webkit-text-fill-color:currentColor!important;
  }
  html[data-theme] body[data-module] main :is(input,select,textarea)::placeholder {color:var(--ui-muted)!important;opacity:1!important;}
  html[data-theme="dark"] body[data-module] main :is(.text-slate-950,.text-gray-950,.text-slate-300,.text-gray-300) {color:var(--ui-text)!important;}
  html[data-theme="dark"] body[data-module] main :is(.text-blue-900,.text-blue-950,.text-cyan-900,.text-cyan-950) {color:#93d5ff!important;}
  html[data-theme="dark"] body[data-module] main :is(.text-indigo-900,.text-indigo-950,.text-violet-900,.text-violet-950) {color:#c4b5fd!important;}

}
