/* ==========================================================================
   One Exchange brand palette
   Royal Indigo-Violet  #6D28D9  +  Warm Amber Gold  #F59E0B
   Loaded after the compiled bundles and the fintech theme. Layout-neutral.
   ========================================================================== */

:root {
  --brand: #6D28D9 !important;
  --brand-d: #5B21B6 !important;
  --brand-soft: rgba(109, 40, 217, 0.12) !important;
  --pk-primary: #6D28D9;
  --pk-primary-d: #5B21B6;
  --pk-primary-soft: rgba(109, 40, 217, 0.12);
  --pk-accent: #F59E0B !important;
  --pk-accent-d: #D97706 !important;
  --pk-accent-soft: rgba(245, 158, 11, 0.14) !important;
  --pk-canvas: #F8FAFC !important;
  --pk-surface: #FFFFFF !important;
  --pk-ink: #0F172A !important;
  --pk-ink-2: #475569 !important;
  --pk-border: #E2E8F0 !important;
  --pk-success: #10B981;
  --pk-danger: #EF4444;
  --pk-pending: #F59E0B;
  --pk-ring: rgba(109, 40, 217, 0.35) !important;
}

html.dark,
.dark {
  --pk-primary: #6D28D9;
  --pk-primary-d: #5B21B6;
  --pk-primary-soft: rgba(109, 40, 217, 0.22);
  --pk-accent: #F59E0B !important;
  --pk-accent-d: #D97706 !important;
  --pk-accent-soft: rgba(245, 158, 11, 0.18) !important;
  --pk-canvas: #0B0F19 !important;
  --pk-surface: #131826 !important;
  --pk-ink: #F8FAFC !important;
  --pk-ink-2: #94A3B8 !important;
  --pk-border: #1E293B !important;
  --pk-ring: rgba(139, 92, 246, 0.45) !important;
}

/* --- Solid canvas ------------------------------------------------------- */
html,
body {
  background-color: var(--pk-canvas) !important;
  background-image: none !important;
}

html.dark,
html.dark body,
:is(html.dark, .dark) #root,
:is(html.dark, .dark) main {
  background-color: #0B0F19 !important;
  background-image: none !important;
  color: #F8FAFC;
}

