/* Oxxxypay Web App - Full Themed Styles */
:root {
  --bg-primary: #f0f2f5;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --text-primary: #1a1a2e;
  --text-secondary: #6b7280;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.1);
  --border: #e5e7eb;
  --error: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  --gradient-start: #6366f1;
  --gradient-end: #8b5cf6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
  --card-glow: 0 4px 20px rgba(99,102,241,0.08), 0 1px 4px rgba(0,0,0,0.04);
  --card-bg: rgba(255,255,255,0.85);
  --card-border: rgba(99,102,241,0.08);
}

[data-theme="dark"] {
  --bg-primary: #0b0f1a;
  --bg-secondary: #151b2e;
  --bg-card: #1a2138;
  --text-primary: #e8eaf0;
  --text-secondary: #8892a8;
  --accent: #818cf8;
  --accent-hover: #a5b4fc;
  --accent-light: rgba(129, 140, 248, 0.12);
  --border: #2a3350;
  --error: #f87171;
  --success: #34d399;
  --warning: #fbbf24;
  --gradient-start: #6366f1;
  --gradient-end: #a78bfa;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.25);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.35);
  --card-glow: 0 4px 24px rgba(129,140,248,0.12), 0 1px 4px rgba(0,0,0,0.15);
  --card-bg: rgba(26,33,56,0.8);
  --card-border: rgba(129,140,248,0.1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
  text-rendering: geometricPrecision;
  position: relative;
  overflow-x: hidden;
}
@keyframes bgBlobsDrift {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(2%, -1%) rotate(0.5deg); }
  50% { transform: translate(-1%, 2%) rotate(-0.5deg); }
  75% { transform: translate(1%, 1%) rotate(0.3deg); }
}

@keyframes bgSparkle {
  0%, 100% { opacity: 0.4; }
  33% { opacity: 0.8; }
  66% { opacity: 0.3; }
}

@keyframes particlesOpacity {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.9; }
}

@keyframes softFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes accentPulse {
  0%, 100% { text-shadow: 0 0 0 transparent; }
  50% { text-shadow: 0 0 20px var(--accent-light); }
}

body::before {
  content: "";
  position: fixed; top: -10%; left: -10%; right: -10%; bottom: -10%;
  background:
    radial-gradient(ellipse 60% 50% at 20% 15%, rgba(99,102,241,0.13) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(139,92,246,0.1) 0%, transparent 55%),
    radial-gradient(ellipse 70% 40% at 60% 50%, rgba(99,102,241,0.07) 0%, transparent 50%),
    radial-gradient(ellipse 45% 55% at 10% 70%, rgba(167,139,250,0.08) 0%, transparent 50%),
    radial-gradient(ellipse 55% 45% at 90% 20%, rgba(129,140,248,0.09) 0%, transparent 50%);
  filter: blur(40px);
  animation: bgBlobsDrift 30s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(99,102,241,0.2) 50%, transparent 50%),
    radial-gradient(1px 1px at 30% 70%, rgba(139,92,246,0.15) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 70% 30%, rgba(99,102,241,0.18) 50%, transparent 50%),
    radial-gradient(1px 1px at 85% 85%, rgba(167,139,250,0.12) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 50% 50%, rgba(99,102,241,0.15) 50%, transparent 50%),
    radial-gradient(1px 1px at 20% 90%, rgba(129,140,248,0.1) 50%, transparent 50%),
    radial-gradient(1px 1px at 90% 50%, rgba(139,92,246,0.12) 50%, transparent 50%);
  animation: bgSparkle 8s ease-in-out infinite;
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse 60% 50% at 20% 15%, rgba(129,140,248,0.18) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 80% 80%, rgba(139,92,246,0.14) 0%, transparent 55%),
    radial-gradient(ellipse 70% 40% at 60% 50%, rgba(129,140,248,0.1) 0%, transparent 50%),
    radial-gradient(ellipse 45% 55% at 10% 70%, rgba(167,139,250,0.12) 0%, transparent 50%),
    radial-gradient(ellipse 55% 45% at 90% 20%, rgba(99,102,241,0.13) 0%, transparent 50%);
  filter: blur(40px);
}
[data-theme="dark"] body::after {
  background-image:
    radial-gradient(1.5px 1.5px at 10% 20%, rgba(129,140,248,0.25) 50%, transparent 50%),
    radial-gradient(1px 1px at 30% 70%, rgba(167,139,250,0.18) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 70% 30%, rgba(129,140,248,0.22) 50%, transparent 50%),
    radial-gradient(1px 1px at 85% 85%, rgba(139,92,246,0.15) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 50% 50%, rgba(129,140,248,0.2) 50%, transparent 50%),
    radial-gradient(1px 1px at 20% 90%, rgba(167,139,250,0.12) 50%, transparent 50%),
    radial-gradient(1px 1px at 90% 50%, rgba(139,92,246,0.15) 50%, transparent 50%);
}

/* Chaotic floating particles - each flies in its own direction */
@keyframes particleFloat1 {
  0%, 100% { transform: translate(0, 0); opacity: 0.5; }
  25% { transform: translate(-6px, -10px); opacity: 0.75; }
  50% { transform: translate(4px, 6px); opacity: 0.45; }
  75% { transform: translate(-8px, 4px); opacity: 0.65; }
}
@keyframes particleFloat2 {
  0%, 100% { transform: translate(0, 0); opacity: 0.45; }
  33% { transform: translate(8px, 6px); opacity: 0.7; }
  66% { transform: translate(-5px, -8px); opacity: 0.55; }
}
@keyframes particleFloat3 {
  0%, 100% { transform: translate(0, 0); opacity: 0.5; }
  25% { transform: translate(-12px, 2px); opacity: 0.65; }
  50% { transform: translate(6px, -4px); opacity: 0.45; }
  75% { transform: translate(-4px, -6px); opacity: 0.6; }
}
@keyframes particleFloat4 {
  0%, 100% { transform: translate(0, 0); opacity: 0.45; }
  33% { transform: translate(10px, -8px); opacity: 0.7; }
  66% { transform: translate(-6px, 4px); opacity: 0.55; }
}
@keyframes particleFloat5 {
  0%, 100% { transform: translate(0, 0); opacity: 0.5; }
  25% { transform: translate(7px, 8px); opacity: 0.65; }
  50% { transform: translate(-9px, -3px); opacity: 0.45; }
  75% { transform: translate(10px, -6px); opacity: 0.6; }
}
@keyframes particleFloat6 {
  0%, 100% { transform: translate(0, 0); opacity: 0.45; }
  33% { transform: translate(-7px, 7px); opacity: 0.65; }
  66% { transform: translate(8px, -5px); opacity: 0.55; }
}

