/* Shared interaction colors: foreground and background always change together. */
:root {
  --button-hover-bg:#173b4b;
  --button-hover-text:#f0f8ff;
  --button-hover-border:#63cbd0;
  --button-danger-bg:#4b2431;
  --button-danger-text:#ffeaf0;
  --button-save-bg:#204b3e;
  --button-save-text:#effff7;
  --button-muted-text:#a2b5c8;
  --button-accent-text:#79d6d9;
}
:root[data-theme="light"] {
  --button-hover-bg:#e0f1f5;
  --button-hover-text:#17394b;
  --button-hover-border:#488c99;
  --button-danger-bg:#fce7ed;
  --button-danger-text:#84283e;
  --button-save-bg:#ddf3e7;
  --button-save-text:#194c36;
  --button-muted-text:#52677b;
  --button-accent-text:#096d78;
}
@media screen {
  /* Keep color changes immediate when switching themes; retain motion/shadow feedback. */
  html:root[data-theme] body :is(#app,dialog,[role="dialog"],#trial-balance-preview) button {
    transition-property:transform,box-shadow,border-color!important;
    transition-duration:.14s!important;
  }
  /* Older shared cards used fixed dark-theme text in their light presentation. */
  #app :is(.quick-action,.module-card) small { color:var(--button-muted-text); }
  :root[data-theme="light"] #app :is(.text-button,.stock-client-picker-button,.modern-calendar-view-switch button.active,[data-calendar-action="clear-filters"],[data-stock-action="add-line"],.financial-report-home-card b,.accounting-map-button>span) { color:var(--button-accent-text)!important; }
  :root[data-theme="light"] #app .inventory-export-actions button { background:#f5f9fc;color:var(--text);border-color:var(--line); }
  :root[data-theme="light"] #app .insight-panel button { color:var(--text); }
  html:root[data-theme="light"] body #app .asset-delete-master:not(:disabled) { color:var(--button-danger-text)!important; }
  html:root[data-theme="light"] body #app .assets-editor-tabs button { color:var(--button-muted-text)!important; }
  html:root[data-theme="light"] body #app .assets-editor-tabs button[aria-selected="true"] { color:var(--button-accent-text)!important; }
  :root[data-theme="light"] #app .module-card { background:#fff;color:var(--text); }
  :root[data-theme="light"] #app .table-row { color:var(--text); }
  :root[data-theme="light"] #app .table-row strong { color:inherit; }
  :root[data-theme="light"] #app .table-row .status.posted { color:#146b4d; }
  :root[data-theme="light"] #app .table-row .status.approved { color:#57419b; }
  :root[data-theme="light"] #app .table-row .status.draft { color:#875014; }
  html:root[data-theme] body :is(#app,dialog,[role="dialog"],#trial-balance-preview) button:enabled:is(:hover,:focus-visible) {
    background:var(--button-hover-bg)!important;
    color:var(--button-hover-text)!important;
    -webkit-text-fill-color:currentColor!important;
    border-color:var(--button-hover-border)!important;
    box-shadow:0 3px 12px #12273518!important;
    filter:none!important;
  }
  html:root[data-theme] body :is(#app,dialog,[role="dialog"],#trial-balance-preview) button:enabled:is(:hover,:focus-visible) :is(span,strong,small,b,em,i) {
    color:inherit!important;
    -webkit-text-fill-color:currentColor!important;
  }
  html:root[data-theme] body :is(#app,dialog,[role="dialog"],#trial-balance-preview) button:is(.danger,.delete,.close,.voucher-line-delete,.pos-remove-line,.pos-remove-payment):enabled:is(:hover,:focus-visible) {
    background:var(--button-danger-bg)!important;
    color:var(--button-danger-text)!important;
    border-color:var(--button-danger-text)!important;
  }
  html:root[data-theme] body :is(#app,dialog,[role="dialog"],#trial-balance-preview) button.save:enabled:is(:hover,:focus-visible) {
    background:var(--button-save-bg)!important;
    color:var(--button-save-text)!important;
    border-color:var(--button-save-text)!important;
  }
  html:root[data-theme] body button:focus-visible {
    outline:2px solid var(--button-hover-border);
    outline-offset:3px;
  }
}
