/* ============================================================
   AbarPay - Premium UI Stylesheet
   Modern, dark-mode-first design inspired by Stripe & Linear.
   ============================================================ */

:root {
  /* Color palette - dark theme (default) */
  --bg: #0a0e1a;
  --bg-soft: #0f1420;
  --surface: #131826;
  --surface-2: #1a2030;
  --surface-3: #212a3d;
  --border: #1f2937;
  --border-strong: #2d3748;
  --text: #f3f4f6;
  --text-soft: #cbd5e1;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Brand colors */
  --primary: #10b981;
  --primary-hover: #059669;
  --primary-soft: rgba(16, 185, 129, 0.1);
  --primary-glow: rgba(16, 185, 129, 0.3);
  --bitcoin: #f7931a;
  --ethereum: #627eea;
  --tron: #26a17b;
  --tether: #26a17b;

  /* Status colors */
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.12);
  --info: #3b82f6;
  --info-soft: rgba(59, 130, 246, 0.12);
  --purple: #a855f7;
  --purple-soft: rgba(168, 85, 247, 0.12);

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Radii */
  --radius-sm: 6px;
  --radius: 8px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.1);
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--primary-glow);

  /* Typography */
  --font-sans: 'Vazirmatn', -apple-system, BlinkMacSystemFont, 'Segoe UI', Tahoma, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', ui-monospace, monospace;
  --font-size-xs: 11px;
  --font-size-sm: 13px;
  --font-size: 14px;
  --font-size-lg: 16px;
  --font-size-xl: 20px;
  --font-size-2xl: 24px;
  --font-size-3xl: 32px;

  /* Layout */
  --sidebar-w: 240px;
  --header-h: 64px;
  --content-max: 1280px;
}

/* Light theme override */
[data-theme="light"] {
  --bg: #f8fafc;
  --bg-soft: #f1f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --surface-3: #f1f5f9;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-soft: #334155;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: var(--font-size);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-hover); }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }

/* Typography */
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }
h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.font-mono { font-family: var(--font-mono); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.ltr { direction: ltr; }
.rtl { direction: rtl; }

/* Layout */
.container { max-width: var(--content-max); margin: 0 auto; padding: 0 var(--space-6); }
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
.app.no-sidebar { grid-template-columns: 1fr; }

/* Sidebar */
.sidebar {
  background: var(--surface);
  border-left: 1px solid var(--border);
  padding: var(--space-6) var(--space-4);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}
.sidebar .brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 0 var(--space-2) var(--space-6);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-4);
}
.sidebar .brand-icon {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--bitcoin), var(--primary));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: white; font-weight: 700;
}
.sidebar .brand h2 { font-size: 16px; margin: 0; }
.sidebar .brand .sub { font-size: 10px; color: var(--text-muted); }
.sidebar nav ul { list-style: none; padding: 0; }
.sidebar nav li { margin-bottom: 2px; }
.sidebar nav a {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  color: var(--text-soft);
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  font-weight: 500;
  transition: all .15s;
}
.sidebar nav a:hover {
  background: var(--surface-2);
  color: var(--text);
}
.sidebar nav a.active {
  background: var(--primary-soft);
  color: var(--primary);
}
.sidebar nav a svg { width: 18px; height: 18px; flex-shrink: 0; }
.sidebar .nav-section {
  font-size: 10px;
  text-transform: uppercase;
  color: var(--text-dim);
  letter-spacing: 1px;
  padding: var(--space-4) var(--space-3) var(--space-2);
  font-weight: 700;
}

/* Main */
.main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.main-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}
.main-header h1 { font-size: var(--font-size-lg); margin: 0; }
.main-content {
  flex: 1;
  padding: var(--space-6);
  max-width: 100%;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  margin-bottom: var(--space-4);
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-4);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border);
}
.card-title { font-size: var(--font-size-lg); font-weight: 600; }
.card-body { padding: 0; }