.particles-float {
  position: absolute; inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.card > .particles-float, .stat-card > .particles-float, .rate-item > .particles-float,
.ref-stat > .particles-float, .page-hero > .particles-float, .card-bg-decor > .particles-float,
.stats-mini-block > .particles-float, .links-row > .particles-float, .sell-order-card > .particles-float {
  z-index: 0;
}
.particles-float.particles-bg {
  position: fixed;
  top: -10%; left: -10%; right: -10%; bottom: -10%;
  z-index: 0;
}
.particle-dot {
  position: absolute;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: rgba(255,255,255,0.6);
  box-shadow: 0 0 6px rgba(255,255,255,0.4);
  animation: particleFloat1 35s ease-in-out infinite;
  will-change: transform;
}
[data-theme="dark"] .particle-dot {
  background: rgba(255,255,255,0.45);
  box-shadow: 0 0 8px rgba(255,255,255,0.3);
}
.particle-dot.p1 { animation-name: particleFloat1; }
.particle-dot.p2 { animation-name: particleFloat2; }
.particle-dot.p3 { animation-name: particleFloat3; }
.particle-dot.p4 { animation-name: particleFloat4; }
.particle-dot.p5 { animation-name: particleFloat5; }
.particle-dot.p6 { animation-name: particleFloat6; }
/* ==================== Animations ==================== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

@keyframes floatBlob1 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(30px, -20px) scale(1.1); }
  50% { transform: translate(-10px, 20px) scale(0.95); }
  75% { transform: translate(20px, 10px) scale(1.05); }
}

@keyframes floatBlob2 {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(-25px, 15px) scale(1.12); }
  66% { transform: translate(15px, -25px) scale(0.9); }
}

@keyframes floatBlob3 {
  0%, 100% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(20px, -30px) scale(1.15) rotate(15deg); }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 20px rgba(255,255,255,0.15), 0 0 40px rgba(99,102,241,0.1); }
  50% { box-shadow: 0 0 30px rgba(255,255,255,0.3), 0 0 60px rgba(99,102,241,0.2); }
}

@keyframes spinRing {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes scaleInBounce {
  0% { opacity: 0; transform: scale(0.3); }
  50% { opacity: 1; transform: scale(1.08); }
  70% { transform: scale(0.96); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes fadeInUpSoft {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

.animate-in {
  opacity: 0;
  transform: translateY(40px);
  animation: fadeInUp 1.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-in-delay-1 { animation-delay: 0.15s; }
.animate-in-delay-2 { animation-delay: 0.3s; }
.animate-in-delay-3 { animation-delay: 0.45s; }
.animate-in-delay-4 { animation-delay: 0.6s; }
.animate-in-delay-5 { animation-delay: 0.75s; }
.animate-in-delay-6 { animation-delay: 0.9s; }
.animate-in-delay-7 { animation-delay: 1.05s; }

.scroll-reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1), transform 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.scroll-reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.page-transition {
  animation: fadeIn 0.8s ease forwards;
}

#app { min-height: 100vh; padding-bottom: env(safe-area-inset-bottom, 20px); position: relative; z-index: 1; max-width: 100vw; overflow-x: hidden; }
.hidden { display: none !important; }

/* Toast Notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: white;
  background: var(--accent);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  transform: translateX(120%);
  transition: transform 0.3s ease;
  max-width: 90vw;
}
.toast.show { transform: translateX(0); }
.toast-error { background: var(--error); }
.toast-info { background: var(--accent); }

/* Loading */
#loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  font-size: 1.1rem;
  color: var(--text-secondary);
}

/* Login */
#login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 20px;
  padding: 36px 28px; width: 100%; max-width: 380px; box-shadow: var(--shadow-lg);
  animation: scaleIn 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.login-card h1.logo, .header h1.logo {
  font-size: 1.6rem; margin-bottom: 8px; text-align: center; font-weight: 800;
  letter-spacing: 0.05em; display: flex; align-items: center; justify-content: center; gap: 0;
  text-transform: uppercase;
}
.logo-ooxxy {
  color: #fff;
  text-shadow: 0 1px 0 #999, 0 2px 0 #666, 0 3px 0 #444;
}
.logo-pay {
  color: #e53935;
  text-shadow: 0 1px 0 #8b0000, 0 2px 0 #6b0000, 0 3px 0 #4a0000;
}
[data-theme="light"] .logo-ooxxy {
  color: #1a1a2e;
  text-shadow: 0 1px 0 #bdbdbd, 0 2px 0 #9e9e9e;
}
[data-theme="light"] .logo-pay {
  color: #c62828;
  text-shadow: 0 1px 0 #8b0000, 0 2px 0 #6b0000;
}
.login-card h1.logo { margin-bottom: 8px; }
.header h1.logo { font-size: 1.15rem; margin: 0; }
.login-hint { color: var(--text-secondary); font-size: 0.9rem; text-align: center; margin-bottom: 24px; }
#login-form input {
  width: 100%; padding: 14px 16px; margin-bottom: 12px; border: 1px solid var(--border);
  border-radius: 12px; font-size: 1rem; background: var(--bg-primary); color: var(--text-primary);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
#login-form input:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light);
}
#login-form button {
  width: 100%; padding: 14px; margin-top: 8px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white; border: none; border-radius: 12px; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s ease, transform 0.15s ease;
}
#login-form button:hover { opacity: 0.92; }
#login-form button:active { transform: scale(0.97); }
.error { color: var(--error); font-size: 0.9rem; margin-top: 12px; text-align: center; }

