/* ==========================================================================
   PayKaro Exchange - Fintech SaaS theme (User Panel)
   Loaded after the compiled bundles. Safe, targeted overrides only:
   no global element colour rules, no font-size changes, no truncation.
   ========================================================================== */

:root {
  --pk-canvas: #f8fafc;
  --pk-surface: #ffffff;
  --pk-border: #e2e8f0;
  --pk-border-strong: #cbd5e1;
  --pk-ink: #0f172a;
  --pk-ink-2: #334155;
  --pk-ink-3: #64748b;
  --pk-brand: var(--pk-primary, #065f46);
  --pk-brand-hover: color-mix(in srgb, var(--pk-primary, #065f46) 82%, #000);
  --pk-brand-soft: color-mix(in srgb, var(--pk-primary, #065f46) 12%, #ffffff);
  --pk-success: #166534;
  --pk-success-bg: #dcfce7;
  --pk-warn: #92400e;
  --pk-warn-bg: #fef3c7;
  --pk-danger: #991b1b;
  --pk-danger-bg: #fee2e2;
  --pk-radius: 14px;
  --pk-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 12px rgba(15, 23, 42, 0.06);
  --pk-shadow-lg: 0 18px 40px -24px rgba(15, 23, 42, 0.35);
}

html,
body {
  background-color: var(--pk-canvas);
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Focus visibility (accessibility) ------------------------------------ */
:where(a, button, [role="button"], input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--pk-brand);
  outline-offset: 2px;
}

/* --- Cards: crisp white surface with a visible edge ---------------------- */
main .bg-white.rounded-2xl,
main .bg-white.rounded-xl,
main .bg-white.rounded-lg,
main .bg-white[class*="shadow"] {
  border: 1px solid var(--pk-border) !important;
  box-shadow: var(--pk-shadow) !important;
}

/* --- Tables ------------------------------------------------------------- */
/* Table shells on bare pages (Downloads, Logs, Sessions, API settings, …) sit
   straight on the page background, so the photo showed through the rows. */
main .overflow-x-auto.rounded-xl.border {
  background: var(--pk-surface);
  border-color: var(--pk-border);
}

main table thead th {
  color: var(--pk-ink);
  font-weight: 700;
  letter-spacing: 0.02em;
}

main table tbody tr {
  border-color: var(--pk-border);
}

/* --- Inputs ------------------------------------------------------------- */
main input:focus-visible,
main select:focus-visible,
main textarea:focus-visible {
  border-color: var(--pk-brand);
  box-shadow: 0 0 0 3px rgba(6, 95, 70, 0.16);
}

/* ==========================================================================
   Dashboard Pro  (mounted by /dashboard-pro.js)
   ========================================================================== */

main.pkdx-on > *:not(#pk-dash-pro) {
  display: none !important;
}

/* Hide the legacy React dashboard while the new dashboard is loading so the
   old "Welcome back / Quick Actions" screen never flashes on first paint. */
html.pkdx-booting main > *:not(#pk-dash-pro) {
  display: none !important;
}

html.pkdx-booting main::before {
  content: "Loading dashboard…";
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--pk-ink-3);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

#pk-dash-pro.pkdx {
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-width: 0;
  color: var(--pk-ink);
  animation: pkdx-in 240ms ease-out both;
}

@keyframes pkdx-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.pkdx * {
  box-sizing: border-box;
}

.pkdx-card {
  background: var(--pk-surface);
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow);
  min-width: 0;
}

/* --- Hero ---------------------------------------------------------------- */
.pkdx-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: clamp(14px, 1.5vw, 20px);
  border-radius: 18px;
  color: #ffffff;
  background: linear-gradient(
    135deg,
    var(--pk-primary, #065f46) 0%,
    color-mix(in srgb, var(--pk-primary, #065f46) 78%, #000) 100%
  );
  box-shadow: 0 20px 44px -28px color-mix(in srgb, var(--pk-primary, #065f46) 85%, transparent);
}

.pkdx-hero::after {
  content: "";
  position: absolute;
  inset: -40% -10% auto auto;
  width: 340px;
  height: 340px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0) 68%);
  pointer-events: none;
}

.pkdx-hero__body {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.pkdx-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}

.pkdx-hero h1 {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.2;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.pkdx-verify {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  cursor: help;
}

.pkdx-verify.is-ok {
  background: rgba(74, 222, 128, 0.18);
  border: 1px solid rgba(134, 239, 172, 0.65);
  color: #bbf7d0;
}

.pkdx-verify.is-bad {
  background: rgba(248, 113, 113, 0.18);
  border: 1px solid rgba(252, 165, 165, 0.65);
  color: #fecaca;
}

.pkdx-hero h1 span {
  color: #ffffff;
}

.pkdx-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 9px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.pkdx-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pkdx-badge--ok {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #ffffff;
}

.pkdx-badge--pending {
  background: rgba(254, 243, 199, 0.14);
  border: 1px solid rgba(254, 243, 199, 0.42);
  color: #fde68a;
}

.pkdx-hero__side {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  min-width: 0;
}

.pkdx-wallets {
  display: flex;
  flex-direction: row;
  gap: 10px;
}

.pkdx-wallet {
  flex: 1 1 0;
  min-width: 168px;
  padding: 9px 11px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(2px);
}

.pkdx-wallet__label {
  display: block;
  margin-bottom: 4px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.pkdx-wallet__rows {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pkdx-wallet__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
}

.pkdx-wallet__row span {
  font-weight: 600;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.04em;
}

.pkdx-wallet__row b {
  font-weight: 700;
  color: #ffffff;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pkdx-actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pkdx-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 11px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease, border-color 150ms ease;
}

.pkdx-action:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
}

.pkdx-action:active {
  transform: translateY(1px);
}

.pkdx-action--primary {
  background: #ffffff;
  border-color: #ffffff;
  color: var(--pk-brand);
}

.pkdx-action--primary:hover {
  background: #f0fdf4;
  border-color: #f0fdf4;
  color: var(--pk-brand);
}

.pkdx-action svg {
  flex: none;
}

/* --- KPI grid ------------------------------------------------------------ */
.pkdx-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.pkdx-kpi {
  position: relative;
  background: var(--pk-surface);
  border: 1px solid var(--pk-border);
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow);
  padding: 16px 18px 15px;
  min-width: 0;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.pkdx-kpi:hover {
  transform: translateY(-2px);
  border-color: var(--pk-border-strong);
  box-shadow: var(--pk-shadow-lg);
}

.pkdx-kpi__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.pkdx-kpi__label {
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pk-ink-3);
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.pkdx-kpi__icon {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--pk-brand-soft);
  color: var(--pk-brand);
}

.pkdx-kpi__value {
  margin-top: 10px;
  font-size: clamp(22px, 1.9vw, 27px);
  line-height: 1.15;
  font-weight: 700;
  color: var(--pk-ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
}

.pkdx-kpi__sub {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--pk-ink-3);
}

.pkdx-kpi--accent {
  background: linear-gradient(
    180deg,
    #ffffff 0%,
    color-mix(in srgb, var(--pk-primary, #065f46) 8%, #ffffff) 100%
  );
}

/* --- Bottom split -------------------------------------------------------- */
.pkdx-bottom {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
  gap: 16px;
  align-items: start;
}

.pkdx-side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.pkdx-panel {
  padding: 18px 20px 20px;
}

.pkdx-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.pkdx-panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--pk-ink);
}

.pkdx-panel__sub {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--pk-ink-3);
}

.pkdx-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--pk-ink-2);
}

.pkdx-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pkdx-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.pkdx-chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}

.pkdx-chart text {
  font-family: inherit;
}

.pkdx-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  color: var(--pk-ink-3);
  font-size: 13px;
  text-align: center;
  border: 1px dashed var(--pk-border);
  border-radius: 12px;
  background: #fcfdfe;
  padding: 16px;
}

