/* ==========================================================================
   AI88 Relay Station — Commercial Dark Theme
   Inspired by unity2.ai dashboard aesthetic
   ========================================================================== */

/* -------------------------------------------------------------------------- */
/*  CSS Variables / Design Tokens                                              */
/* -------------------------------------------------------------------------- */
:root {
  /* Background layers */
  --bg-primary: #0f1117;
  --bg-secondary: #161822;
  --bg-card: #1a1d29;
  --bg-card-hover: #21253a;
  --bg-input: #1e2130;
  --border-color: #252a3b;
  --border-light: #2d3349;

  /* Text layers */
  --text-primary: #e4e6eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  /* Accent colors */
  --accent-cyan: #00d4aa;
  --accent-cyan-dim: rgba(0, 212, 170, 0.15);
  --accent-cyan-glow: rgba(0, 212, 170, 0.08);
  --accent-purple: #8b5cf6;
  --accent-purple-dim: rgba(139, 92, 246, 0.15);
  --accent-blue: #3b82f6;
  --accent-blue-dim: rgba(59, 130, 246, 0.15);
  --accent-orange: #f59e0b;
  --accent-orange-dim: rgba(245, 158, 11, 0.15);
  --accent-red: #ef4444;
  --accent-red-dim: rgba(239, 68, 68, 0.15);
  --accent-green: #22c55e;
  --accent-green-dim: rgba(34, 197, 94, 0.15);

  /* Layout dimensions */
  --sidebar-width: 250px;
  --sidebar-collapsed: 72px;
  --topbar-height: 60px;
  --content-max: 1400px;

  /* Border radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow-cyan: 0 0 20px rgba(0, 212, 170, 0.15);

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms ease;
}

/* -------------------------------------------------------------------------- */
/*  Reset & Base                                                               */
/* -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

a {
  color: var(--accent-cyan);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

code {
  font-family: "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
  background: var(--bg-input);
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  font-size: 0.88em;
  color: var(--accent-cyan);
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
}

[x-cloak] { display: none !important; }

/* Utility classes */
.muted { color: var(--text-secondary); }
.text-muted { color: var(--text-muted); }
.small { font-size: 0.8rem; }
.text-green { color: var(--accent-green); }
.text-red { color: var(--accent-red); }
.text-cyan { color: var(--accent-cyan); }
.text-purple { color: var(--accent-purple); }
.text-blue { color: var(--accent-blue); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }

/* -------------------------------------------------------------------------- */
/*  Public Navigation (landing, pricing, login, register)                     */
/* -------------------------------------------------------------------------- */
.public-nav {
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}
.public-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.public-nav .logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.public-nav .logo .logo-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent-cyan);
  box-shadow: 0 0 10px var(--accent-cyan);
}
.public-nav-links {
  display: flex;
  align-items: center;
  gap: 28px;
}
.public-nav-links a {
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: color var(--transition-fast);
}
.public-nav-links a:hover {
  color: var(--text-primary);
  text-decoration: none;
}
.public-nav-links .btn {
  color: var(--text-primary);
}

.badge-local {
  background: var(--accent-orange);
  color: #1a1a1a;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  margin-left: 4px;
  vertical-align: middle;
}

/* -------------------------------------------------------------------------- */
/*  Public Main & Footer                                                       */
/* -------------------------------------------------------------------------- */
.public-main {
  min-height: calc(100vh - 64px);
}
.public-footer {
  border-top: 1px solid var(--border-color);
  padding: 32px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.public-footer a {
  color: var(--text-secondary);
}

/* -------------------------------------------------------------------------- */
/*  Console App Layout                                                         */
/* -------------------------------------------------------------------------- */
.app-layout {
  display: flex;
  min-height: 100vh;
  background: var(--bg-primary);
}

.app-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  transition: width var(--transition-base);
  overflow: hidden;
}

.app-main {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-width: 0;
  transition: margin-left var(--transition-base);
}