/* Main Layout */
#main-screen { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }
.header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 36px; height: 36px; border: none; border-radius: 10px;
  background: var(--bg-card); color: var(--text-primary); font-size: 1.1rem; cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
  border: 1px solid var(--border);
}
.icon-btn:hover { background: var(--accent); color: white; border-color: var(--accent); }
.icon-btn:active { transform: scale(0.92); }

/* Nav - scrollable tabs */
.nav {
  display: flex; gap: 6px; padding: 8px 12px;
  background: var(--bg-secondary); border-bottom: 1px solid var(--border);
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.nav::-webkit-scrollbar { display: none; }
.nav button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--bg-card); color: var(--text-primary);
  font-size: 0.75rem; white-space: nowrap; cursor: pointer; min-width: 54px;
  transition: all 0.2s ease;
}
.nav.nav-user { overflow-x: hidden; }
.nav.nav-user button { flex: 1; min-width: 0; white-space: normal; padding: 7px 4px; }
.nav button .nav-icon { font-size: 1.1rem; }
.nav button .nav-label { font-size: 0.65rem; }
.nav button:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
.nav button.active {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white; border-color: transparent; box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* Content */
.content { flex: 1; padding: 16px; overflow-y: auto; min-height: 0; scroll-behavior: smooth; }
.content.content-requests { overflow: hidden; display: flex; flex-direction: column; flex: 1; min-height: 0; padding: 12px; }

/* Cards */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--card-glow);
  transition: box-shadow 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute;
  top: -1px; left: -1px;
  width: 120px; height: 120px;
  background: radial-gradient(ellipse at 0% 0%, rgba(99,102,241,0.08) 0%, transparent 70%);
  border-radius: 20px 0 0 0;
  pointer-events: none;
}
[data-theme="dark"] .card::before {
  background: radial-gradient(ellipse at 0% 0%, rgba(129,140,248,0.1) 0%, transparent 70%);
}
.card:hover {
  box-shadow: var(--card-glow), 0 0 0 1px var(--card-border);
  transform: translateY(-1px);
}
.card > * { position: relative; z-index: 1; }
.card h2 {
  font-size: 1.1rem; margin-bottom: 12px; color: var(--text-primary); font-weight: 700;
  position: relative;
}
.card p { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.6; }