/* --- Promo carousel ------------------------------------------------------ */
.pkdx-promo {
  padding: 0;
  overflow: hidden;
}

.pkdx-promo__track {
  position: relative;
  aspect-ratio: 16 / 8;
  background: linear-gradient(135deg, #065f46, #047857);
}

.pkdx-promo__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 420ms ease;
  display: flex;
}

.pkdx-promo__slide.is-active {
  opacity: 1;
}

.pkdx-promo__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pkdx-promo__fallback {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 20px;
  color: #ffffff;
}

.pkdx-promo__fallback strong {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
}

.pkdx-promo__fallback span {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
}

.pkdx-promo__fallback .pkdx-promo__eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
}

.pkdx-promo__dots {
  position: absolute;
  left: 12px;
  bottom: 10px;
  display: flex;
  gap: 6px;
  z-index: 2;
}

.pkdx-promo__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  padding: 0;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.pkdx-promo__dot.is-active {
  background: #ffffff;
  width: 18px;
  border-radius: 999px;
}

/* --- Donut --------------------------------------------------------------- */
.pkdx-usage {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
}

.pkdx-usage__chart {
  width: 128px;
  height: 128px;
}

.pkdx-usage__legend {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 12.5px;
}

.pkdx-usage__legend li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--pk-ink-2);
}