/* --- Primary utilities (compiled Tailwind) ------------------------------ */
.bg-primary-50 { background-color: #F5F3FF !important; }
.bg-primary-100 { background-color: #EDE9FE !important; }
.bg-primary-500,
.bg-primary-600 {
  background-color: #6D28D9 !important;
  color: #FFFFFF !important;
}
.bg-primary-700 { background-color: #5B21B6 !important; color: #FFFFFF !important; }
.bg-primary-800 { background-color: #4C1D95 !important; color: #FFFFFF !important; }

.hover\:bg-primary-600:hover,
.hover\:bg-primary-700:hover,
button.bg-primary-600:hover,
a.bg-primary-600:hover,
button[class*="bg-primary"]:hover,
a[class*="bg-primary"]:hover {
  background-color: #5B21B6 !important;
  background-image: none !important;
}

.text-primary-500,
.text-primary-600 { color: #6D28D9 !important; }
.text-primary-700,
.text-primary-800 { color: #5B21B6 !important; }

.border-primary-100 { border-color: #EDE9FE !important; }
.border-primary-200 { border-color: #DDD6FE !important; }
.border-primary-500,
.border-primary-600,
.border-primary-700 { border-color: #6D28D9 !important; }

.ring-primary-100 { --tw-ring-color: #EDE9FE !important; }
.ring-primary-500,
.ring-primary-600 { --tw-ring-color: #6D28D9 !important; }

.from-primary-500,
.from-primary-600 { --tw-gradient-from: #6D28D9 !important; --tw-gradient-to: #6D28D900 !important; }
.to-primary-600,
.to-primary-700,
.to-primary-800 { --tw-gradient-to: #5B21B6 !important; }

/* Admin v4 paints every bg-primary button as a green gradient. Replace it. */
button[class*="bg-primary"],
[class*="bg-primary"][role="button"],
a[class*="bg-primary"] {
  background: linear-gradient(180deg, #7C3AED 0%, #6D28D9 100%) !important;
  border-color: #6D28D9 !important;
  color: #FFFFFF !important;
}

/* --- Focus rings -------------------------------------------------------- */
:where(a, button, [role="button"], input, select, textarea, summary):focus-visible {
  outline-color: var(--pk-primary) !important;
}
main input:focus-visible,
main select:focus-visible,
main textarea:focus-visible {
  border-color: #6D28D9 !important;
  box-shadow: 0 0 0 3px rgba(109, 40, 217, 0.18) !important;
}
html.dark main input:focus-visible,
html.dark main select:focus-visible,
html.dark main textarea:focus-visible {
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.28) !important;
}

/* --- Active navigation -------------------------------------------------- */
#pk-legacy-menu .pk-lm-a.pk-lm-active,
#pk-legacy-menu .pk-lm-btn.pk-lm-active,
#pk-legacy-menu .pk-lm-a.pk-lm-active:hover,
#pk-legacy-menu .pk-lm-btn.pk-lm-active:hover,
#pk-topnav .pk-nav-active,
#pk-topnav .pk-nav-active:hover,
.pk-topnav-link.is-active,
.pk-topnav-item.open > .pk-topnav-group,
#pk-admin-sidebar a.is-active,
#pk-admin-sidebar a[aria-current="page"] {
  background-color: #6D28D9 !important;
  border-color: #6D28D9 !important;
  color: #FFFFFF !important;
}

#pk-legacy-menu .pk-lm-a.pk-lm-active *,
#pk-topnav .pk-nav-active *,
.pk-topnav-link.is-active * {
  color: #FFFFFF !important;
}

/* --- Amber accent ------------------------------------------------------- */
.pkdx-kpi--accent {
  border-color: rgba(245, 158, 11, 0.35) !important;
}
.pkdx-kpi--accent .pkdx-kpi__value,
.pkdx-kpi--accent .pkdx-kpi__icon {
  color: #B45309 !important;
}
html.dark .pkdx-kpi--accent .pkdx-kpi__value,
html.dark .pkdx-kpi--accent .pkdx-kpi__icon {
  color: #FBBF24 !important;
}

.pk-accent,
.badge-accent,
.tag-accent,
.pk-pro,
.pk-vip,
.pk-wallet-accent,
.pk-commission {
  background-color: var(--pk-accent-soft) !important;
  border-color: rgba(245, 158, 11, 0.42) !important;
  color: #B45309 !important;
}
html.dark .pk-accent,
html.dark .badge-accent,
html.dark .tag-accent,
html.dark .pk-pro,
html.dark .pk-vip,
html.dark .pk-wallet-accent,
html.dark .pk-commission {
  color: #FCD34D !important;
}

/* Amber buttons/accents must use dark text for contrast. */
.bg-amber-500,
.bg-accent,
.pk-btn-accent {
  color: #0F172A !important;
}
html.dark .bg-amber-500,
html.dark .bg-accent,
html.dark .pk-btn-accent {
  color: #0F172A !important;
}

/* --- Semantic status badges -------------------------------------------- */
.status-badge.approved,
.status-badge.active {
  color: #065F46 !important;
  background: #D1FAE5 !important;
}
.status-badge.pending {
  color: #92400E !important;
  background: #FEF3C7 !important;
}
.status-badge.rejected,
.status-badge.failed {
  color: #991B1B !important;
  background: #FEE2E2 !important;
}
html.dark .status-badge.approved,
html.dark .status-badge.active {
  color: #6EE7B7 !important;
  background: rgba(16, 185, 129, 0.16) !important;
}
html.dark .status-badge.pending {
  color: #FCD34D !important;
  background: rgba(245, 158, 11, 0.16) !important;
}
html.dark .status-badge.rejected,
html.dark .status-badge.failed {
  color: #FCA5A5 !important;
  background: rgba(239, 68, 68, 0.16) !important;
}

/* --- Dark neutral surfaces --------------------------------------------- */
:is(html.dark, .dark) main .bg-white,
:is(html.dark, .dark) main .bg-white\/80,
:is(html.dark, .dark) main .bg-white\/90 {
  background-color: #131826 !important;
}

:is(html.dark, .dark) main .bg-slate-50,
:is(html.dark, .dark) main .bg-gray-50,
:is(html.dark, .dark) main .bg-slate-100,
:is(html.dark, .dark) main .bg-gray-100 {
  background-color: #0F1522 !important;
}

:is(html.dark, .dark) main .border-slate-100,
:is(html.dark, .dark) main .border-slate-200,
:is(html.dark, .dark) main .border-slate-300,
:is(html.dark, .dark) main .border-gray-100,
:is(html.dark, .dark) main .border-gray-200,
:is(html.dark, .dark) main .border-gray-300 {
  border-color: #1E293B !important;
}

:is(html.dark, .dark) main table thead th {
  background: #131826 !important;
  color: #94A3B8 !important;
  border-color: #1E293B !important;
}
:is(html.dark, .dark) main table tbody tr {
  border-color: #1E293B !important;
}
:is(html.dark, .dark) main table tbody tr:hover {
  background: #1A2130 !important;
}
:is(html.dark, .dark) main input,
:is(html.dark, .dark) main select,
:is(html.dark, .dark) main textarea {
  background-color: #0F1522 !important;
  border-color: #1E293B !important;
  color: #F8FAFC !important;
}

:is(html.dark, .dark) aside,
:is(html.dark, .dark) #pk-legacy-menu,
:is(html.dark, .dark) #pk-admin-sidebar,
:is(html.dark, .dark) header,
:is(html.dark, .dark) #pk-admin-topnav {
  background-color: #131826 !important;
  border-color: #1E293B !important;
}

/* Compiled dark arbitrary backgrounds: keep cards and tables solid #131826. */
:is(html.dark, .dark) [class*="dark:bg-[#0b0e1e]"],
:is(html.dark, .dark) [class*="dark:bg-[#0d1629]"],
:is(html.dark, .dark) [class*="dark:bg-[#0d1424]"],
:is(html.dark, .dark) [class*="dark:bg-[#0f172a]"],
:is(html.dark, .dark) [class*="dark:bg-[#0f162a]"],
:is(html.dark, .dark) [class*="dark:bg-[#111827]"],
:is(html.dark, .dark) [class*="dark:bg-[#09101f]"],
:is(html.dark, .dark) [class*="dark:bg-slate-900"],
:is(html.dark, .dark) [class*="dark:bg-gray-900"] {
  background-color: #131826 !important;
}
:is(html.dark, .dark) [class*="dark:bg-[#060912]"],
:is(html.dark, .dark) [class*="dark:bg-[#06070d]"] {
  background-color: #0B0F19 !important;
}
:is(html.dark, .dark) [class*="dark:bg-slate-800"],
:is(html.dark, .dark) [class*="dark:bg-gray-800"] {
  background-color: #1A2130 !important;
}

/* --- Keep logos clean on both themes ----------------------------------- */
.pk-brand-logo {
  max-height: 40px;
  width: auto;
}
html.dark .pk-brand-logo {
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35));
}