/* Page hero - gradient header for tabs */
.page-hero {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 22px 18px;
  margin-bottom: 16px;
  color: white;
  box-shadow: 0 8px 32px rgba(99,102,241,0.25);
}
.page-hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 80% 20%, rgba(255,255,255,0.15) 0%, transparent 50%),
    radial-gradient(ellipse 60% 80% at 20% 80%, rgba(255,255,255,0.08) 0%, transparent 50%);
  pointer-events: none;
}
.page-hero::after {
  content: "";
  position: absolute;
  bottom: -30px; right: -20px;
  width: 120px; height: 100px;
  background: radial-gradient(ellipse 60% 55% at 50% 50%, rgba(255,255,255,0.12) 0%, transparent 70%);
  border-radius: 55% 45% 60% 40% / 50% 55% 45% 50%;
  filter: blur(8px);
  animation: softFloat 8s ease-in-out infinite;
  pointer-events: none;
}
.page-hero .page-hero-icon { font-size: 2rem; margin-bottom: 8px; display: block; position: relative; z-index: 1; }
.page-hero .page-hero-title { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; text-shadow: 0 2px 8px rgba(0,0,0,0.15); position: relative; z-index: 1; }
.page-hero .page-hero-sub { font-size: 0.85rem; opacity: 0.85; margin-top: 4px; position: relative; z-index: 1; }
.page-hero.profile-hero { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%); }
.page-hero.history-hero { background: linear-gradient(135deg, #0ea5e9 0%, #6366f1 50%, #8b5cf6 100%); }
.page-hero.referrals-hero { background: linear-gradient(135deg, #10b981 0%, #6366f1 50%, #8b5cf6 100%); }
[data-theme="dark"] .page-hero { box-shadow: 0 8px 32px rgba(99,102,241,0.35); }
[data-theme="dark"] .page-hero.profile-hero { background: linear-gradient(135deg, #4338ca 0%, #6d28d9 50%, #7c3aed 100%); }
[data-theme="dark"] .page-hero.history-hero { background: linear-gradient(135deg, #0369a1 0%, #4338ca 50%, #6d28d9 100%); }
[data-theme="dark"] .page-hero.referrals-hero { background: linear-gradient(135deg, #047857 0%, #4338ca 50%, #6d28d9 100%); }

/* Stats Grid */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: 18px; padding: 18px;
  box-shadow: var(--card-glow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative; overflow: hidden;
}
.stat-card > * { position: relative; z-index: 1; }
.stat-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--card-glow), 0 0 0 1px var(--card-border); }
.stat-card:active { transform: scale(0.97); }
.stat-card .value {
  font-size: 1.35rem; font-weight: 700; color: var(--accent);
  text-shadow: 0 0 20px rgba(99,102,241,0.1);
}
.stat-card .label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 3px; font-weight: 500; }

/* Rates */
details.card .details-summary { cursor: pointer; list-style: none; user-select: none; transition: opacity 0.2s ease; }
details.card .details-summary::-webkit-details-marker { display: none; }
details.card .details-summary::before { content: "▶"; display: inline-block; margin-right: 8px; transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1); font-size: 0.7em; opacity: 0.9; }
details.card[open] .details-summary::before { transform: rotate(90deg); }
@keyframes detailsContentIn {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
.rate-card .rate-card-inner { overflow: hidden; max-height: 0; transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1); margin-top: 0; padding-top: 0; }
details.card.rate-card[open] .rate-card-inner { max-height: 1200px; padding-top: 12px; }
details.card.rate-card[open] .rate-card-inner > * { animation: detailsContentIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
details.card .wh-editor-user { overflow: hidden; max-height: 0; transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1); }
details.card[open] .wh-editor-user { max-height: 800px; padding-top: 8px; }
details.card[open] .wh-editor-user > * { animation: detailsContentIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards; }
.rate-card { }
.rate-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.rate-item {
  text-align: center; padding: 14px 12px;
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1px solid var(--card-border);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
  overflow: hidden;
}
.rate-item > * { position: relative; z-index: 1; }
.rate-item::after {
  content: "";
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-light), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.rate-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.1);
  border-color: rgba(99,102,241,0.15);
}
.rate-item:hover::after { opacity: 1; }
.rate-label { display: block; font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 5px; font-weight: 500; }
.rate-value {
  display: block; font-size: 1.15rem; font-weight: 700; color: var(--accent);
  text-shadow: 0 0 24px rgba(99,102,241,0.15);
}
.rate-tiers { margin-top: 16px; }
.rate-tiers h3 { font-size: 0.9rem; margin-bottom: 10px; font-weight: 600; }
.tier-row {
  display: flex; justify-content: space-between; padding: 8px 0;
  border-bottom: 1px solid rgba(99,102,241,0.06);
  font-size: 0.85rem;
  transition: background 0.2s ease;
}
.tier-row:last-child { border-bottom: none; }
.tier-row:hover { background: var(--accent-light); border-radius: 8px; padding-left: 6px; padding-right: 6px; }
.rate-minimums { margin-top: 12px; font-size: 0.85rem; }
.work-off-badge {
  padding: 12px 16px; text-align: center;
  background: rgba(254,243,199,0.7); color: #92400e;
  border-radius: 14px; margin-top: 14px; font-weight: 600;
  border: 1px solid rgba(245,158,11,0.15);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(245,158,11,0.08);
}
.work-on-badge {
  padding: 12px 16px; text-align: center;
  background: rgba(209,250,229,0.7); color: #065f46;
  border-radius: 14px; margin-top: 14px; font-weight: 600;
  border: 1px solid rgba(16,185,129,0.15);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 2px 12px rgba(16,185,129,0.08);
}
[data-theme="dark"] .work-off-badge {
  background: rgba(66,32,6,0.6); color: #fcd34d;
  border-color: rgba(252,211,77,0.15);
  box-shadow: 0 2px 12px rgba(252,211,77,0.06);
}
[data-theme="dark"] .work-on-badge {
  background: rgba(6,78,59,0.6); color: #6ee7b7;
  border-color: rgba(110,231,183,0.15);
  box-shadow: 0 2px 12px rgba(110,231,183,0.06);
}

/* Calculator */
.calc-card { }
.calc-row { display: flex; gap: 10px; align-items: center; margin-bottom: 12px; flex-wrap: wrap; }

.debt-block {
  padding: 14px 18px;
  margin-top: 8px;
}
.debt-block h3 { font-size: 1rem; margin: 0 0 10px 0; }
.debt-info {
  display: flex; flex-direction: column; gap: 4px;
}
.debt-amount { font-size: 1.25rem; font-weight: 700; color: var(--accent); }
.debt-who { font-size: 0.9rem; color: var(--text-secondary); }
.calc-row select, .calc-row input {
  padding: 12px 14px;
  border: 1px solid var(--card-border);
  border-radius: 14px;
  font-size: 0.9rem;
  background: var(--card-bg);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--text-primary);
  flex: 1; min-width: 100px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.calc-row select:focus, .calc-row input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light), 0 0 16px rgba(99,102,241,0.08);
}
.calc-result {
  font-weight: 700; color: var(--accent); font-size: 1.05rem; white-space: nowrap;
  text-shadow: 0 0 20px rgba(99,102,241,0.12);
}

/* Links */
.links-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; position: relative; overflow: hidden; }
.link-btn {
  flex: 1; min-width: 90px;
  padding: 12px 16px;
  text-align: center;
  background: var(--bg-card);
  border: 1.5px solid transparent;
  border-radius: 14px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  position: relative;
  overflow: hidden;
  background-clip: padding-box;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-image: linear-gradient(var(--bg-card), var(--bg-card)),
                    linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  background-origin: border-box;
  background-clip: padding-box, border-box;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.link-btn::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: 14px;
}
.link-btn:hover {
  color: white;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}
.link-btn:hover::before { opacity: 1; }
.link-btn:active { transform: scale(0.97); }
.link-btn span { position: relative; z-index: 1; }
.link-btn .link-icon { position: relative; z-index: 1; font-size: 1rem; }

/* Exchange Form */
.exchange-form .form-row { margin-bottom: 14px; }
.exchange-form label { display: block; font-size: 0.85rem; margin-bottom: 4px; color: var(--text-secondary); }
.exchange-form select, .exchange-form input {
  width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 10px;
  font-size: 1rem; background: var(--bg-primary); color: var(--text-primary);
}
.ex-preview { padding: 12px; background: var(--bg-secondary); border-radius: 10px; margin: 12px 0; }
.btn-primary {
  width: auto; padding: 12px 24px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white; border: none; border-radius: 12px; font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: opacity 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.btn-primary:hover { opacity: 0.92; }
.btn-primary:active { transform: scale(0.97); }
.hint { color: var(--text-secondary); font-size: 0.85rem; margin-top: 8px; }

/* Sell Order Cards */
.sell-order-card { position: relative; overflow: hidden; }
.so-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.so-amount { font-size: 1.3rem; font-weight: 700; color: var(--accent); }
.so-usdt { font-size: 1rem; font-weight: 600; color: var(--success); }
.so-details { font-size: 0.85rem; color: var(--text-secondary); }
.so-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* Referral Stats */
.ref-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 12px 0; }
.ref-stat {
  text-align: center; padding: 14px 10px;
  background: var(--card-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 16px;
  border: 1px solid var(--card-border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  position: relative;
  overflow: hidden;
}
.ref-stat > * { position: relative; z-index: 1; }
.ref-stat::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,0.04) 0%, transparent 50%);
  pointer-events: none;
}
.ref-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.1);
}
.ref-val {
  display: block; font-size: 1.15rem; font-weight: 700; color: var(--accent);
  text-shadow: 0 0 20px rgba(99,102,241,0.12);
}
.ref-label { display: block; font-size: 0.75rem; color: var(--text-secondary); margin-top: 4px; font-weight: 500; }

