@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500;600&display=swap');

:root {
  color-scheme: light;
  --bg-deep: #f3f5f9;
  --bg-card: #ffffff;
  --text-main: #141b2f;
  --text-muted: #526079;
  --text-dim: #58657b;
  --primary: #253bb5;
  --secondary: #3c4f91;
  --border-glass: #dce2ed;
  --border: var(--border-glass);
  --border-neon: #aab7e5;
  --gold: #795423;
  --danger: #a22e34;
  --success: #2a623f;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 15px;
  --radius-full: 999px;
  --transition: 160ms ease;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; color: var(--text-main); background: var(--bg-deep); font: 400 14px/1.6 'Be Vietnam Pro', system-ui, sans-serif; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .65; }
:focus-visible { outline: 2px solid #2c45c4; outline-offset: 3px; }
.ui-icon { width: 19px; height: 19px; flex: none; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.container, .site-footer { width: min(1280px, 100% - 64px); margin-inline: auto; }
.navbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 30px;
  padding: 14px max(32px, calc((100% - 1280px) / 2));
  background: #ffffff;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-glass);
}
.brand-logo, .nav-link, .btn, .banner-link { text-decoration: none; }
.brand-logo, .nav-link, .nav-actions, .btn, .banner-link { display: inline-flex; align-items: center; gap: 8px; }
.brand-logo { gap: 10px; font-weight: 800; font-size: 18px; letter-spacing: -.05em; white-space: nowrap; }
.brand-name span { color: #465575; font-weight: 600; margin-left: 4px; }
.logo-icon { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; color: #ffdf65; background: #253bb5; }
.logo-icon .ui-icon { width: 20px; height: 20px; }
.nav-links { display: flex; gap: 2px; justify-content: center; }
.nav-link { white-space: nowrap; padding: 8px 10px; color: var(--text-muted); font-size: 13px; font-weight: 600; border-radius: 7px; }
.nav-link:hover, .nav-link.active { color: #243aa6; background: #edf0ff; }
.nav-actions { justify-content: flex-end; flex-wrap: wrap; }
.btn, .copy-btn, .cat-btn { color: var(--text-main); background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: 7px; font-weight: 600; }
.btn { justify-content: center; min-height: 40px; padding: 8px 13px; font-size: 13px; transition: background var(--transition), border-color var(--transition), transform var(--transition); }
.btn:not(:disabled):active, .copy-btn:active { transform: translateY(1px); }
.btn-primary { background: #253bb5; border-color: #253bb5; color: #fff; }
.btn-primary:not(:disabled):hover { background: #172990; }
.btn-secondary:not(:disabled):hover, .copy-btn:hover { background: #edf0ff; border-color: #aab7e5; }
.btn-gold { background: #f8eacc; }
.btn-sm { min-height: 34px; padding: 6px 10px; font-size: 12px; }
.btn svg, .cat-btn svg { width: 17px; height: 17px; }

.workspace-page { padding-top: 30px; }
.workspace-heading { margin-bottom: 21px; }
.workspace-heading h1 { font-size: clamp(28px, 4vw, 40px); }
.glass-panel { background: var(--bg-card); border: 1px solid var(--border-glass); border-radius: 12px; }
.workspace-page .page-intro { padding: 20px !important; margin-bottom: 18px !important; border-color: #d4ddf3 !important; background: #e9eefc; gap: 12px !important; }
.page-intro h2 { font-size: 20px !important; letter-spacing: -.03em; }
.page-intro > div { min-width: 0; overflow-wrap: anywhere; }
.wallet-layout { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(0, 2fr); gap: 18px; align-items: start; }
.wallet-layout .page-intro { display: grid !important; }
.wallet-layout .page-intro > div:last-child { text-align: left !important; border-top: 1px solid #d2dcf4; padding-top: 12px; }
.workspace-layout .page-tabs { border: 1px solid var(--border-glass); padding: 8px; border-radius: 10px; background: var(--bg-card); margin-bottom: 0 !important; }
.workspace-content { min-width: 0; }
.workspace-content .glass-panel, .deposit-panel { padding: clamp(15px, 3vw, 25px) !important; }
.workspace-content .glass-panel > div { flex-wrap: wrap; gap: 10px; }
.workspace-page h2 { font-size: 18px !important; line-height: 1.4; }
.workspace-page table { min-width: 640px; }
.workspace-page th { background: #edf1f9; color: #364666; font-size: 11px; }
.workspace-page td, .workspace-page th { border-bottom: 1px solid var(--border-glass); }
.workspace-page tbody tr:hover { background: #f2f5ff; }
#topup-crypto-section > div { grid-template-columns: repeat(auto-fit, minmax(min(100%, 275px), 1fr)) !important; }
#topup-crypto-section .form-control { min-width: 0; }
#topup-crypto-section > div > div > div:first-child { color: var(--primary) !important; }
.badge { display: inline-block; border-radius: 5px; background: #e9eefc; padding: 2px 6px; font-size: 11px; font-weight: 600; color: #304583; }
.badge-gold { color: #674519; background: #f8eacc; }
.form-group { margin-bottom: 15px; min-width: 0; }
.form-label { display: block; color: var(--text-muted); font-weight: 600; margin-bottom: 5px; font-size: 13px; }
.form-control { width: 100%; padding: 9px 11px; color: var(--text-main); background: #ffffff; border: 1px solid #cbd4e8; border-radius: 7px; }
.form-control:focus { outline: 2px solid #c9d4ff; outline-offset: 0; border-color: #6579cc; }
.modal-overlay, .modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  visibility: hidden;
  opacity: 0;
  background: rgba(19, 26, 56, 0.65);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: opacity 280ms cubic-bezier(.2, .8, .25, 1), visibility 280ms cubic-bezier(.2, .8, .25, 1), backdrop-filter 280ms ease, -webkit-backdrop-filter 280ms ease;
}
.modal-overlay.active, .modal-backdrop.active {
  opacity: 1;
  visibility: visible;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-content, .modal-box {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: calc(100dvh - 32px);
  overflow: auto;
  padding: 24px;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(17, 27, 68, 0.22);
  transform: scale(0.93) translateY(12px);
  opacity: 0;
  transition: transform 320ms cubic-bezier(.16, 1, .3, 1), opacity 260ms ease;
}
.modal-overlay.active .modal-content,
.modal-backdrop.active .modal-box {
  transform: scale(1) translateY(0);
  opacity: 1;
}
.modal-content > h2:first-of-type, .modal-title { color: var(--text-main) !important; padding-right: 34px; }
.modal-content [style*="color:#fff"], .modal-content [style*="color: #fff"] { color: var(--text-main) !important; }
.modal-header { margin-bottom: 18px; }
.modal-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 6px; background: #edf0f9; color: var(--text-main); border: 1px solid var(--border-glass); }
.modal-close:hover { background: #dfe6fb; }
.qr-container { margin: 14px 0; padding: 12px; background: #f3f6fc; border: 1px solid var(--border-glass); border-radius: 8px; }
.qr-image { display: block; width: min(100%, 220px); aspect-ratio: 1; height: auto; margin: 0 auto 10px; background: #fff; padding: 6px; border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.06); animation: qrPop 300ms cubic-bezier(.2, .8, .25, 1); }
.qr-copy-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 5px; padding: 7px; border-bottom: 1px solid var(--border-glass); text-align: left; font-size: 12px; }
.qr-copy-val { color: var(--primary); overflow-wrap: anywhere; font: 600 12px 'JetBrains Mono', monospace; }
.copy-btn { padding: 5px 8px; font-size: 12px; }
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 120; display: grid; gap: 10px; max-width: calc(100% - 40px); pointer-events: none; }
.toast {
  pointer-events: auto;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 9px;
  background: #ffffff;
  border: 1px solid var(--border-glass);
  box-shadow: 0 8px 28px rgba(17, 27, 68, 0.15);
  font-size: 13px;
  font-weight: 500;
  animation: toastSlideIn 320ms cubic-bezier(.175, .885, .32, 1.275) forwards;
  transition: opacity 240ms ease, transform 240ms ease;
}
.toast.toast-hiding {
  animation: toastSlideOut 240ms cubic-bezier(.4, 0, 1, 1) forwards;
}
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; margin-top: 40px; padding: 16px 0 22px; border-top: 1px solid var(--border-glass); color: var(--text-muted); font-size: 12px; }
.site-footer a { margin-right: 12px; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

@media (max-width: 1050px) {
  .navbar { column-gap: 12px; }
  .nav-link { padding-inline: 7px; }
}
@media (max-width: 850px) {
  .navbar { grid-template-columns: minmax(0, 1fr) auto; row-gap: 9px; padding: 10px 20px; }
  .nav-links { grid-row: 2; grid-column: 1 / -1; justify-content: flex-start; overflow-x: auto; }
  .container, .site-footer { width: calc(100% - 40px); }
  .workspace-layout { grid-template-columns: 168px minmax(0, 1fr); gap: 16px; }
}
@media (max-width: 640px) {
  .navbar { padding: 8px 12px; }
  .container, .site-footer { width: calc(100% - 24px); }
  .nav-link { font-size: 12px; }
  .nav-link .ui-icon { width: 15px; height: 15px; }
  .brand-logo { font-size: 16px; }
  .logo-icon { width: 31px; height: 31px; }
  .storefront, .workspace-page { padding-top: 13px; }
  .workspace-layout, .wallet-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .workspace-layout .page-tabs { display: flex !important; flex-wrap: wrap !important; }
  .cat-btn { white-space: nowrap; padding: 7px 8px; min-height: 36px; }
  .modal-content, .modal-box { padding: 16px; }
}
@media (max-width: 375px) {
  .brand-logo { gap: 5px; font-size: 14px; }
  .nav-actions { gap: 4px; }
  .nav-actions .btn { padding-inline: 6px; font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s !important; animation-duration: 0s !important; }
}


/* Store shortcuts and account activity */
[hidden] { display: none !important; }
.muted { color: var(--text-muted); }
.purchase-help { margin: 22px 0 0; }
.purchase-help details { padding: 13px 0; border-top: 1px solid var(--border-glass); }
.purchase-help details:last-child { border-bottom: 1px solid var(--border-glass); }
.purchase-help summary { cursor: pointer; font-weight: 700; }
.purchase-help details p, .purchase-help details ol { margin: 7px 0 0; color: var(--text-muted); }
.orders-panel { margin-top: 18px; padding: clamp(15px, 3vw, 25px); }
.orders-panel, .deposit-panel { scroll-margin-top: 112px; }
.deposit-form { margin-top: 16px; }
.amount-choices, .dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.dialog-actions { margin: 14px 0 0; }
.section-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 12px; }
.section-toolbar .btn { flex: none; }
.order-list { min-width: 0; }
.order-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--border-glass);
}
.order-row > div { min-width: 0; overflow-wrap: anywhere; }
.order-row small { display: block; color: var(--text-muted); }
.order-price { text-align: right; }
.order-code { color: var(--text-muted); font-size: 12px; margin: 4px 0 12px; }
.order-detail { color: var(--text-muted); }
.delivery-panel { display: grid; gap: 9px; padding: 14px; border-radius: 8px; border: 1px solid var(--border-glass); background: #f3f6fc; }
.delivery-panel code { overflow-wrap: anywhere; white-space: pre-wrap; color: var(--text-main); }
.delivery-panel button { justify-self: start; }
.payment-amount { display: block; text-align: center; font-size: 22px; color: var(--primary); margin-bottom: 4px; }
.payment-dialog { max-width: 500px; }
.payment-status, .payment-config-note { font-size: 12px; color: var(--text-muted); margin-top: 7px; }
.payment-dialog .qr-copy-row { flex-wrap: wrap; }
.payment-dialog .qr-copy-row > span { flex: 1 0 92px; }
.payment-dialog .qr-copy-row .qr-copy-val { flex: 1 1 auto; }
[data-click][aria-busy="true"] { pointer-events: none; opacity: .65; }
form[aria-busy="true"] button[type="submit"] { pointer-events: none; opacity: .65; }
@media (max-width: 640px) {
  .order-row { grid-template-columns: minmax(0, 1fr) auto; gap: 7px; }
  .order-row > button { grid-column: 1 / -1; justify-self: start; }
}


/* Marketplace and workspace navigation */
.storefront { padding-top: 30px; }
.store-heading, .store-heading-actions, .catalog-toolbar {
  display: flex; align-items: center; gap: 12px;
}
.store-heading, .catalog-toolbar { justify-content: space-between; }
.store-heading { margin-bottom: 17px; }
.store-heading h1 { font-size: clamp(27px, 4vw, 39px); line-height: 1.14; letter-spacing: -.05em; }
.catalog {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(230px, 270px);
  gap: 16px 22px; align-items: start; scroll-margin-top: 105px;
}
.catalog-sidebar { grid-column: 1 / -1; border-bottom: 1px solid var(--border-glass); }
.category-filter {
  position: relative;
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 5px 13px;
}
.cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 39px;
  padding: 7px 11px;
  font-size: 13px;
  text-align: left;
}
.category-filter .cat-btn {
  position: relative;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--text-muted);
  padding-inline: 10px;
  transition: color 240ms cubic-bezier(.2, .75, .25, 1), background-color 240ms ease;
  z-index: 2;
}
.category-filter .cat-btn:hover {
  color: var(--primary);
  background: rgba(37, 59, 181, 0.05);
}
.category-filter .cat-btn.active {
  color: var(--primary);
  font-weight: 700;
}
.category-filter .tab-glider {
  position: absolute;
  bottom: -2px;
  left: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, #253bb5 0%, #4361ee 100%);
  box-shadow: 0 -2px 10px rgba(37, 59, 181, 0.5);
  transition: transform 340ms cubic-bezier(0.25, 1, 0.35, 1), width 340ms cubic-bezier(0.25, 1, 0.35, 1);
  will-change: transform, width;
  pointer-events: none;
  z-index: 3;
}
.workspace-layout { display: grid; grid-template-columns: 205px minmax(0, 1fr); align-items: start; gap: 20px; }
.workspace-layout .page-tabs {
  position: relative;
  display: grid !important;
  gap: 4px !important;
  background: var(--bg-card);
  padding: 6px;
  border-radius: 10px;
  border: 1px solid var(--border-glass);
}
.page-tabs .cat-btn {
  position: relative;
  z-index: 2;
  border-color: transparent;
  background: transparent !important;
  border-radius: 7px;
  transition: color 240ms ease, transform 180ms ease;
}
.page-tabs .cat-btn:hover {
  color: var(--primary);
}
.page-tabs .cat-btn.active {
  color: var(--primary);
  font-weight: 700;
}
.page-tabs .pill-glider {
  position: absolute;
  top: 0;
  left: 0;
  border-radius: 7px;
  background: #edf0ff;
  border: 1px solid #ced8ff;
  box-shadow: 0 2px 8px rgba(37, 59, 181, 0.08);
  transition: transform 340ms cubic-bezier(0.25, 1, 0.35, 1), width 340ms cubic-bezier(0.25, 1, 0.35, 1), height 340ms cubic-bezier(0.25, 1, 0.35, 1);
  will-change: transform, width;
  pointer-events: none;
  z-index: 1;
}

.auth-tabs-bar {
  position: relative;
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: #eaeffa;
  padding: 4px;
  border-radius: var(--radius-full);
  border: 1px solid #d2ddf3;
}
.auth-tabs-bar .cat-btn {
  flex: 1;
  position: relative;
  z-index: 2;
  border: 0;
  background: transparent !important;
  color: var(--text-muted);
  border-radius: var(--radius-full);
  justify-content: center;
  transition: color 240ms ease;
}
.auth-tabs-bar .cat-btn:hover {
  color: var(--text-main);
}
.auth-tabs-bar .cat-btn.active {
  color: #ffffff !important;
  font-weight: 700;
}
.auth-tabs-bar .pill-glider {
  position: absolute;
  top: 4px;
  left: 0;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #253bb5 0%, #1e3098 100%);
  box-shadow: 0 3px 12px rgba(37, 59, 181, 0.35);
  transition: transform 340ms cubic-bezier(0.25, 1, 0.35, 1), width 340ms cubic-bezier(0.25, 1, 0.35, 1), height 340ms cubic-bezier(0.25, 1, 0.35, 1);
  will-change: transform, width;
  pointer-events: none;
  z-index: 1;
}

.products-grid {
  transition: opacity 180ms cubic-bezier(0.2, 0.8, 0.25, 1), transform 180ms cubic-bezier(0.2, 0.8, 0.25, 1);
  will-change: opacity, transform;
}

.copy-btn.copied {
  background: #2a623f !important;
  color: #ffffff !important;
  border-color: #2a623f !important;
  transform: scale(1.05);
}

@keyframes formFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.form-fade-in {
  animation: formFadeIn 280ms cubic-bezier(0.2, 0.8, 0.25, 1) forwards;
}

.catalog-content { min-width: 0; border: 1px solid var(--border-glass); border-radius: 12px; background: var(--bg-card); overflow: hidden; }
.catalog-toolbar { padding: 15px 17px; }
.catalog-toolbar h2 { font-size: 19px; line-height: 1.25; letter-spacing: -.035em; }
.catalog-toolbar p { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.catalog-search { display: flex; align-items: center; gap: 8px; padding: 0 10px; border: 1px solid var(--border-glass); border-radius: 7px; color: var(--text-muted); }
.catalog-search input { width: clamp(90px, 18vw, 195px); padding: 8px 0; border: 0; background: transparent; color: var(--text-main); outline: none; }
.catalog-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 2px #e3e8ff; }
.catalog-columns, .product-card { display: grid; gap: 12px; align-items: center; }
.catalog-columns { grid-template-columns: minmax(0, 1fr) 105px 119px; padding: 6px 17px; background: #f2f5fc; border-block: 1px solid var(--border-glass); color: var(--text-muted); font-size: 11px; font-weight: 700; }
.product-card { grid-template-columns: 55px minmax(0, 1fr) 105px 119px; padding: 13px 17px; }
.product-card + .product-card { border-top: 1px solid var(--border-glass); }
.product-card:hover { background: #fafbff; }
.product-art { display: grid; place-items: center; width: 55px; height: 55px; border-radius: 9px; color: #283eab; background: #e9edff; }
.art-multitab { color: #583e92; background: #f0eafa; }
.art-gem { color: #664800; background: #ffe893; }
.art-gamepad { color: #1c5c65; background: #e1f4f7; }
.art-package { color: #3345a2; background: #e8edff; }
.art-chip svg { width: 28px; height: 28px; }
.card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 9px; color: var(--text-muted); font-size: 10px; font-weight: 600; }
.stock-indicator { color: var(--success); white-space: nowrap; }
.stock-indicator::before { content: "·"; margin-right: 4px; }
.product-name { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.product-desc { color: var(--text-muted); font-size: 11px; line-height: 1.4; margin-top: 4px; }
.card-pricing { font-variant-numeric: tabular-nums; }
.price-val, .price-sub { display: block; }
.price-val { font-size: 17px; font-weight: 800; letter-spacing: -.04em; }
.price-sub { color: var(--text-muted); font-size: 11px; }
.product-buy { width: 100%; font-size: 12px; padding-inline: 7px; white-space: nowrap; }
.product-buy:disabled { background: #f3f5fa; border-color: #e4e9f2; color: var(--text-muted); opacity: 1; }
.catalog-empty { padding: 28px 16px; text-align: center; color: var(--text-muted); }

.gamepass-guide { position: relative; isolation: isolate; overflow: hidden; padding: 17px; color: white; background: #202f91; border-radius: 12px; }
.gamepass-guide h2 { font-size: 23px; line-height: 1.18; letter-spacing: -.035em; }
.gamepass-guide p { position: relative; max-width: 195px; margin: 10px 0 13px; font-size: 12px; color: #e7ecff; }
.gamepass-guide .btn { background: #ffdf65; color: #192050; border-color: #ffdf65; }
.gamepass-guide .btn:hover { background: #ffe885; }
.gamepass-art { position: absolute; z-index: -1; right: -13px; top: -17px; width: 116px; color: #6173de; transform: rotate(15deg); }
.store-guide .purchase-help { margin-top: 12px; padding: 6px 13px; background: white; border: 1px solid var(--border-glass); border-radius: 9px; font-size: 12px; }
.store-guide .purchase-help details { padding: 9px 0; }
.store-guide .purchase-help details:first-child { border-top: 0; }
.store-guide .purchase-help details:last-child { border-bottom: 0; }

@media (max-width: 920px) {
  .catalog { grid-template-columns: minmax(0, 1fr); }
  .store-guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
  .store-guide .purchase-help { margin: 0; }
}
@media (max-width: 640px) {
  .storefront { padding-top: 17px; }
  .nav-links { flex-wrap: wrap; overflow: visible; }
  .store-heading-actions { gap: 5px; }
  .store-heading-actions .btn { min-height: 35px; font-size: 11px; padding-inline: 7px; }
  .store-heading-actions .ui-icon { width: 14px; height: 14px; }
  .category-filter { gap: 1px 8px; }
  .category-filter .cat-btn { min-height: 34px; font-size: 11px; gap: 4px; padding-inline: 3px; }
  .category-filter .cat-btn .ui-icon { width: 14px; height: 14px; }
  .catalog-toolbar { padding: 12px; gap: 7px; }
  .catalog-toolbar h2 { font-size: 15px; }
  .catalog-search input { width: clamp(88px, 24vw, 145px); font-size: 12px; }
  .catalog-columns { display: none; }
  .product-card { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 7px 9px; padding: 10px 12px; border-top: 1px solid var(--border-glass); }
  .product-art { width: 40px; height: 40px; }
  .art-chip svg { width: 23px; height: 23px; }
  .product-info { grid-column: 2 / -1; }
  .product-name { font-size: 13px; }
  .product-desc { font-size: 11px; }
  .card-pricing { grid-column: 2; }
  .product-buy { grid-column: 3; min-height: 34px; }
  .store-guide, .workspace-layout { grid-template-columns: minmax(0, 1fr); }
  .workspace-layout .page-tabs { display: flex !important; flex-wrap: wrap !important; }
}
@media (max-width: 430px) {
  .nav-link .ui-icon { display: none; }
}


/* Motion shared by the store, wallet and operator pages. */
:root {
  --motion-fast: 160ms;
  --motion-panel: 280ms;
  --motion-ease: cubic-bezier(.2, .75, .25, 1);
  --motion-spring: cubic-bezier(.16, 1, .3, 1);
}

@keyframes ui-enter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes ui-loading {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

@keyframes tabSlideFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.995);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(110%) scale(.9);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%) scale(.95);
  }
}

@keyframes qrPop {
  0% { transform: scale(.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.store-heading, .workspace-heading, .catalog-content, .store-guide,
.page-intro, .deposit-panel, .orders-panel, .metrics-grid > *,
.workspace-content > [id]:not([hidden]), .auth-panel form:not([hidden]),
.nav-link[data-nav-permission]:not([hidden]), .auth-actions > *,
.product-card, .order-row, #tickets-table-container > *, tbody > tr,
details[open] > :not(summary) {
  animation: ui-enter var(--motion-panel) var(--motion-ease) backwards;
}

.tab-content-enter,
.products-grid.tab-animated .product-card,
#admin-users-section:not([hidden]),
#admin-stock-section:not([hidden]),
#admin-ledger-section:not([hidden]),
#admin-review-section:not([hidden]),
#rsl-feed-section:not([hidden]),
#rsl-genkey-section:not([hidden]),
#rsl-paydebt-section:not([hidden]) {
  animation: tabSlideFadeIn 280ms var(--motion-spring) forwards;
}

.product-card:nth-child(1) { animation-delay: 20ms; }
.product-card:nth-child(2), .metrics-grid > :nth-child(2) { animation-delay: 45ms; }
.product-card:nth-child(3), .metrics-grid > :nth-child(3) { animation-delay: 70ms; }
.product-card:nth-child(4), .metrics-grid > :nth-child(4) { animation-delay: 95ms; }
.product-card:nth-child(5) { animation-delay: 120ms; }
.product-card:nth-child(6) { animation-delay: 145ms; }
.product-card:nth-child(7) { animation-delay: 170ms; }

.btn, .cat-btn, .nav-link, .modal-close, .copy-btn, summary,
.site-footer a, .product-card, .order-row, tbody > tr,
.form-control, .catalog-search, .ui-icon, .product-art, .logo-icon {
  transition: background-color var(--motion-fast) var(--motion-ease),
    color var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease),
    box-shadow var(--motion-fast) var(--motion-ease), transform var(--motion-fast) var(--motion-ease);
}

@media (hover: hover) {
  .btn:not(:disabled):hover {
    transform: translateY(-1.5px);
    box-shadow: 0 4px 14px rgba(37, 59, 181, 0.16);
  }
  .btn-primary:not(:disabled):hover {
    box-shadow: 0 5px 18px rgba(37, 59, 181, 0.35);
  }
  .modal-close:hover, .copy-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
  .btn:not(:disabled):hover > .ui-icon, .nav-link:hover > .ui-icon {
    transform: translateX(2px);
  }
  .brand-logo:hover .logo-icon {
    transform: rotate(-6deg) scale(1.05);
  }
  .product-card:hover {
    background: #fafbff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 59, 181, 0.08);
  }
  .product-card:hover .product-art {
    transform: scale(1.06) rotate(-2deg);
  }
  .order-row:hover {
    background: #f8faff;
    transform: translateX(3px);
  }
  tbody > tr:hover {
    background: #f4f7ff;
    transform: translateX(2px);
  }
  summary:hover, .site-footer a:hover {
    color: var(--primary);
  }
}

.btn:not(:disabled):active, .cat-btn:not(:disabled):active,
.modal-close:active, .copy-btn:active {
  transform: scale(.97);
}

.form-control:focus, .catalog-search:focus-within {
  transform: translateY(-1px);
}

#login-form:not([hidden]), #register-form:not([hidden]) {
  animation: tabSlideFadeIn 280ms var(--motion-spring) backwards;
}

[aria-busy="true"] > .catalog-empty, button[aria-busy="true"], form[aria-busy="true"] button[type="submit"] {
  animation: ui-loading 950ms ease-in-out infinite;
}

/* =========================================================================
   7-CLUSTER 120FPS NATIVE MOTION ENGINE (Directional Slide, 3D Tilt, Laser Scan)
   ========================================================================= */

/* Cluster A: Directional Slide Track & Height Morphing */
.catalog-viewport {
  position: relative;
  overflow: hidden;
  transition: height 360ms cubic-bezier(0.16, 1, 0.3, 1);
  will-change: height;
}

@keyframes slideOutLeft {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
  to { transform: translate3d(-55px, 0, 0) scale(0.96); opacity: 0; }
}
@keyframes slideOutRight {
  from { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
  to { transform: translate3d(55px, 0, 0) scale(0.96); opacity: 0; }
}
@keyframes slideInRight {
  from { transform: translate3d(55px, 0, 0) scale(0.96); opacity: 0; }
  to { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
}
@keyframes slideInLeft {
  from { transform: translate3d(-55px, 0, 0) scale(0.96); opacity: 0; }
  to { transform: translate3d(0, 0, 0) scale(1); opacity: 1; }
}

.slide-out-left {
  animation: slideOutLeft 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  pointer-events: none;
}
.slide-out-right {
  animation: slideOutRight 240ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  pointer-events: none;
}
.slide-in-right {
  animation: slideInRight 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}
.slide-in-left {
  animation: slideInLeft 320ms cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

/* Cluster B: Liquid Morphing Tab Indicator */
.tab-glider, .pill-glider {
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1), width 340ms cubic-bezier(0.16, 1, 0.3, 1), height 340ms cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center center;
}
.tab-glider.moving, .pill-glider.moving {
  box-shadow: 0 2px 8px rgba(37, 59, 181, .12);
}
@keyframes liquidSquashRight {
  0% { transform: scaleX(1) scaleY(1); }
  40% { transform: scaleX(1.18) scaleY(0.86); }
  100% { transform: scaleX(1) scaleY(1); }
}
@keyframes liquidSquashLeft {
  0% { transform: scaleX(1) scaleY(1); }
  40% { transform: scaleX(1.18) scaleY(0.86); }
  100% { transform: scaleX(1) scaleY(1); }
}

/* Cluster C: Product Cards: 3D Perspective Tilt & Spotlight Glow Border */
@keyframes cardEntrance3D {
  0% {
    opacity: 0;
    transform: perspective(900px) rotateX(12deg) translateY(24px) scale(0.95);
  }
  100% {
    opacity: 1;
    transform: perspective(900px) rotateX(0deg) translateY(0) scale(1);
  }
}

.products-grid.tab-animated .product-card {
  animation: cardEntrance3D 380ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
  animation-delay: calc(var(--card-index, 0) * 45ms);
}

.product-card {
  position: relative;
  transform-style: preserve-3d;
  will-change: transform;
  isolation: isolate;
}
.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(300px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(37, 59, 181, 0.12), transparent 75%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}
.product-card:hover::before {
  opacity: 1;
}
.product-card.card-settling {
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* Cluster D: Modal Spring Overshoot, VietQR Laser Scan, Vector Tick & Confetti */
@keyframes modalSpring {
  0% { transform: scale(0.88) translateY(20px); opacity: 0; }
  65% { transform: scale(1.02) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-overlay.active .modal-content,
.modal-backdrop.active .modal-card,
.modal-overlay.active .payment-dialog {
  animation: modalSpring 380ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.qr-scanner-box {
  position: relative;
  display: inline-block;
  padding: 12px;
  background: #0d1224;
  border-radius: 16px;
  border: 1px solid rgba(37, 59, 181, 0.35);
  overflow: hidden;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.45);
}
.qr-scanner-box img {
  display: block;
  border-radius: 8px;
}
.qr-laser-track {
  position: absolute;
  inset: 12px;
  pointer-events: none;
  overflow: hidden;
  border-radius: 8px;
}
.qr-laser-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #00f0ff 25%, #ffffff 50%, #00f0ff 75%, transparent);
  box-shadow: 0 0 14px #00f0ff, 0 0 26px rgba(0, 240, 255, 0.8);
  animation: laserScanSweep 2.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite alternate;
  will-change: transform;
}
.qr-laser-beam {
  position: absolute;
  top: -40px;
  left: 0;
  right: 0;
  height: 40px;
  background: linear-gradient(to top, rgba(0, 240, 255, 0.22), transparent);
}
@keyframes laserScanSweep {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(0, 240px, 0); }
}

/* Success Vector Tick & Neon Confetti */
.scan-success-overlay {
  position: absolute;
  inset: 0;
  background: rgba(13, 18, 36, 0.94);
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  z-index: 10;
}
.scan-success-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.success-svg {
  width: 76px;
  height: 76px;
  transform: scale(0.85);
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.scan-success-overlay.active .success-svg {
  transform: scale(1);
}
.success-circle {
  fill: none;
  stroke: #10b981;
  stroke-width: 3.5;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.scan-success-overlay.active .success-circle {
  animation: strokeDraw 0.45s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.success-check {
  fill: none;
  stroke: #10b981;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
}
.scan-success-overlay.active .success-check {
  animation: strokeDraw 0.35s cubic-bezier(0.65, 0, 0.45, 1) 0.22s forwards;
}
@keyframes strokeDraw {
  to { stroke-dashoffset: 0; }
}

/* Cluster F: Reseller Ticket Feed (Radar Pulse & Countdown) */
@keyframes radarPulse {
  0% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(234, 179, 8, 0); }
  100% { box-shadow: 0 0 0 0 rgba(234, 179, 8, 0); }
}
.ticket-new-pulse {
  animation: radarPulse 2s infinite ease-out;
  border-left: 3px solid #eab308 !important;
}
.countdown-bar-container {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 6px;
}
.countdown-bar {
  height: 100%;
  border-radius: 9999px;
  transition: width 1s linear, background-color 0.5s ease;
}
.countdown-green { background: #10b981; }
.countdown-yellow { background: #eab308; }
.countdown-red {
  background: #ef4444;
  animation: alertBlink 1s infinite alternate ease-in-out;
}
@keyframes alertBlink {
  0% { opacity: 1; }
  100% { opacity: 0.4; }
}

/* Cluster G: Micro-interactions (Button Ripple & Input Shake) */
.btn {
  position: relative;
  overflow: hidden;
}
.ripple {
  position: absolute;
  border-radius: 50%;
  transform: scale(0);
  animation: rippleEffect 500ms linear;
  background: rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
@keyframes rippleEffect {
  to {
    transform: scale(4);
    opacity: 0;
  }
}
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.input-error-shake {
  animation: inputShake 350ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
  border-color: #ef4444 !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.6) !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}


/* Account and operations layout */
.workspace-page { padding-top: clamp(22px, 3.6vw, 43px); }
.workspace-heading-bar, .workspace-actions {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
}
.workspace-heading-bar { justify-content: space-between; }
.workspace-heading-bar p { margin-top: 5px; overflow-wrap: anywhere; }
.workspace-actions #lockdown-btn { color: var(--danger); border-color: #eed4d7; background: #fff6f6; }
.workspace-actions #lockdown-btn.is-locked { color: #fff; border-color: var(--danger); background: var(--danger); }
.metrics-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin: 0 0 20px;
}
.reseller-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric { min-width: 0; padding: 16px; }
.metric dt { color: var(--text-muted); font-size: 12px; font-weight: 650; }
.metric dd { margin: 4px 0 0; font-size: clamp(18px, 2.3vw, 27px); font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric small { color: var(--text-muted); }
.admin-page .workspace-layout, .reseller-page .workspace-layout { grid-template-columns: minmax(0, 1fr); gap: 12px; }
.workspace-layout .page-tabs { display: flex !important; flex-wrap: wrap; justify-content: flex-start; width: fit-content; max-width: 100%; }
.workspace-layout .page-tabs .cat-btn { white-space: normal; }
.wallet-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); align-items: stretch; gap: 14px; }
.wallet-card { padding: clamp(17px, 3vw, 25px); border-radius: 12px; background: #202f91; color: white; }
.wallet-owner { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; }
.wallet-owner > .ui-icon { width: 37px; height: 37px; padding: 8px; background: #ffffff20; border-radius: 8px; }
.wallet-owner > div { min-width: 0; overflow-wrap: anywhere; }
.wallet-owner p, .wallet-label { color: #e0e7ff; font-size: 12px; }
.wallet-value { display: block; margin-top: 3px; font-size: clamp(26px, 5vw, 43px); line-height: 1.15; letter-spacing: -.04em; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.wallet-link { display: inline-flex; gap: 7px; align-items: center; margin-top: 16px; color: #fff; font-weight: 600; text-decoration: none; }
.wallet-link:hover { text-decoration: underline; }
.amount-choices .btn[aria-pressed="true"] { color: var(--primary); border-color: #aab7e5; background: #edf0ff; }
.workspace-empty { padding: 16px; border-radius: 8px; background: #f3f6fc; color: var(--text-muted); }
.payment-config-note { padding: 11px 12px; border-radius: 8px; background: #f3f6fc; }
#deposit > .payment-config-note { margin-top: 14px; }
.workspace-page .admin-table { min-width: 0; }
.admin-table td { overflow-wrap: anywhere; }
.qr-laser-track { display: none; }
body:has(.modal-overlay.active, .modal-backdrop.active) { overflow: hidden; }
.ticket-new-pulse { animation-iteration-count: 1; }
.countdown-red { animation-iteration-count: 3; }
@media (max-width: 740px) {
  .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .reseller-metrics > :first-child { grid-column: 1 / -1; }
  .metric { padding: 12px; }
  .wallet-layout { grid-template-columns: minmax(0, 1fr); }
  .workspace-layout .page-tabs { width: 100%; }
  .workspace-layout .page-tabs .cat-btn { font-size: 12px; }
  .admin-table, .admin-table tbody, .admin-table tbody tr { display: block; }
  .admin-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .admin-table tbody tr { padding-block: 8px; border-bottom: 1px solid var(--border-glass) !important; }
  .admin-table tbody td[data-label] { display: grid; grid-template-columns: minmax(0, 87px) minmax(0, 1fr); gap: 10px; padding: 4px 0 !important; border: 0; max-width: none !important; white-space: normal !important; }
  .admin-table td[data-label]::before { content: attr(data-label); font: 600 11px/1.5 system-ui, sans-serif; color: var(--text-muted); }
  .admin-table td[data-label="Tài khoản"] > div, .admin-table td[data-label=""] > button { grid-column: 2; }
  .admin-table td[colspan] { display: block; border: 0; }
}

/* Cross-device Responsive Hardening (Mobile, Tablet, Laptop, PC) */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-text-size-adjust: 100%;
}
button, a, input, select, textarea {
  touch-action: manipulation;
}
.admin-support-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 1.5rem;
}
@media (max-width: 850px) {
  .nav-links {
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .nav-links::-webkit-scrollbar {
    display: none;
  }
}
@media (max-width: 768px) {
  .admin-support-grid {
    grid-template-columns: minmax(0, 1fr);
    min-height: auto !important;
  }
  .admin-support-grid > div:first-child {
    border-right: none !important;
    border-bottom: 1px solid var(--border-glass);
    padding-right: 0 !important;
    padding-bottom: 1rem;
    max-height: 240px;
  }
}
@media (max-width: 640px) {
  .modal-overlay, .modal-backdrop {
    padding: 10px;
  }
  .modal-content, .modal-box {
    padding: 16px 14px;
    max-height: calc(100dvh - 20px);
    border-radius: 12px;
  }
  #support-chat-modal .modal-content {
    height: min(560px, 88vh) !important;
  }
  .deposit-panel .page-tabs {
    flex-wrap: wrap;
    gap: 4px;
  }
  .deposit-panel .page-tabs .cat-btn {
    flex: 1 1 auto;
    font-size: 11px;
    padding: 6px 8px;
    min-height: 36px;
    text-align: center;
    justify-content: center;
  }
}
@media (max-width: 480px) {
  .amount-choices {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 6px !important;
  }
  .order-item {
    padding: 0.9rem !important;
  }
  .wallet-card {
    padding: 14px !important;
  }
}