/* -------------------------------------------------------------------------- */
/*  Sidebar                                                                    */
/* -------------------------------------------------------------------------- */
.sidebar-logo {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 20px;
  border-bottom: 1px solid var(--border-color);
  gap: 10px;
  flex-shrink: 0;
}
.sidebar-logo .logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), #00b894);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f1117;
  flex-shrink: 0;
}
.sidebar-logo .logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  white-space: nowrap;
}
.sidebar-logo .logo-text .accent {
  color: var(--accent-cyan);
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  padding: 16px 12px 6px;
  white-space: nowrap;
}

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 12px 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
  white-space: nowrap;
}
.sidebar-link:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  text-decoration: none;
}
.sidebar-link.active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
}
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 60%;
  background: var(--accent-cyan);
  border-radius: 0 2px 2px 0;
}
.sidebar-link .sidebar-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}
.sidebar-footer .version {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.sidebar-footer .theme-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: background var(--transition-fast);
}
.sidebar-footer .theme-toggle:hover {
  background: var(--bg-card-hover);
}
.sidebar-footer .theme-toggle .toggle-track {
  width: 36px;
  height: 20px;
  border-radius: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  position: relative;
  transition: background var(--transition-fast);
}
.sidebar-footer .theme-toggle .toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--text-secondary);
  transition: all var(--transition-fast);
}

/* -------------------------------------------------------------------------- */
/*  Topbar                                                                     */
/* -------------------------------------------------------------------------- */
.topbar {
  height: var(--topbar-height);
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-breadcrumb {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.topbar-breadcrumb .current {
  color: var(--text-primary);
  font-weight: 600;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-balance {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--accent-green-dim);
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent-green);
}
.topbar-balance .wallet-icon {
  font-size: 1rem;
}
.topbar-balance-cny {
  font-size: 0.78em;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.7);
  margin-left: 4px;
}
.topbar-user {
  position: relative;
}
.topbar-user-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-primary);
  font-size: 0.88rem;
}
.topbar-user-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
}
.topbar-user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  color: #0f1117;
  flex-shrink: 0;
}
.topbar-user-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 6px;
  z-index: 150;
}
.topbar-user-dropdown a,
.topbar-user-dropdown button {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-decoration: none;
  width: 100%;
  border: none;
  background: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
}
.topbar-user-dropdown a:hover,
.topbar-user-dropdown button:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  text-decoration: none;
}
.topbar-user-dropdown .dropdown-divider {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 4px 0;
}
.topbar-user-dropdown .logout:hover {
  color: var(--accent-red) !important;
}

/* -------------------------------------------------------------------------- */
/*  Content Area                                                               */
/* -------------------------------------------------------------------------- */
.content-area {
  flex: 1;
  padding: 24px;
  max-width: var(--content-max);
  width: 100%;
}
.content-area h1 {
  font-size: 1.5rem;
  margin-bottom: 4px;
}
.content-area h2 {
  font-size: 1.15rem;
  margin-bottom: 12px;
}

.page-head {
  margin-bottom: 24px;
}
.page-head h1 {
  margin-bottom: 4px;
}
.page-head p {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

/* -------------------------------------------------------------------------- */
/*  Buttons                                                                    */
/* -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-light);
  text-decoration: none;
}
.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), #00b894);
  border-color: transparent;
  color: #0f1117;
  font-weight: 600;
}
.btn-primary:hover {
  background: linear-gradient(135deg, #00e8b8, #00cca0);
  box-shadow: 0 4px 16px rgba(0, 212, 170, 0.3);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-outline {
  background: transparent;
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}
.btn-outline:hover {
  background: var(--accent-cyan-dim);
  border-color: var(--accent-cyan);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-secondary);
}
.btn-ghost:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.btn-danger {
  background: transparent;
  border-color: var(--accent-red);
  color: var(--accent-red);
}
.btn-danger:hover {
  background: var(--accent-red-dim);
}

.btn-sm {
  padding: 5px 12px;
  font-size: 0.82rem;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 12px 28px;
  font-size: 1rem;
}
.btn-block {
  width: 100%;
}

/* -------------------------------------------------------------------------- */
/*  Cards                                                                      */
/* -------------------------------------------------------------------------- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: all var(--transition-base);
}
.card-hover:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

/* Stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  overflow: hidden;
  transition: all var(--transition-base);
}
.stat-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}
.stat-card .stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 14px;
}
.stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 4px;
}
.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
}
.stat-card .stat-cny {
  font-size: 0.55em;
  font-weight: 500;
  color: var(--text-secondary);
  vertical-align: middle;
  margin-left: 6px;
}

/* Stat card color variants */
.stat-card.cyan {
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.1), rgba(0, 212, 170, 0.02));
  border-color: rgba(0, 212, 170, 0.15);
}
.stat-card.cyan .stat-icon { background: var(--accent-cyan-dim); }
.stat-card.cyan .stat-value { color: var(--accent-cyan); }