/* Conditions / Working Hours */
.conditions-text { font-size: 0.88rem; line-height: 1.6; color: var(--text-secondary); }
.wh-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 8px;
  margin-bottom: 4px;
  border-radius: 10px;
  border-bottom: none;
  transition: background 0.2s ease;
}
.wh-row:hover { background: var(--accent-light); }
.wh-day { font-weight: 600; font-size: 0.9rem; }
.wh-val { font-size: 0.85rem; color: var(--text-secondary); font-weight: 500; }
.wh-editor-user { padding-top: 8px; }

/* List Items */
.exchange-amount-block {
  display: block;
  padding: 8px 14px;
  margin: 8px 0 0;
  border: 2px solid var(--accent);
  border-radius: 10px;
  background: var(--accent-light);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-size: 1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
[data-theme="dark"] .exchange-amount-block {
  background: rgba(129, 140, 248, 0.12);
  border: 2px solid var(--accent);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.list-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.app-list-item { cursor: pointer; }
.app-list-item:hover { background: var(--bg-secondary); }
.list-item .badge { padding: 4px 8px; border-radius: 6px; font-size: 0.75rem; font-weight: 500; }

/* Badges */
.badge.pending, .badge.available { background: #fef3c7; color: #92400e; }
.badge.completed, .badge.paid { background: #d1fae5; color: #065f46; }
.badge.rejected { background: #fee2e2; color: #991b1b; }
.badge.cancelled { background: #e5e7eb; color: #4b5563; }
.badge.taken { background: #dbeafe; color: #1e40af; }
.badge.pending_review { background: #fef3c7; color: #92400e; }
[data-theme="dark"] .badge.pending, [data-theme="dark"] .badge.available { background: #422006; color: #fcd34d; }
[data-theme="dark"] .badge.completed, [data-theme="dark"] .badge.paid { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge.rejected { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .badge.cancelled { background: #374151; color: #9ca3af; }
[data-theme="dark"] .badge.taken { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .badge.pending_review { background: #422006; color: #fcd34d; }

.badge.status-paid, .badge.status-confirmed { background: #d1fae5; color: #065f46; }
.badge.status-pending { background: #fef3c7; color: #92400e; }
.badge.status-expired { background: #fee2e2; color: #991b1b; }
.badge.status-not_received { background: #e5e7eb; color: #4b5563; }
.badge.status-video_sent { background: #dbeafe; color: #1e40af; }
.badge.status-video_approved { background: #d1fae5; color: #065f46; }
[data-theme="dark"] .badge.status-paid, [data-theme="dark"] .badge.status-confirmed { background: #064e3b; color: #6ee7b7; }
[data-theme="dark"] .badge.status-pending { background: #422006; color: #fcd34d; }
[data-theme="dark"] .badge.status-expired { background: #7f1d1d; color: #fca5a5; }
[data-theme="dark"] .badge.status-not_received { background: #374151; color: #9ca3af; }
[data-theme="dark"] .badge.status-video_sent { background: #1e3a8a; color: #93c5fd; }
[data-theme="dark"] .badge.status-video_approved { background: #064e3b; color: #6ee7b7; }

/* Filter Row */
.filter-row { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-btn {
  padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-secondary); color: var(--text-primary); font-size: 0.8rem; cursor: pointer;
}
.filter-btn:hover, .filter-btn.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Pagination */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; }
.pagination button {
  padding: 6px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card); color: var(--text-primary); cursor: pointer; font-size: 0.85rem;
}
.pagination button.active { background: var(--accent); color: white; border-color: var(--accent); }

/* Copy Link */
.copy-link {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--card-bg);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--card-border);
  border-radius: 14px; margin: 12px 0; word-break: break-all;
}
.copy-link button {
  padding: 8px 14px; border: none; border-radius: 10px; background: var(--accent);
  color: white; font-size: 0.85rem; cursor: pointer; flex-shrink: 0;
  transition: opacity 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 8px rgba(99,102,241,0.2);
}
.copy-link button:hover { opacity: 0.9; }
.copy-link button:active { transform: scale(0.95); }

.copy-link-full { margin: 12px 0; }
.copy-link-full button {
  width: 100%; padding: 14px 16px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  transition: opacity 0.2s ease, transform 0.15s ease;
  box-shadow: 0 2px 12px rgba(99,102,241,0.25);
}
.copy-link-full button:hover { opacity: 0.92; }
.copy-link-full button:active { transform: scale(0.97); }

/* Empty State */
.empty-state { text-align: center; padding: 32px 16px; color: var(--text-secondary); }

/* Requests Layout */
.requests-layout {
  display: grid; grid-template-columns: 1fr 1.2fr; gap: 12px;
  flex: 1; min-height: 0; overflow: hidden;
}
.requests-layout > * { min-height: 0; }
@media (max-width: 768px) {
  .requests-layout { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .requests-left { max-height: 35vh; }
}
.requests-left, .requests-right {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.requests-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-secondary);
}
.requests-section-header h3 { font-size: 0.95rem; margin: 0; }
.requisites-list, .payments-list {
  flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 10px;
  -webkit-overflow-scrolling: touch;
}
.requisites-list::-webkit-scrollbar, .payments-list::-webkit-scrollbar { width: 5px; }
.requisites-list::-webkit-scrollbar-thumb, .payments-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.requisite-card {
  padding: 10px; margin-bottom: 8px; background: var(--bg-secondary);
  border-radius: 8px; border: 1px solid var(--border); cursor: pointer;
}
.requisite-card:hover { border-color: var(--accent); }
.requisite-card.selected { border-color: var(--accent); background: var(--accent); color: white; }
.requisite-card.selected .requisite-bank, .requisite-card.selected .requisite-meta { color: rgba(255,255,255,0.9); }
.requisite-phone { font-weight: 600; font-size: 0.95rem; }
.requisite-bank { font-size: 0.85rem; color: var(--text-secondary); margin-top: 3px; }
.requisite-meta { font-size: 0.75rem; color: var(--text-secondary); margin-top: 4px; }

.payment-card {
  padding: 10px; margin-bottom: 8px; background: var(--bg-secondary);
  border-radius: 8px; border: 1px solid var(--border);
}
.payment-amount { font-size: 1.15rem; font-weight: 700; color: var(--accent); }
.payment-meta { font-size: 0.75rem; color: var(--text-secondary); margin-top: 4px; }
.payment-status-row { margin-top: 6px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.app-inline-detail { padding: 10px; background: var(--bg-secondary); border-radius: 8px; margin-bottom: 10px; }
.app-inline-meta p { margin: 0 0 4px; font-size: 0.85rem; }
.app-inline-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.app-inline-actions .btn, .payment-status-row .btn, .debt-actions .btn {
  padding: 5px 10px; border: none; border-radius: 6px; font-size: 0.8rem; font-weight: 600; cursor: pointer;
}
.btn-sm { padding: 4px 8px !important; font-size: 0.75rem !important; }

.btn-link { background: var(--accent); color: white; text-decoration: none; }
.btn-link:hover { opacity: 0.9; }
.btn-reject { background: var(--error); color: white; }
.btn-complete, .btn-confirm { background: var(--success); color: white; }
.btn-not { background: var(--text-secondary); color: white; }
.payments-section-title { font-size: 0.9rem; font-weight: 600; margin: 10px 0 6px; }

/* Debt actions */
.debt-actions { display: flex; gap: 6px; }

/* Command Chat Strip */
.cmd-chat-strip {
  position: fixed; bottom: 16px; right: 16px; z-index: 1000;
  display: flex; flex-direction: column; align-items: flex-end;
}
.cmd-chat-strip.hidden { display: none !important; }
.cmd-chat-strip-bar {
  display: flex; align-items: center; gap: 6px; padding: 6px 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.cmd-chat-strip-bar input {
  width: 260px; max-width: 50vw; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.85rem; background: var(--bg-primary); color: var(--text-primary);
}
.cmd-chat-strip-bar input:focus { outline: none; border-color: var(--accent); }
.cmd-chat-popup-send {
  padding: 8px 12px; border: none; border-radius: 6px;
  background: var(--accent); color: white; font-size: 0.95rem; font-weight: 600; cursor: pointer;
}

/* Settings Form */
.settings-form .settings-row { margin-bottom: 12px; }
.settings-form label { display: block; margin-bottom: 3px; font-size: 0.85rem; color: var(--text-secondary); }
.settings-form input, .settings-form select, .settings-form textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 0.95rem; background: var(--bg-primary); color: var(--text-primary);
  font-family: inherit;
}
.settings-form textarea { resize: vertical; min-height: 80px; }
.settings-form button {
  margin-top: 12px; padding: 10px 20px; border: none; border-radius: 8px;
  background: var(--accent); color: white; font-weight: 600; cursor: pointer;
}

/* Working Hours Editor */
.wh-editor { }
.wh-edit-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.wh-day-label { width: 30px; font-weight: 600; font-size: 0.85rem; flex-shrink: 0; }
.wh-type-select {
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 0.8rem; background: var(--bg-primary); color: var(--text-primary);
}
.wh-intervals-input {
  flex: 1; min-width: 100px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 0.8rem; background: var(--bg-primary); color: var(--text-primary);
}

/* Create form in details */
.create-so-form { margin-top: 12px; }
.create-so-form summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 0.9rem; }

/* Shift buttons */
.shift-btns { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }

/* Details element styling */
details.card { cursor: default; }
details.card summary { cursor: pointer; }
details.card summary h2 { cursor: pointer; }

/* ==================== User Stats Card ==================== */
.user-stats-card {
  background:
    radial-gradient(ellipse 120% 100% at 70% 0%, rgba(139,92,246,0.4) 0%, transparent 50%),
    radial-gradient(ellipse 100% 80% at 20% 100%, rgba(99,102,241,0.35) 0%, transparent 45%),
    radial-gradient(ellipse 80% 120% at 90% 50%, rgba(167,139,250,0.25) 0%, transparent 40%),
    radial-gradient(ellipse 90% 70% at 10% 30%, rgba(79,70,229,0.3) 0%, transparent 35%),
    linear-gradient(160deg, #4f46e5 0%, #6366f1 35%, #7c3aed 65%, #8b5cf6 100%);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%, 100% 100%;
  border-radius: 22px;
  padding: 28px 20px 24px;
  margin-bottom: 18px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow:
    0 12px 40px rgba(99, 102, 241, 0.35),
    0 4px 16px rgba(79, 70, 229, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* Органические blob-формы: плавные, произвольные линии через border-radius */
.user-stats-card::before {
  content: "";
  position: absolute;
  top: -80px; right: -60px;
  width: 280px; height: 260px;
  background: radial-gradient(ellipse 70% 65% at 50% 50%, rgba(255,255,255,0.14) 0%, transparent 65%);
  border-radius: 43% 57% 62% 38% / 52% 41% 59% 48%;
  animation: floatBlob1 10s ease-in-out infinite;
  filter: blur(1px);
}
.user-stats-card::after {
  content: "";
  position: absolute;
  bottom: -70px; left: -50px;
  width: 240px; height: 220px;
  background: radial-gradient(ellipse 65% 70% at 50% 50%, rgba(255,255,255,0.08) 0%, transparent 60%);
  border-radius: 61% 39% 45% 55% / 38% 62% 38% 62%;
  animation: floatBlob2 12s ease-in-out infinite;
  filter: blur(2px);
}

.card-bg-decor {
  position: absolute; inset: 0; pointer-events: none; z-index: 0; overflow: hidden;
}
.card-bg-blob {
  position: absolute;
  filter: blur(20px);
}
.card-bg-blob:nth-child(1) {
  width: 180px; height: 160px;
  top: 5%; left: 55%;
  background: radial-gradient(ellipse 60% 55% at 50% 50%, rgba(167,139,250,0.35) 0%, transparent 70%);
  border-radius: 55% 45% 60% 40% / 50% 55% 45% 50%;
  animation: floatBlob3 11s ease-in-out infinite;
}
.card-bg-blob:nth-child(2) {
  width: 140px; height: 130px;
  top: 45%; left: 5%;
  background: radial-gradient(ellipse 55% 60% at 50% 50%, rgba(129,140,248,0.28) 0%, transparent 65%);
  border-radius: 40% 60% 55% 45% / 60% 40% 50% 50%;
  animation: floatBlob1 13s ease-in-out infinite reverse;
}
.card-bg-blob:nth-child(3) {
  width: 100px; height: 90px;
  top: 25%; left: 25%;
  background: radial-gradient(ellipse 50% 55% at 50% 50%, rgba(255,255,255,0.12) 0%, transparent 70%);
  border-radius: 62% 38% 48% 52% / 45% 58% 42% 55%;
  animation: floatBlob2 9s ease-in-out infinite;
}
.card-bg-sparkles {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    radial-gradient(2px 2px at 18% 28%, rgba(255,255,255,0.5) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 78% 18%, rgba(255,255,255,0.4) 50%, transparent 50%),
    radial-gradient(2px 2px at 48% 82%, rgba(255,255,255,0.45) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 88% 68%, rgba(255,255,255,0.35) 50%, transparent 50%),
    radial-gradient(2px 2px at 28% 55%, rgba(255,255,255,0.4) 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 65% 42%, rgba(255,255,255,0.3) 50%, transparent 50%);
  animation: sparkle 5s ease-in-out infinite alternate;
  filter: blur(0.5px);
}

/* --- Avatar --- */
.user-stats-header {
  position: relative; z-index: 2;
  text-align: center; margin-bottom: 22px;
}
.avatar-ring-wrap {
  position: relative; width: 92px; height: 92px;
  margin: 0 auto 14px; display: flex; align-items: center; justify-content: center;
}
.avatar-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  padding: 3px;
  background: conic-gradient(
    from 0deg,
    rgba(255,255,255,0.7),
    rgba(167,139,250,0.6),
    rgba(99,102,241,0.5),
    rgba(255,255,255,0.3),
    rgba(167,139,250,0.6),
    rgba(255,255,255,0.7)
  );
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: spinRing 6s linear infinite;
}
.user-avatar {
  width: 80px; height: 80px; border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 800;
  border: 2.5px solid rgba(255,255,255,0.25);
  position: relative; overflow: hidden;
  animation: scaleInBounce 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
             pulseGlow 3s ease-in-out infinite 1s;
  z-index: 1;
}
.user-avatar .user-avatar-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; display: block;
  animation: fadeIn 0.5s ease forwards;
}
.user-avatar .user-avatar-initial {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  text-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.user-avatar .user-avatar-initial.hidden { display: none !important; }

/* --- Nickname --- */
.user-nickname {
  font-size: 1.5rem; font-weight: 800;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
  opacity: 0;
  animation: fadeInUpSoft 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

/* --- Status pill --- */
.user-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.6px; text-transform: uppercase;
  color: rgba(255,255,255,0.9);
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.15);
  text-shadow: 0 1px 6px rgba(0,0,0,0.15);
  opacity: 0;
  animation: fadeInUpSoft 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
}
.user-status .status-emoji {
  font-size: 1rem;
  display: inline-block;
  animation: scaleInBounce 0.5s ease 0.7s both;
}

/* --- Total users chip --- */
.user-total-in-bot {
  font-size: 0.82rem; font-weight: 500; margin-top: 12px;
  color: rgba(255,255,255,0.8);
  padding: 6px 14px; border-radius: 20px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  display: inline-flex; align-items: center; gap: 5px;
  opacity: 0;
  animation: fadeInUpSoft 0.5s ease 0.55s forwards;
}
.user-total-in-bot .chip-icon {
  font-size: 0.85rem;
}
.user-total-in-bot strong {
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.02em;
}

/* --- Stats grid --- */
.stats-mini-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  position: relative; z-index: 2;
}
.stats-mini-block {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 16px;
  padding: 14px 10px;
  text-align: center;
  border: 1px solid rgba(255,255,255,0.1);
  transition: background 0.25s ease, border-color 0.3s ease, transform 0.2s ease;
  position: relative;
  overflow: hidden;
  min-height: 0;
}
.stats-mini-block::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.stats-mini-block:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.22);
  transform: translateY(-2px);
}
.stats-mini-block:active {
  background: rgba(255,255,255,0.18);
  transform: scale(0.97);
}
.stats-mini-block.full-width .stats-value { font-size: 1.15rem; }
.stats-mini-block.full-width { grid-column: 1 / -1; }

.stats-value {
  font-size: 1.1rem; font-weight: 800; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  flex-wrap: wrap;
  text-shadow: 0 1px 4px rgba(0,0,0,0.1);
  line-height: 1.3;
  word-break: break-word;
  overflow-wrap: break-word;
}
.stats-label {
  font-size: 0.72rem; opacity: 0.7; font-weight: 500;
  display: flex; align-items: center; justify-content: center; gap: 3px;
  line-height: 1.3;
}
.stat-icon {
  font-size: 0.8rem; opacity: 0.85;
}

/* --- Top badge pill --- */
.top-badge {
  display: inline-flex; align-items: center; gap: 2px;
  font-size: 0.58rem; font-weight: 700;
  padding: 2px 5px;
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(251,191,36,0.35), rgba(245,158,11,0.25));
  border: 1px solid rgba(251,191,36,0.3);
  color: #fef3c7;
  letter-spacing: 0.03em;
  text-shadow: 0 1px 2px rgba(0,0,0,0.2);
  vertical-align: middle;
  line-height: 1.2;
  flex-shrink: 0;
  white-space: nowrap;
}
.top-badge .badge-icon {
  font-size: 0.6rem;
}

/* Floating card decor blob */
.card-float-decor {
  position: absolute;
  top: -30px; right: -30px;
  width: 100px; height: 100px;
  background: radial-gradient(ellipse 60% 55% at 50% 50%, var(--accent-light) 0%, transparent 70%);
  border-radius: 55% 45% 60% 40% / 50% 55% 45% 50%;
  filter: blur(20px);
  pointer-events: none;
  animation: softFloat 6s ease-in-out infinite;
  z-index: 0;
  opacity: 0.7;
}

/* Status icons */
.status-icon { font-size: 1rem; margin-right: 4px; }

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--border) 25%, var(--bg-secondary) 50%, var(--border) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite; border-radius: 8px;
}

/* Toast improvements */
.toast {
  border-radius: 16px; font-weight: 600;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Dark theme adjustments for user card */
[data-theme="dark"] .user-stats-card {
  background:
    radial-gradient(ellipse 120% 100% at 70% 0%, rgba(99,102,241,0.45) 0%, transparent 50%),
    radial-gradient(ellipse 100% 80% at 20% 100%, rgba(67,56,202,0.4) 0%, transparent 45%),
    radial-gradient(ellipse 80% 120% at 90% 50%, rgba(139,92,246,0.3) 0%, transparent 40%),
    radial-gradient(ellipse 90% 70% at 10% 30%, rgba(55,48,163,0.35) 0%, transparent 35%),
    linear-gradient(160deg, #312e81 0%, #3730a3 35%, #4338ca 65%, #5b21b6 100%);
  background-size: 100% 100%;
  box-shadow:
    0 12px 40px rgba(67, 56, 202, 0.4),
    0 4px 16px rgba(49, 46, 129, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
[data-theme="dark"] .card-bg-blob:nth-child(1) {
  background: radial-gradient(ellipse 60% 55% at 50% 50%, rgba(139,92,246,0.35) 0%, transparent 70%);
}
[data-theme="dark"] .card-bg-blob:nth-child(2) {
  background: radial-gradient(ellipse 55% 60% at 50% 50%, rgba(99,102,241,0.3) 0%, transparent 65%);
}
[data-theme="dark"] .stats-mini-block {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .stats-mini-block:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.16);
}
[data-theme="dark"] .user-status {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.1);
}
[data-theme="dark"] .user-total-in-bot {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}
[data-theme="dark"] .link-btn {
  background-image: linear-gradient(var(--bg-card), var(--bg-card)),
                    linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15);
}

/* Mobile bottom nav improvements */
@media (max-width: 480px) {
  .nav { padding: 6px 8px; gap: 4px; }
  .nav.nav-user button { padding: 6px 3px; }
  .nav button .nav-icon { font-size: 1rem; }
  .nav button .nav-label { font-size: 0.6rem; }
  .content { padding: 10px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .rate-grid { grid-template-columns: repeat(2, 1fr); }
  .ref-stats { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .ref-stat { border-radius: 12px; padding: 10px 6px; }
  .ref-val { font-size: 1rem; }
  .ref-label { font-size: 0.68rem; }
  .cmd-chat-strip { bottom: 10px; right: 10px; left: 10px; }
  .cmd-chat-strip-bar { width: 100%; }
  .cmd-chat-strip-bar input { width: auto; flex: 1; max-width: none; }
  .toast { top: 10px; right: 10px; left: 10px; max-width: none; }

  .user-stats-card { padding: 22px 14px 20px; border-radius: 18px; }
  .user-stats-header { margin-bottom: 16px; }
  .page-hero { padding: 18px 14px; border-radius: 16px; margin-bottom: 12px; }
  .page-hero .page-hero-icon { font-size: 1.5rem; }
  .page-hero .page-hero-title { font-size: 1.15rem; }
  .page-hero .page-hero-sub { font-size: 0.8rem; }
  .card { border-radius: 14px; padding: 14px; margin-bottom: 12px; }
  .card h2 { font-size: 1rem; margin-bottom: 10px; }
  .rate-item { border-radius: 12px; padding: 10px 8px; }
  .rate-value { font-size: 1.05rem; }
  .rate-label { font-size: 0.72rem; }
  .stat-card { border-radius: 14px; padding: 12px; }
  .stat-card .value { font-size: 1.15rem; }
  .stat-card .label { font-size: 0.75rem; }
  .avatar-ring-wrap { width: 80px; height: 80px; }
  .user-avatar { width: 68px; height: 68px; font-size: 1.4rem; }
  .user-nickname { font-size: 1.2rem; }
  .user-status { font-size: 0.75rem; padding: 4px 12px; }
  .user-total-in-bot { font-size: 0.75rem; padding: 5px 12px; margin-top: 10px; }
  .stats-mini-grid { gap: 6px; }
  .stats-mini-block { padding: 10px 8px; border-radius: 12px; }
  .stats-value { font-size: 0.95rem; gap: 3px; }
  .stats-label { font-size: 0.67rem; gap: 2px; }
  .stat-icon { font-size: 0.75rem; }
  .top-badge { font-size: 0.52rem; padding: 1px 4px; }
  .top-badge .badge-icon { font-size: 0.55rem; }
  .links-row { gap: 6px; margin-top: 8px; }
  .link-btn { padding: 10px 8px; font-size: 0.78rem; border-radius: 12px; }
  .calc-row { gap: 8px; }
  .calc-row select, .calc-row input { padding: 10px 12px; font-size: 0.85rem; min-width: 80px; }
  .calc-result { font-size: 0.95rem; }
  .copy-link-full button { padding: 12px 14px; font-size: 0.88rem; }
  .settings-form input, .settings-form select { padding: 10px; font-size: 0.9rem; }
  .settings-form label { font-size: 0.8rem; }
  .wh-row { padding: 8px 6px; }
  .wh-day { font-size: 0.82rem; }
  .wh-val { font-size: 0.78rem; }
  .tier-row { font-size: 0.8rem; padding: 6px 0; }
  .rate-tiers h3 { font-size: 0.85rem; }
  .rate-minimums { font-size: 0.8rem; }
}

@media (min-width: 769px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