.pkdx-usage__legend b {
  font-variant-numeric: tabular-nums;
  color: var(--pk-ink);
}

.pkdx-usage__name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

/* --- Loading skeleton ---------------------------------------------------- */
.pkdx-skeleton {
  border-radius: var(--pk-radius);
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: pkdx-shimmer 1.4s ease infinite;
}

@keyframes pkdx-shimmer {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* --- Responsive ---------------------------------------------------------- */
@media (max-width: 1180px) {
  .pkdx-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .pkdx-bottom {
    grid-template-columns: minmax(0, 1fr);
  }
  .pkdx-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .pkdx-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .pkdx-hero__side {
    align-items: stretch;
  }
  .pkdx-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 720px) {
  .pkdx-side {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 560px) {
  .pkdx-kpis {
    grid-template-columns: minmax(0, 1fr);
  }
  .pkdx-wallets {
    flex-direction: column;
  }
  .pkdx-wallet {
    min-width: 0;
  }
  .pkdx-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .pkdx-action {
    width: 100%;
    justify-content: center;
  }
  .pkdx-usage {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
  }
  .pkdx-usage__legend {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  #pk-dash-pro.pkdx,
  .pkdx-skeleton {
    animation: none;
  }
  .pkdx-promo__slide,
  .pkdx-kpi,
  .pkdx-action {
    transition: none;
  }
}

/* ==========================================================================
   Live desk: LIVE BUYER / LIVE SELLER strip + transaction tables
   ========================================================================== */

.pkdx-livebar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 26px;
  padding: 12px 18px;
  background: var(--pk-surface);
  border: 1px solid var(--pk-border) !important;
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow);
}

.pkdx-livegroup {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.pkdx-livegroup + .pkdx-livegroup {
  padding-left: 26px;
  border-left: 1px solid var(--pk-border);
}

.pkdx-live-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.pkdx-live-dot--buyer {
  background: #065f46;
  box-shadow: 0 0 0 3px rgba(6, 95, 70, 0.14);
}

.pkdx-live-dot--seller {
  background: #0ea5e9;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}

.pkdx-live-name {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--pk-ink-3);
  white-space: nowrap;
}

.pkdx-live-count {
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--pk-border);
  background: #f1f5f9;
  font-size: 12px;
  font-weight: 700;
  color: var(--pk-ink);
  font-variant-numeric: tabular-nums;
}

.pkdx-live-balance {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--pk-ink-3);
  white-space: nowrap;
}

.pkdx-live-balance b {
  margin-left: 4px;
  color: var(--pk-ink);
  font-variant-numeric: tabular-nums;
}

.pkdx-live-tables {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.pkdx-live-card {
  min-width: 0;
  overflow: hidden;
  background: var(--pk-surface);
  border: 1px solid var(--pk-border) !important;
  border-radius: var(--pk-radius);
  box-shadow: var(--pk-shadow);
}

.pkdx-live-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding: 12px 16px;
  background: #1e293b;
  color: #ffffff;
}

.pkdx-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #dc2626;
  color: #ffffff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.pkdx-live-pill i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
  animation: pkdx-pulse 1.6s ease-in-out infinite;
}