/* Grid */
.grid { display: grid; gap: var(--space-4); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-auto-fill { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 20px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-lg { padding: 14px 28px; font-size: var(--font-size-lg); }
.btn-sm { padding: 6px 12px; font-size: var(--font-size-xs); }
.btn-block { width: 100%; }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--border-strong); }
.btn-outline:hover { background: var(--surface-2); border-color: var(--primary); }
.btn-secondary { background: var(--surface-3); color: var(--text); }
.btn-secondary:hover { background: var(--border-strong); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: #dc2626; }
.btn-ghost { background: transparent; color: var(--text-soft); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-icon { padding: 8px; width: 36px; height: 36px; }

/* Forms */
.form-group { margin-bottom: var(--space-4); }
.form-group label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
  color: var(--text-soft);
}
.form-group .hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}
.form-control,
input[type="text"], input[type="email"], input[type="password"],
input[type="number"], input[type="url"], textarea, select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  color: var(--text);
  font-size: var(--font-size);
  font-family: inherit;
  transition: all .15s;
}
.form-control:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
input[type="checkbox"] { width: auto; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  font-size: var(--font-size-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid;
}
.badge-success { background: var(--success-soft); color: var(--success); border-color: rgba(16,185,129,.3); }
.badge-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(245,158,11,.3); }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(239,68,68,.3); }
.badge-info { background: var(--info-soft); color: var(--info); border-color: rgba(59,130,246,.3); }
.badge-purple { background: var(--purple-soft); color: var(--purple); border-color: rgba(168,85,247,.3); }
.badge-muted { background: var(--surface-3); color: var(--text-muted); border-color: var(--border); }

/* Status badges */
.badge-status-pending { background: var(--warning-soft); color: var(--warning); }
.badge-status-detected { background: var(--info-soft); color: var(--info); }
.badge-status-paid, .badge-status-confirmed, .badge-status-active { background: var(--success-soft); color: var(--success); }
.badge-status-expired, .badge-status-cancelled, .badge-status-banned { background: var(--surface-3); color: var(--text-muted); }
.badge-status-underpaid { background: var(--warning-soft); color: var(--warning); }
.badge-status-overpaid { background: var(--purple-soft); color: var(--purple); }
.badge-status-failed, .badge-status-rejected { background: var(--danger-soft); color: var(--danger); }

/* Tables */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-sm);
}
th, td {
  padding: 12px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}
th {
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: var(--font-size-xs);
  letter-spacing: 0.5px;
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr:last-child td { border-bottom: none; }
td.mono { font-family: var(--font-mono); font-size: var(--font-size-xs); }
td.num { font-variant-numeric: tabular-nums; text-align: left; direction: ltr; }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  border: 1px solid;
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-4);
  display: flex;
  gap: var(--space-3);
  align-items: flex-start;
}
.alert-success { background: var(--success-soft); color: var(--success); border-color: rgba(16,185,129,.3); }
.alert-warning { background: var(--warning-soft); color: var(--warning); border-color: rgba(245,158,11,.3); }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: rgba(239,68,68,.3); }
.alert-info { background: var(--info-soft); color: var(--info); border-color: rgba(59,130,246,.3); }

/* Stats cards */
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  position: relative;
  overflow: hidden;
  transition: all .2s;
}
.stat-card:hover { border-color: var(--primary); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card .label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-2);
}
.stat-card .value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.stat-card .change {
  font-size: var(--font-size-xs);
  margin-top: var(--space-2);
}
.stat-card .change.up { color: var(--success); }
.stat-card .change.down { color: var(--danger); }
.stat-card .icon {
  position: absolute;
  top: var(--space-4);
  left: var(--space-4);
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-soft);
  color: var(--primary);
}
.stat-card .icon svg { width: 20px; height: 20px; }

/* Invoice cards */
.invoice-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--surface-2);
  border-radius: var(--radius);
}
.invoice-amount-fiat { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }
.invoice-amount-crypto { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text-muted); }

/* QR Code */
.qr-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-6);
}
.qr-code {
  background: white;
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  border: 4px solid white;
  box-shadow: var(--shadow-md);
}
.qr-code img, .qr-code canvas { display: block; }

/* Address copy box */
.copy-box {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  word-break: break-all;
  cursor: pointer;
  transition: all .15s;
}
.copy-box:hover { border-color: var(--primary); }
.copy-box.copied { background: var(--success-soft); border-color: var(--success); color: var(--success); }

/* Login pages */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a0e1a 0%, #131826 100%);
  padding: var(--space-6);
}
.auth-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
}
.auth-card .logo {
  text-align: center;
  margin-bottom: var(--space-6);
}
.auth-card .logo-icon {
  width: 56px; height: 56px;
  margin: 0 auto var(--space-3);
  background: linear-gradient(135deg, var(--bitcoin), var(--primary));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; box-shadow: var(--shadow-glow);
}
.auth-card h1 { font-size: var(--font-size-xl); text-align: center; margin-bottom: var(--space-1); }
.auth-card .subtitle { text-align: center; color: var(--text-muted); font-size: var(--font-size-sm); margin-bottom: var(--space-6); }

