/**
 * ATS plugin compatibility.
 *
 * Third-party UI that ships its own palette is corrected here rather than by
 * patching the plugin, so updates do not undo the work.
 *
 * Tokens only, no literals.
 */

/* ===============================================================
   WP Space Tracker — /vip/accounts/ and the track-record views

   The plugin already uses this design system's token names, but pins the light
   values onto its own container:
       .space-tracker-stats { --color-surface: #FFFFFF; --color-text: #475569; … }
   Because those are set on an element inside <html class="dark">, every child
   resolves the light palette regardless of the page theme — a white table with
   #475569 text on a #080b14 page, measured at 2.59:1 against a 4.5:1 minimum.

   Re-declaring the same custom properties for the dark theme restores the
   cascade. The plugin's own rules then paint themselves correctly, so almost
   none of them need overriding individually.
   =============================================================== */

.dark .space-tracker-stats {
  --color-brand: #00e68a;
  --color-brand-dark: #00b36b;
  --color-brand-accent: #00ff88;
  --color-brand-hover-shadow: rgba(0, 171, 228, 0.1);
  --color-body: #080b14;
  --color-bg: rgba(220, 230, 248, 0.06);
  --color-surface: #0d1220;
  --color-surface-2: #0b101d;
  --color-surface-alt: #0f1525;
  --color-surface-muted: rgba(255, 255, 255, 0.06);
  --color-title: #ffffff;
  --color-text: rgba(255, 255, 255, 0.72);
  --color-text-muted: rgba(255, 255, 255, 0.6);
  --color-border: rgba(255, 255, 255, 0.1);
}

/* The plugin marks profit and loss with !important, using values tuned for a
   light background. These are the same hues at dark-surface luminance. */
.dark .space-tracker-stats .positive {
  color: var(--color-success) !important;
}

.dark .space-tracker-stats .negative {
  color: var(--color-error) !important;
}

/* Figures are the reason the page exists, so they take the primary text
   colour rather than the muted body colour. */
.dark .space-tracker-stats .currency,
.dark .space-tracker-stats .percentage,
.dark .space-tracker-stats .trades,
.dark .space-tracker-stats .days {
  color: var(--color-title);
}

/* Table chrome. The plugin uses border-collapse, so the rounded container has
   to come from the wrapper. */
.dark .space-tracker-stats .accounts-table-container {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dark .space-tracker-stats .accounts-table th {
  background: var(--color-surface-alt);
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.dark .space-tracker-stats .accounts-table td {
  border-top: 1px solid var(--color-border);
}

/* Status row tints are low-alpha washes and read correctly over a dark
   surface, so they are left as the plugin defines them. */