.pkdx-live-sub,
.pkdx-live-updated {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}

.pkdx-live-title {
  flex: 1 1 auto;
  min-width: 150px;
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  text-align: center;
}

.pkdx-live-updated {
  margin-left: auto;
}

.pkdx-live-updated b {
  color: #ffffff;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.pkdx-table-wrap {
  overflow-x: auto;
}

.pkdx-table {
  width: 100%;
  min-width: 1180px;
  border-collapse: collapse;
  font-size: 12.5px;
}

.pkdx-table thead th {
  position: static;
  padding: 10px 12px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--pk-border);
  color: var(--pk-ink-2);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
  white-space: nowrap;
}

.pkdx-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef2f7;
  color: var(--pk-ink-2);
  white-space: nowrap;
  vertical-align: middle;
}

.pkdx-table tbody tr:last-child td {
  border-bottom: 0;
}

.pkdx-table tbody tr.is-success {
  background: #f0fdf4;
}

.pkdx-table tbody tr.is-failure {
  background: #fef2f2;
}

.pkdx-table tbody tr.is-pending {
  background: #fffbeb;
}

.pkdx-cell-id {
  font-weight: 600;
  color: var(--pk-ink);
}

.pkdx-cell-num,
.pkdx-cell-amount,
.pkdx-cell-margin {
  font-variant-numeric: tabular-nums;
}

.pkdx-cell-amount {
  font-weight: 600;
  color: var(--pk-ink);
}