/* Checkout page */
.checkout-page {
  min-height: 100vh;
  background: linear-gradient(135deg, #0a0e1a 0%, #131826 100%);
  padding: var(--space-6);
  display: flex;
  align-items: center;
  justify-content: center;
}
.checkout-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}
.countdown {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 12px;
  background: var(--warning-soft);
  color: var(--warning);
  border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

/* Progress / confirmations */
.progress {
  display: flex;
  gap: 4px;
  align-items: center;
}
.progress-dot {
  width: 8px; height: 8px;
  border-radius: var(--radius-full);
  background: var(--border-strong);
  transition: all .2s;
}
.progress-dot.filled { background: var(--primary); }
.progress-dot.current { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }

/* Spinner */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border-strong);
  border-top-color: var(--primary);
  border-radius: var(--radius-full);
  animation: spin 0.6s linear infinite;
}
.spinner-lg { width: 24px; height: 24px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.animate-fade { animation: fadeIn .3s ease-out; }
.animate-pulse { animation: pulse 1.5s infinite; }

/* Tooltip */
.tooltip { position: relative; }
.tooltip:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: 100%; right: 50%;
  transform: translateX(50%);
  background: var(--surface-3);
  color: var(--text);
  padding: 4px 10px;
  font-size: var(--font-size-xs);
  border-radius: var(--radius);
  white-space: nowrap;
  margin-bottom: 4px;
  z-index: 100;
  border: 1px solid var(--border-strong);
}

/* Code blocks */
.code-block {
  background: #0d111c;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: #cbd5e1;
  overflow-x: auto;
  direction: ltr;
  text-align: left;
}
.code-block .key { color: #79c0ff; }
.code-block .str { color: #a5d6ff; }
.code-block .com { color: #8b949e; }

/* Avatar */
.avatar {
  width: 32px; height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--bitcoin), var(--primary));
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: var(--font-size-sm);
}
.avatar-lg { width: 48px; height: 48px; font-size: var(--font-size-lg); }

/* Empty state */
.empty-state {
  text-align: center;
  padding: var(--space-12);
  color: var(--text-muted);
}
.empty-state svg {
  width: 64px; height: 64px;
  opacity: 0.3;
  margin-bottom: var(--space-4);
}

/* Responsive */
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    right: -100%;
    width: 280px;
    z-index: 50;
    transition: right .3s;
    border-left: none;
    border-right: 1px solid var(--border);
  }
  .sidebar.open { right: 0; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .main-content { padding: var(--space-4); }
  .card { padding: var(--space-4); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .invoice-summary { grid-template-columns: 1fr; }
  .auth-card, .checkout-card { padding: var(--space-5); }
  h1 { font-size: var(--font-size-2xl); }
  .stat-card .value { font-size: var(--font-size-xl); }
  .hide-mobile { display: none !important; }
}

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* Hide number input arrows */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* Toast notifications (floating) */
.toast-container {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.toast {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 16px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideIn .3s ease-out;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
}
.toast-success { border-color: var(--success); }
.toast-error { border-color: var(--danger); }
.toast-warning { border-color: var(--warning); }

/* ============================================================
   AbarPay - Extended UI Components
   Wallet buttons, swap, chat widget, language switcher
   ============================================================ */

/* Language switcher */
.lang-switcher {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}
.lang-switcher button {
  background: transparent;
  color: var(--text-muted);
  border: none;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}
.lang-switcher button.active {
  background: var(--primary);
  color: white;
}

/* Wallet connect buttons */
.wallet-buttons {
  display: grid;
  gap: var(--space-3);
  margin: var(--space-4) 0;
}
.wallet-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  font-size: var(--font-size);
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  width: 100%;
  text-align: right;
}
.wallet-btn:hover {
  border-color: var(--primary);
  background: var(--surface-3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.wallet-btn .wallet-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.wallet-btn .wallet-info {
  flex: 1;
  text-align: right;
}
.wallet-btn .wallet-info .name {
  font-weight: 600;
  font-size: var(--font-size-sm);
}
.wallet-btn .wallet-info .desc {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.wallet-btn .wallet-badge {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  background: var(--surface-3);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

/* Swap page */
.swap-container {
  max-width: 480px;
  margin: 0 auto;
}
.swap-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: var(--space-6);
  box-shadow: var(--shadow-md);
}
.swap-row {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  position: relative;
}
.swap-row label {
  display: block;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-bottom: var(--space-2);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.swap-input-row {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}
.swap-input-row input {
  background: transparent;
  border: none;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text);
  width: 100%;
  padding: 0;
}
.swap-input-row input:focus {
  outline: none;
}
.swap-currency-select {
  background: var(--surface-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  min-width: 120px;
}
.swap-arrow {
  text-align: center;
  margin: var(--space-2) 0;
  position: relative;
  z-index: 1;
}
.swap-arrow button {
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--primary);
  font-size: 18px;
}
.swap-info {
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: var(--surface-2);
  border-radius: var(--radius);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.swap-info-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
}

/* Live chat widget */
.chat-widget {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 999;
}
.chat-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--bitcoin));
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-lg), 0 0 20px var(--primary-glow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: transform .2s;
  position: relative;
}
.chat-toggle:hover {
  transform: scale(1.05);
}
.chat-toggle .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--danger);
  color: white;
  font-size: 10px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  padding: 0 5px;
  border: 2px solid var(--bg);
}
.chat-window {
  position: absolute;
  bottom: 75px;
  left: 0;
  width: 360px;
  max-width: calc(100vw - 40px);
  height: 500px;
  max-height: calc(100vh - 100px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chat-window.open {
  display: flex;
}
.chat-header {
  background: linear-gradient(135deg, var(--primary), var(--bitcoin));
  color: white;
  padding: var(--space-3) var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.chat-header .info {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.chat-status-dot {
  width: 10px;
  height: 10px;
  background: #4ade80;
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 2s infinite;
}
.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-3);
  background: var(--bg-soft);
}
.chat-message {
  max-width: 80%;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  word-wrap: break-word;
  animation: fadeIn .2s ease-out;
}
.chat-message.visitor {
  background: var(--surface-3);
  margin-left: auto;
  border-bottom-right-radius: 2px;
}
.chat-message.agent {
  background: var(--primary);
  color: white;
  margin-right: auto;
  border-bottom-left-radius: 2px;
}
.chat-message.system {
  text-align: center;
  background: transparent;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  font-style: italic;
}
.chat-message .meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
  opacity: .7;
}
.chat-message.agent .meta {
  color: rgba(255,255,255,.7);
}
.chat-message .delete-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 2px;
  margin-top: 4px;
}
.chat-message:hover .delete-btn {
  display: inline-block;
}
.chat-input-row {
  padding: var(--space-2);
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  gap: var(--space-2);
}
.chat-input-row input {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  color: var(--text);
  font-size: var(--font-size-sm);
}
.chat-input-row button {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-full);
  width: 36px;
  height: 36px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.chat-info-form {
  padding: var(--space-4);
}
.chat-info-form .form-group {
  margin-bottom: var(--space-3);
}
.chat-info-form input {
  background: var(--surface-2);
}

