/*
 * Cashback Pro V36.7.143 — All tables, one continuous header gradient.
 *
 * Root cause confirmed from the shipped cascade:
 * V115 sets a separate `background: linear-gradient(...) !important` on
 * `html body.theme-*.custom-table thead th`. The V142 TH reset did not have
 * equal specificity, so V115 continued painting each cell independently.
 *
 * This patch:
 * - gives every full header TR one theme-colored gradient;
 * - makes every TH/TD in every table header transparent with stronger
 *   specificity than V115 and the themed admin table selectors;
 * - loads V143 after theme CSS and places V139 immediately before it, so the
 *   account popover repair is retained without competing with table rules.
 */

/* A common row layout; do not paint thead or individual header cells. */
html body table:not(#v143-no-table) thead:not(#v143-no-head),
html body table:not(#v143-no-table) thead:not(#v143-no-head) tr:not(#v143-no-row) {
  background-color: transparent !important;
}

/*
 * The repeated :not(#v143-no-match) tokens deliberately raise specificity.
 * No real element has this reserved ID; therefore every table header cell
 * matches and old selectors containing theme classes / admin pane IDs cannot
 * reintroduce a per-column background.
 */
html body table thead tr > th:not(#v143-no-match):not(#v143-no-match):not(#v143-no-match):not(#v143-no-match):not(#v143-no-match):not(#v143-no-match),
html body table thead tr > td:not(#v143-no-match):not(#v143-no-match):not(#v143-no-match):not(#v143-no-match):not(#v143-no-match):not(#v143-no-match),
html body table thead th:not(#v143-no-match):not(#v143-no-match):not(#v143-no-match):not(#v143-no-match):not(#v143-no-match):not(#v143-no-match),
html body table thead td:not(#v143-no-match):not(#v143-no-match):not(#v143-no-match):not(#v143-no-match):not(#v143-no-match):not(#v143-no-match) {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  background-blend-mode: normal !important;
}

/* The row is the sole owner of the continuous gradient and animation. */
html body table thead tr:not(#v143-no-row):not(#v143-no-row):not(#v143-no-row):not(#v143-no-row) {
  background-color: transparent !important;
  background-image: linear-gradient(
    112deg,
    rgba(66, 132, 189, .48) 0%,
    rgba(104, 116, 190, .39) 48%,
    rgba(139, 91, 169, .44) 100%
  ) !important;
  background-repeat: no-repeat !important;
  background-size: 280% 100% !important;
  background-position: 0% 50%;
  animation: v367143WholeTableHeaderFlow 18s ease-in-out infinite alternate !important;
}

/* Default light */
html body.default-light-mode table thead tr:not(#v143-no-row):not(#v143-no-row):not(#v143-no-row):not(#v143-no-row),
html body.theme-default.default-light-mode table thead tr:not(#v143-no-row):not(#v143-no-row):not(#v143-no-row):not(#v143-no-row) {
  background-image: linear-gradient(
    112deg,
    rgba(156, 194, 229, .50) 0%,
    rgba(181, 183, 226, .42) 50%,
    rgba(174, 213, 207, .48) 100%
  ) !important;
}

/* Default dark */
html body.default-dark-mode table thead tr:not(#v143-no-row):not(#v143-no-row):not(#v143-no-row):not(#v143-no-row),
html body.theme-default:not(.default-light-mode) table thead tr:not(#v143-no-row):not(#v143-no-row):not(#v143-no-row):not(#v143-no-row) {
  background-image: linear-gradient(
    112deg,
    rgba(48, 100, 151, .48) 0%,
    rgba(82, 91, 159, .40) 50%,
    rgba(119, 79, 151, .45) 100%
  ) !important;
}

/* Halloween */
html body.theme-halloween table thead tr:not(#v143-no-row):not(#v143-no-row):not(#v143-no-row):not(#v143-no-row),
html body.halloween-active table thead tr:not(#v143-no-row):not(#v143-no-row):not(#v143-no-row):not(#v143-no-row) {
  background-image: linear-gradient(
    112deg,
    rgba(128, 72, 157, .50) 0%,
    rgba(98, 61, 133, .42) 49%,
    rgba(174, 91, 105, .47) 100%
  ) !important;
}

/* Winter */
html body.theme-winter table thead tr:not(#v143-no-row):not(#v143-no-row):not(#v143-no-row):not(#v143-no-row) {
  background-image: linear-gradient(
    112deg,
    rgba(47, 117, 174, .50) 0%,
    rgba(72, 121, 177, .42) 49%,
    rgba(65, 165, 187, .47) 100%
  ) !important;
}

/* Ocean / Underwater */
html body.theme-ocean table thead tr:not(#v143-no-row):not(#v143-no-row):not(#v143-no-row):not(#v143-no-row),
html body.theme-dai-duong table thead tr:not(#v143-no-row):not(#v143-no-row):not(#v143-no-row):not(#v143-no-row) {
  background-image: linear-gradient(
    112deg,
    rgba(9, 125, 137, .50) 0%,
    rgba(13, 100, 137, .42) 49%,
    rgba(48, 157, 163, .47) 100%
  ) !important;
}

/* Keep existing text contrast and cell separators. Only backgrounds are reset. */
html body table thead tr > th,
html body table thead tr > td {
  background-clip: border-box !important;
}

@keyframes v367143WholeTableHeaderFlow {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 52% 50%; }
  100% { background-position: 100% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  html body table thead tr {
    animation: none !important;
    background-position: 50% 50%;
  }
}