.pkdx-status {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.pkdx-status--success {
  color: #166534;
}

.pkdx-status--failure {
  color: #991b1b;
}

.pkdx-status--pending {
  color: #92400e;
}

.pkdx-status--muted {
  color: var(--pk-ink-3);
}

.pkdx-live-empty td {
  padding: 26px 12px !important;
  background: var(--pk-surface);
  color: var(--pk-ink-3) !important;
  font-size: 13px;
  text-align: center !important;
}

@keyframes pkdx-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

@media (max-width: 720px) {
  .pkdx-livegroup + .pkdx-livegroup {
    padding-left: 0;
    border-left: 0;
  }

  .pkdx-live-head {
    gap: 6px 10px;
  }

  .pkdx-live-title {
    order: 3;
    flex-basis: 100%;
    text-align: left;
  }

  .pkdx-live-updated {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pkdx-live-pill i {
    animation: none;
  }
}

/* ==========================================================================
   Phone + KYC tick (green verified / red pending)
   ========================================================================== */

.pkdx-phone {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pkdx-phone__num {
  font-variant-numeric: tabular-nums;
}

.pkdx-phone__tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  cursor: help;
}

.pkdx-phone__tick.is-ok {
  background: rgba(74, 222, 128, 0.18);
  border: 1px solid rgba(134, 239, 172, 0.65);
  color: #bbf7d0;
}

.pkdx-phone__tick.is-bad {
  background: rgba(248, 113, 113, 0.18);
  border: 1px solid rgba(252, 165, 165, 0.65);
  color: #fecaca;
}

/* ==========================================================================
   Header notifications + live status
   ========================================================================== */

.pk-hdr-slot {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 0 1 auto;
  max-width: 100%;
}

.pk-hdr-pro {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 2px 0;
}

.pk-hdr-pro::-webkit-scrollbar {
  display: none;
}

.pk-hdr-notifs,
.pk-hdr-lives {
  display: flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

.pk-hdr-pro__sep {
  flex: none;
  width: 1px;
  height: 20px;
  margin: 0 3px;
  background: var(--pk-border);
}

.pk-hdr-chip,
.pk-hdr-live {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--pk-border);
  background: #ffffff;
  color: var(--pk-ink);
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease;
}

.pk-hdr-chip:hover,
.pk-hdr-live:hover {
  border-color: var(--pk-border-strong);
  background: #f8fafc;
}

.pk-hdr-chip__icon,
.pk-hdr-live__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.pk-hdr-chip__count,
.pk-hdr-live__count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* The row scrolls instead of squeezing the chips, so the counts never clip. */
.pk-hdr-chip,
.pk-hdr-live {
  flex: 0 0 auto;
}

.pk-hdr-chip--purchase-dispute {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.pk-hdr-chip--purchase-dispute .pk-hdr-chip__icon {
  color: #dc2626;
}

.pk-hdr-chip--purchase-pending {
  color: #92400e;
  border-color: #fde68a;
  background: #fffbeb;
}

.pk-hdr-chip--purchase-pending .pk-hdr-chip__icon {
  color: #d97706;
}

.pk-hdr-chip--sell-dispute {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.pk-hdr-chip--sell-dispute .pk-hdr-chip__icon {
  color: #2563eb;
}

.pk-hdr-chip--sell-pending {
  color: #166534;
  border-color: #bbf7d0;
  background: #f0fdf4;
}

.pk-hdr-chip--sell-pending .pk-hdr-chip__icon {
  color: #16a34a;
}

.pk-hdr-live {
  color: var(--pk-ink-2);
  text-decoration: none;
}

.pk-hdr-live__dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.pk-hdr-live.is-online .pk-hdr-live__dot {
  background: #16a34a;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16);
}

.pk-hdr-live.is-offline .pk-hdr-live__dot {
  background: #94a3b8;
}

.pk-hdr-live__icon {
  color: #64748b;
}

.pk-hdr-live.is-online .pk-hdr-live__icon {
  color: #15803d;
}

.pk-hdr-live.is-offline .pk-hdr-live__icon {
  color: #94a3b8;
}

@media (max-width: 1200px) {
  .pk-hdr-chip__label,
  .pk-hdr-live__label {
    display: none;
  }
  /* Without the label the "(0)" brackets only waste space and clip the count. */
  .pk-hdr-chip__paren {
    display: none;
  }
  .pk-hdr-chip {
    padding: 0 8px;
  }
}

@media (max-width: 900px) {
  .pk-hdr-slot {
    max-width: 58vw;
  }
}

@media (max-width: 560px) {
  .pk-hdr-slot {
    max-width: 52vw;
  }
}

/* ==========================================================================
   OneXchange sidebar branding
   ========================================================================== */

.pk-brand-logo {
  width: 40px !important;
  height: 40px !important;
  border-radius: 11px !important;
  background: linear-gradient(135deg, #065f46 0%, #047857 100%) !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden;
  flex: none;
  box-shadow: 0 6px 16px -8px rgba(6, 95, 70, 0.85);
}

.pk-brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* The logo asset is not deployed yet: without this the broken image shows its
   alt text ("OneXchange") clipped to "nex" on top of the monogram. */
.pk-brand-logo.is-fallback img {
  display: none !important;
}

/* Older pages can still load the duplicate sidebar renderer; it used to flash
   its "WALLET" section under the real menu on every load. */
#pk-xmenu {
  display: none !important;
}

/* The compiled React sidebar is replaced by #pk-legacy-menu (which honours the
   admin menu layout + permissions). Hide its sections from the first paint so
   they never flash below the real menu while the scripts boot. */
aside nav > div:not(#pk-legacy-menu):not(#pk-xmenu) {
  display: none !important;
}

.pk-brand-logo__fallback {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.pk-brand-logo.is-fallback .pk-brand-logo__fallback {
  display: inline-flex;
}

.pk-brand-sub {
  color: #94a3b8;
  text-decoration: none;
  transition: color 150ms ease;
}

.pk-brand-sub:hover {
  color: #e2e8f0;
  text-decoration: underline;
}

/* ==========================================================================
   Dark theme tokens for the OneXchange layer
   The app switches `html.dark`; our own tokens must follow, otherwise the
   card background turns dark while the text stays dark.
   ========================================================================== */

html.dark {
  --pk-canvas: #060912;
  --pk-surface: #0f172a;
  --pk-border: #1e293b;
  --pk-border-strong: #334155;
  --pk-ink: #e2e8f0;
  --pk-ink-2: #cbd5e1;
  --pk-ink-3: #94a3b8;
  --pk-brand-soft: color-mix(in srgb, var(--pk-primary, #065f46) 24%, transparent);
  --pk-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.35);
  --pk-shadow-lg: 0 18px 40px -24px rgba(0, 0, 0, 0.8);
}

html.dark .pkdx-kpi--accent {
  background: linear-gradient(
    180deg,
    #0f172a 0%,
    color-mix(in srgb, var(--pk-primary, #065f46) 18%, #0f172a) 100%
  ) !important;
}

html.dark .pkdx-usage__chart text {
  fill: #e2e8f0 !important;
}

html.dark .pkdx-usage__chart text:nth-of-type(2) {
  fill: #94a3b8 !important;
}

html.dark .pkdx-live-head {
  background: #111c31;
}

html.dark .pkdx-live-empty td {
  background: #0f172a !important;
}

html.dark .pk-hdr-chip {
  background: #111c31;
  border-color: #1e293b;
  color: #cbd5e1;
}

html.dark .pk-hdr-chip--purchase-dispute {
  background: #2a1215;
  border-color: #7f1d1d;
  color: #fca5a5;
}

html.dark .pk-hdr-chip--purchase-pending {
  background: #2a2210;
  border-color: #78350f;
  color: #fcd34d;
}

html.dark .pk-hdr-chip--sell-dispute {
  background: #111c31;
  border-color: #1e3a8a;
  color: #93c5fd;
}

html.dark .pk-hdr-chip--sell-pending {
  background: #0b2a20;
  border-color: #166534;
  color: #86efac;
}

html.dark .pk-hdr-live {
  background: #111c31;
  border-color: #1e293b;
  color: #cbd5e1;
}

html.dark .pk-hdr-live.is-offline .pk-hdr-live__dot {
  background: #475569;
}

/* Show the same groups as the top navigation in the sidebar */
#pk-legacy-menu {
  display: block !important;
}

/* Hide the BuySaleRecharge header/title and its HIDE toggle */
#pk-legacy-menu .pk-lm-title,
#pk-legacy-menu .pk-lm-toggle {
  display: none !important;
}

/* The HIDE state must never hide the menu body */
#pk-legacy-menu.pk-lm-hidden .pk-lm-body {
  display: block !important;
}

/* Remove the duplicated header sidebar toggle (the sidebar has its own collapse button) */
header > button:first-child {
  display: none !important;
}

/* Map the compiled app primary utility classes to the selected theme colour */
.bg-primary-500,
.bg-primary-600,
.bg-primary-700 {
  background-color: var(--pk-primary, #065f46) !important;
}

.text-primary-500,
.text-primary-600,
.text-primary-700 {
  color: var(--pk-primary, #065f46) !important;
}

.border-primary-500,
.border-primary-600,
.border-primary-700 {
  border-color: var(--pk-primary, #065f46) !important;
}

/* pk-auth-polish forces a green !important on non-dashboard primary buttons;
   override it with the selected theme colour. */
.pk-not-dash .bg-primary-500,
.pk-not-dash .bg-primary-600,
.pk-not-dash .bg-primary-700 {
  background-color: var(--pk-primary, #065f46) !important;
}

.pk-not-dash button.bg-primary-600,
.pk-not-dash a.bg-primary-600 {
  box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--pk-primary, #065f46) 65%, transparent) !important;
}

/* ==========================================================================
   Theme background images
   ========================================================================== */

:root {
  --pk-bg-image: url("https://pub-6bb8f8a8b79346c18682959a967415da.r2.dev/Background/eren-yildiz-ppSW3aYXat8-unsplash.webp");
  --pk-bg-overlay: rgba(248, 250, 252, 0.68);
}

html.dark {
  --pk-bg-image: url("https://pub-6bb8f8a8b79346c18682959a967415da.r2.dev/Background/ron-whitaker-mVuKCYMGZBM-unsplash.webp");
  --pk-bg-overlay: rgba(6, 9, 18, 0.62);
}

html,
body {
  background-color: var(--pk-canvas);
  background-image: linear-gradient(var(--pk-bg-overlay), var(--pk-bg-overlay)), var(--pk-bg-image) !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}

/* Let the image show through the app shell; cards keep their own surfaces. */
#root > .min-h-screen,
#root .min-h-screen,
#root main {
  background: transparent !important;
}