/* Chat admin panel */
.chat-admin-list {
  max-height: 600px;
  overflow-y: auto;
}
.chat-session-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}
.chat-session-item:hover { background: var(--surface-2); }
.chat-session-item.active { background: var(--primary-soft); border-right: 3px solid var(--primary); }
.chat-session-item .avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--bitcoin), var(--primary));
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  font-size: var(--font-size);
  flex-shrink: 0;
}
.chat-session-item .info {
  flex: 1;
  min-width: 0;
}
.chat-session-item .info .name {
  font-weight: 600;
  font-size: var(--font-size-sm);
}
.chat-session-item .info .last-msg {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-session-item .meta {
  text-align: left;
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}
.chat-session-item .unread-badge {
  background: var(--danger);
  color: white;
  border-radius: var(--radius-full);
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

/* Notification badges */
.notification-dot {
  position: relative;
}
.notification-dot::after {
  content: '';
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  border: 2px solid var(--surface);
  animation: pulse 1.5s infinite;
}

/* Gradient text */
.gradient-text {
  background: linear-gradient(135deg, var(--bitcoin), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Glow effect for cards */
.glow-card {
  position: relative;
  overflow: hidden;
}
.glow-card::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(135deg, var(--bitcoin), var(--primary), var(--ethereum));
  border-radius: var(--radius-lg);
  z-index: -1;
  opacity: 0;
  transition: opacity .3s;
}
.glow-card:hover::before {
  opacity: .5;
}

/* Premium header gradient bar */
.brand-bar {
  height: 3px;
  background: linear-gradient(90deg, var(--bitcoin), var(--primary), var(--ethereum), var(--tron));
  background-size: 200% 100%;
  animation: gradientShift 4s ease infinite;
}
@keyframes gradientShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

/* Shimmer loading */
.shimmer {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Toast improvements */
.toast {
  border-right: 4px solid var(--primary);
  min-width: 280px;
  max-width: 400px;
}
.toast-success { border-right-color: var(--success); }
.toast-error { border-right-color: var(--danger); }
.toast-warning { border-right-color: var(--warning); }
.toast-info { border-right-color: var(--info); }

/* Responsive chat */
@media (max-width: 640px) {
  .chat-widget { bottom: 15px; left: 15px; }
  .chat-window {
    width: calc(100vw - 30px);
    height: calc(100vh - 100px);
  }
}