.stat-card.purple {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(139, 92, 246, 0.02));
  border-color: rgba(139, 92, 246, 0.15);
}
.stat-card.purple .stat-icon { background: var(--accent-purple-dim); }
.stat-card.purple .stat-value { color: var(--accent-purple); }

.stat-card.blue {
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.02));
  border-color: rgba(59, 130, 246, 0.15);
}
.stat-card.blue .stat-icon { background: var(--accent-blue-dim); }
.stat-card.blue .stat-value { color: var(--accent-blue); }

.stat-card.orange {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.02));
  border-color: rgba(245, 158, 11, 0.15);
}
.stat-card.orange .stat-icon { background: var(--accent-orange-dim); }
.stat-card.orange .stat-value { color: var(--accent-orange); }

.stat-card.green {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.1), rgba(34, 197, 94, 0.02));
  border-color: rgba(34, 197, 94, 0.15);
}
.stat-card.green .stat-icon { background: var(--accent-green-dim); }
.stat-card.green .stat-value { color: var(--accent-green); }

/* -------------------------------------------------------------------------- */
/*  Tables                                                                     */
/* -------------------------------------------------------------------------- */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  overflow-x: auto;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}
.table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: var(--bg-secondary);
}
.table tbody tr {
  transition: background var(--transition-fast);
}
.table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.015);
}
.table tbody tr:hover {
  background: var(--bg-card-hover);
}
.table tbody tr:last-child td {
  border-bottom: none;
}
.table td code {
  font-size: 0.85em;
}

/* -------------------------------------------------------------------------- */
/*  Tags / Badges                                                              */
/* -------------------------------------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.tag-success { background: var(--accent-green-dim); color: var(--accent-green); }
.tag-failed { background: var(--accent-red-dim); color: var(--accent-red); }
.tag-incomplete { background: var(--accent-orange-dim); color: var(--accent-orange); }
.tag-pending { background: var(--accent-orange-dim); color: var(--accent-orange); }
.tag-paid { background: var(--accent-green-dim); color: var(--accent-green); }
.tag-closed { background: rgba(107, 114, 128, 0.18); color: var(--text-muted); }
.tag-refunded { background: var(--accent-blue-dim); color: var(--accent-blue); }
.tag-active { background: var(--accent-green-dim); color: var(--accent-green); }
.tag-inactive { background: rgba(107, 114, 128, 0.18); color: var(--text-muted); }

/* -------------------------------------------------------------------------- */
/*  Forms & Inputs                                                             */
/* -------------------------------------------------------------------------- */
.inline-form {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin: 12px 0;
}
.form-group {
  margin-bottom: 18px;
}
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.92rem;
  font-family: inherit;
  transition: all var(--transition-fast);
  outline: none;
}
.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-dim);
}
.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%239ca3af' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}
.input-sm {
  width: 90px;
  padding: 5px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 0.85rem;
}
.input-prefix-group {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.input-prefix {
  position: absolute;
  left: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  pointer-events: none;
  z-index: 1;
}
.input-prefix-lg .input-prefix {
  left: 16px;
  font-size: 1.2rem;
}
.input-prefix-lg .form-input {
  padding-left: 42px;
  min-width: 240px;
}
.custom-amount-card {
  background: var(--bg-card);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  transition: all var(--transition-fast);
}
.custom-amount-card:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px var(--accent-cyan-dim);
}
.custom-amount-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.custom-amount-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.custom-amount-hint {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  padding: 4px 10px;
  border-radius: 20px;
}
.custom-amount-body {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.custom-amount-input {
  font-size: 1.25rem;
  font-weight: 700;
  padding: 14px 14px 14px 46px;
  min-width: 220px;
  width: 260px;
}
.custom-amount-input::placeholder {
  font-size: 0.95rem;
  font-weight: 400;
}
.custom-amount-converted {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-cyan);
}
.balance-cny {
  font-size: 0.55em;
  font-weight: 500;
  color: var(--text-secondary);
  vertical-align: middle;
  margin-left: 8px;
}

/* -------------------------------------------------------------------------- */
/*  Auth Pages (login / register)                                              */
/* -------------------------------------------------------------------------- */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary);
  position: relative;
  overflow: hidden;
}
.auth-page::before {
  content: "";
  position: absolute;
  top: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 212, 170, 0.08) 0%, transparent 70%);
  pointer-events: none;
}
.auth-page::after {
  content: "";
  position: absolute;
  bottom: -200px;
  right: 10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.06) 0%, transparent 70%);
  pointer-events: none;
}
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-lg);
}
.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}
.auth-logo .logo-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-cyan), #00b894);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f1117;
  margin-bottom: 12px;
}
.auth-logo .logo-name {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}
.auth-logo .logo-name .accent { color: var(--accent-cyan); }
.auth-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}
.auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 28px;
}
.auth-form .form-group {
  margin-bottom: 18px;
}
.auth-input-wrap {
  position: relative;
}
.auth-input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  color: var(--text-muted);
  pointer-events: none;
}
.auth-input-wrap .form-input {
  padding-left: 42px;
}
.auth-input-wrap .toggle-pwd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 4px;
}
.auth-input-wrap .toggle-pwd:hover {
  color: var(--text-secondary);
}
.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  font-size: 0.85rem;
}
.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}
.auth-checkbox input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}
.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}
.auth-footer a {
  color: var(--accent-cyan);
  font-weight: 600;
}
.auth-msg {
  text-align: center;
  font-size: 0.85rem;
  margin-top: 12px;
  min-height: 20px;
}
.auth-msg.msg-error {
  color: #ffb4b4;
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.5);
  padding: 11px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  min-height: auto;
  text-align: left;
  animation: msg-shake 0.4s ease;
}
.auth-msg.msg-success {
  color: #9dffce;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.5);
  padding: 11px 14px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.88rem;
  min-height: auto;
  text-align: left;
}
@keyframes msg-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* -------------------------------------------------------------------------- */
/*  Landing Page                                                               */
/* -------------------------------------------------------------------------- */
.hero {
  text-align: center;
  padding: 100px 24px 60px;
  max-width: 800px;
  margin: 0 auto;
}
.hero h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.15;
  margin-bottom: 20px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--accent-cyan) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero .hero-sub {
  color: var(--text-secondary);
  font-size: 1.15rem;
  margin-bottom: 36px;
  line-height: 1.7;
}
.hero .cta {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 60px;
}
.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: all var(--transition-base);
}
.feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-cyan);
  box-shadow: 0 8px 24px rgba(0, 212, 170, 0.1);
}
.feature-card .feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--accent-cyan-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}
.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}
.feature-card p {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.7;
}
.feature-card code {
  font-size: 0.85em;
}

.pricing-preview-section {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px 80px;
  text-align: center;
}
.pricing-preview-section h2 {
  font-size: 1.8rem;
  margin-bottom: 8px;
}
.pricing-preview-section > p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* -------------------------------------------------------------------------- */
/*  Pricing Page                                                               */
/* -------------------------------------------------------------------------- */
.pricing-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px;
}
.pricing-page .page-head {
  text-align: center;
  margin-bottom: 40px;
}
.pricing-page .page-head h1 {
  font-size: 2.2rem;
  margin-bottom: 10px;
}
.pricing-page .page-head p {
  font-size: 1rem;
}
.pricing-table {
  margin-bottom: 32px;
}
.pricing-cta {
  text-align: center;
  margin-top: 32px;
}

/* FAQ */
.faq-section {
  max-width: 760px;
  margin: 48px auto 0;
}
.faq-section h2 {
  text-align: center;
  margin-bottom: 24px;
}
.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  overflow: hidden;
}
.faq-question {
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
}
.faq-question:hover {
  color: var(--accent-cyan);
}
.faq-question .faq-arrow {
  transition: transform var(--transition-fast);
  color: var(--text-muted);
}
.faq-item.open .faq-arrow {
  transform: rotate(180deg);
}
.faq-answer {
  padding: 0 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  max-height: 0;
  overflow: hidden;
  transition: all var(--transition-base);
}
.faq-item.open .faq-answer {
  padding: 0 20px 16px;
  max-height: 200px;
}

/* -------------------------------------------------------------------------- */
/*  Recharge Page                                                              */
/* -------------------------------------------------------------------------- */
.balance-display {
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.12), rgba(0, 212, 170, 0.03));
  border: 1px solid rgba(0, 212, 170, 0.2);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.balance-display .balance-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 4px;
}
.balance-display .balance-amount {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--accent-cyan);
}
.balance-display .balance-icon {
  font-size: 2.5rem;
  opacity: 0.4;
}

.info-banner {
  background: var(--accent-blue-dim);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--accent-blue);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tier-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
.tier-card {
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}
.tier-card:hover {
  border-color: var(--border-light);
  transform: translateY(-2px);
}
.tier-card.selected {
  border-color: var(--accent-cyan);
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.08), transparent);
  box-shadow: 0 0 0 3px var(--accent-cyan-dim);
}
.tier-card .tier-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(90deg, var(--accent-orange), #d97706);
  color: #1a1a1a;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: 20px;
  white-space: nowrap;
}
.tier-card .tier-cny {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.tier-card .tier-usd {
  font-size: 0.88rem;
  color: var(--accent-cyan);
  font-weight: 600;
}

.pay-methods {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
}
.pay-method {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-size: 0.92rem;
  font-weight: 500;
}
.pay-method:hover {
  border-color: var(--border-light);
}
.pay-method.selected {
  border-color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
}

/* QR Modal */
.qr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
}
.qr-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  max-width: 360px;
  width: 90%;
}
.qr-modal h3 {
  margin-bottom: 6px;
}
.qr-modal .qr-subtitle {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.qr-modal .qr-img {
  width: 220px;
  height: 220px;
  background: #fff;
  padding: 10px;
  border-radius: var(--radius-md);
  margin: 0 auto 16px;
}
.qr-modal .qr-info {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.qr-modal .qr-info code {
  font-size: 0.85em;
}
.qr-modal .qr-amount {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin: 8px 0 16px;
}

/* -------------------------------------------------------------------------- */
/*  Keys Page                                                                  */
/* -------------------------------------------------------------------------- */
.keys-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.key-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.key-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  transition: all var(--transition-fast);
}
.key-card:hover {
  border-color: var(--border-light);
}
.key-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.key-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}
.key-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.key-value-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-bottom: 12px;
}
.key-value-row code {
  background: none;
  padding: 0;
  flex: 1;
  font-size: 0.88rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.copy-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}
.copy-btn:hover {
  color: var(--accent-cyan);
  background: var(--accent-cyan-dim);
}
.key-actions {
  display: flex;
  gap: 8px;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}
.empty-state .empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.5;
}
.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* -------------------------------------------------------------------------- */
/*  Charts                                                                     */
/* -------------------------------------------------------------------------- */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}
.chart-card h3 {
  font-size: 1rem;
  margin-bottom: 16px;
}
.chart-container {
  position: relative;
  height: 260px;
}
.chart-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 260px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* -------------------------------------------------------------------------- */
/*  Dashboard Bottom Panels                                                    */
/* -------------------------------------------------------------------------- */
.dashboard-bottom {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
}
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
}
.panel h3 {
  font-size: 1rem;
  margin-bottom: 16px;
}

.quick-action {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  margin-bottom: 10px;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  color: var(--text-primary);
}
.quick-action:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-cyan);
  text-decoration: none;
  transform: translateX(4px);
}
.quick-action .qa-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  flex-shrink: 0;
}
.quick-action .qa-text {
  flex: 1;
}
.quick-action .qa-title {
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.quick-action .qa-desc {
  font-size: 0.8rem;
  color: var(--text-secondary);
}
.quick-action .qa-arrow {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Welcome bar */
.welcome-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(0, 212, 170, 0.08), rgba(139, 92, 246, 0.05));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 24px;
  margin-bottom: 24px;
}
.welcome-bar .welcome-text h2 {
  font-size: 1.2rem;
  margin-bottom: 2px;
}
.welcome-bar .welcome-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}
.welcome-bar .welcome-actions {
  display: flex;
  gap: 10px;
}

/* -------------------------------------------------------------------------- */
/*  Alerts                                                                     */
/* -------------------------------------------------------------------------- */
.alert {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  margin: 12px 0;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success {
  background: var(--accent-green-dim);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: var(--accent-green);
}
.alert-error {
  background: var(--accent-red-dim);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: var(--accent-red);
}
.alert-info {
  background: var(--accent-blue-dim);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: var(--accent-blue);
}
.alert-warning {
  background: var(--accent-orange-dim);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: var(--accent-orange);
}
.alert code {
  background: rgba(0, 0, 0, 0.2);
  color: inherit;
}

/* -------------------------------------------------------------------------- */
/*  Pagination                                                                 */
/* -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-top: 20px;
}
.pagination .page-info {
  color: var(--text-secondary);
  font-size: 0.88rem;
}

/* -------------------------------------------------------------------------- */
/*  Filter Bar                                                                 */
/* -------------------------------------------------------------------------- */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-group {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 3px;
}
.filter-btn {
  padding: 6px 14px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: inherit;
}
.filter-btn:hover {
  color: var(--text-primary);
}
.filter-btn.active {
  background: var(--accent-cyan-dim);
  color: var(--accent-cyan);
  font-weight: 600;
}

/* Hamburger button — hidden on desktop, shown on mobile via media query */
.topbar-hamburger {
  display: none;
}

/* Sidebar overlay — hidden on desktop, active on mobile */
.sidebar-overlay {
  display: none;
}

/* -------------------------------------------------------------------------- */
/*  Responsive                                                                 */
/* -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .stat-grid {
    grid-template-columns: repeat(4, 1fr);
  }
  .tier-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1024px) {
  .app-sidebar {
    width: var(--sidebar-collapsed);
  }
  .app-sidebar .sidebar-logo .logo-text,
  .app-sidebar .sidebar-link span:not(.sidebar-icon),
  .app-sidebar .sidebar-section-label,
  .app-sidebar .sidebar-footer .version,
  .app-sidebar .sidebar-footer .theme-toggle span {
    display: none;
  }
  .app-sidebar .sidebar-link {
    justify-content: center;
    padding: 12px;
  }
  .app-sidebar .sidebar-footer .theme-toggle {
    justify-content: center;
  }
  .app-main {
    margin-left: var(--sidebar-collapsed);
  }
  .chart-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-bottom {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  /* ---- Sidebar: hidden by default, slides in via hamburger ---- */
  .app-sidebar {
    width: var(--sidebar-width);
    transform: translateX(-100%);
    transition: transform var(--transition-base);
  }
  .app-sidebar.sidebar-open {
    transform: translateX(0);
  }
  /* Restore sidebar text on mobile (it was hidden at 1024px) */
  .app-sidebar .sidebar-logo .logo-text,
  .app-sidebar .sidebar-link span:not(.sidebar-icon),
  .app-sidebar .sidebar-section-label,
  .app-sidebar .sidebar-footer .version,
  .app-sidebar .sidebar-footer .theme-toggle span {
    display: inline;
  }
  .app-sidebar .sidebar-link {
    justify-content: flex-start;
    padding: 10px 12px;
  }
  .app-sidebar .sidebar-footer .theme-toggle {
    justify-content: space-between;
  }
  .app-main {
    margin-left: 0;
  }
  /* Sidebar overlay mask */
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 199;
    display: none;
  }
  .sidebar-overlay.active {
    display: block;
  }
  /* Hamburger button in topbar */
  .topbar-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
    transition: all var(--transition-fast);
  }
  .topbar-hamburger:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-light);
  }

  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .tier-grid {
    grid-template-columns: 1fr;
  }
  .hero h1 {
    font-size: 2rem;
  }
  .hero {
    padding: 60px 20px 40px;
  }
  .content-area {
    padding: 16px;
  }
  .topbar {
    padding: 0 16px;
  }
  .topbar-balance {
    display: none;
  }
  .features-grid {
    grid-template-columns: 1fr;
  }
  .welcome-bar {
    flex-direction: column;
    gap: 14px;
    align-items: flex-start;
  }
  .auth-card {
    padding: 28px 20px;
    margin: 16px;
  }
  /* Tables: enable horizontal scroll on small screens */
  .table-wrapper {
    overflow-x: auto;
  }
  /* Pay methods: stack vertically on mobile */
  .pay-methods {
    flex-direction: column;
  }
  /* Chart grid: single column */
  .chart-grid {
    grid-template-columns: 1fr;
  }
  /* Filter bar: wrap nicely */
  .filter-bar {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .stat-grid {
    grid-template-columns: 1fr;
  }
  .public-nav-links {
    gap: 16px;
  }
  .public-nav-links a:not(.btn) {
    display: none;
  }
  /* Stat values slightly smaller on very small screens */
  .stat-card .stat-value {
    font-size: 1.4rem;
  }
  /* Topbar padding tighter */
  .topbar {
    padding: 0 12px;
  }
}

/* -------------------------------------------------------------------------- */
/*  Scrollbar                                                                  */
/* -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* -------------------------------------------------------------------------- */
/*  Animations                                                                 */
/* -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  animation: fadeIn var(--transition-base);
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.pulse {
  animation: pulse 2s infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: inline-block;
}
