/* ==========================================================================
   Copy Edge — Premium Black & Gold Design System
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Lato:wght@300;400;700;900&display=swap');

/* ── 1. Design Tokens ─────────────────────────────────────────────────────── */
:root {
  /* Backgrounds */
  --bg:        #080810;
  --bg2:       #0f0f1a;
  --bg3:       #16162a;
  --bg4:       #1e1e35;
  --bg-card:   rgba(15,15,26,0.95);

  /* Borders */
  --border:    rgba(212,175,55,0.12);
  --border2:   rgba(212,175,55,0.25);
  --border3:   rgba(212,175,55,0.45);

  /* Text */
  --text:      #f0ece0;
  --text2:     #c8c4b0;
  --muted:     #6b6880;

  /* Brand / Accent */
  --gold:      #d4af37;
  --gold2:     #f5d55f;
  --gold3:     #a08825;
  --gold-glow: rgba(212,175,55,0.15);
  --gold-bg:   rgba(212,175,55,0.08);

  /* Status */
  --green:     #22c55e;
  --green-bg:  rgba(34,197,94,0.1);
  --red:       #ef4444;
  --red-bg:    rgba(239,68,68,0.1);
  --blue:      #3b82f6;
  --blue-bg:   rgba(59,130,246,0.1);
  --yellow:    #eab308;
  --yellow-bg: rgba(234,179,8,0.1);

  /* Typography */
  --font-xs:   0.75rem;
  --font-sm:   0.875rem;
  --font-md:   1rem;
  --font-lg:   1.125rem;
  --font-xl:   1.25rem;
  --font-2xl:  1.5rem;
  --font-3xl:  1.875rem;

  /* 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;
  --space-16: 64px;

  /* Radii */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  14px;
  --r-xl:  20px;
  --r-2xl: 28px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.5);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.4);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.5);
  --shadow-gold: 0 0 20px rgba(212,175,55,0.12);
  --shadow-card: 0 1px 0 rgba(212,175,55,0.08), 0 8px 32px rgba(0,0,0,0.4);

  /* Transitions */
  --ease:    cubic-bezier(0.16,1,0.3,1);
  --t-fast:  150ms var(--ease);
  --t-med:   250ms var(--ease);
  --t-slow:  400ms var(--ease);
}

/* ── 2. Reset ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Lato', system-ui, -apple-system, sans-serif;
  font-size: var(--font-md);
  line-height: 1.6;
  min-height: 100vh;
}

/* ── 3. Scrollbar ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--bg4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold3); }

/* ── 4. Typography ────────────────────────────────────────────────────────── */
h1,h2,h3,h4,h5 { font-weight: 700; line-height: 1.25; color: var(--text); }
h1 { font-size: var(--font-3xl); font-weight: 900; letter-spacing: -0.02em; }
h2 { font-size: var(--font-2xl); font-weight: 700; }
h3 { font-size: var(--font-xl);  font-weight: 700; }
h4 { font-size: var(--font-lg);  font-weight: 600; }
p  { color: var(--text2); line-height: 1.7; }
a  { color: var(--gold); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--gold2); }

.text-gold   { color: var(--gold); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-muted  { color: var(--muted); }
.text-sm     { font-size: var(--font-sm); }
.text-xs     { font-size: var(--font-xs); }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 900; }
.text-center { text-align: center; }
.tracking-wide { letter-spacing: 0.05em; }
.uppercase   { text-transform: uppercase; }

/* ── 5. Container ─────────────────────────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 var(--space-6);
}
@media (max-width: 768px) {
  .container { padding: 0 var(--space-4); }
}

/* ── 6. Navigation ────────────────────────────────────────────────────────── */
.nav {
  background: rgba(8,8,16,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--space-6);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-lg);
  font-weight: 900;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: opacity var(--t-fast);
}
.nav-brand:hover { opacity: 0.85; color: var(--gold); }
.nav-brand .brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--gold3), var(--gold));
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  list-style: none;
}
.nav-link {
  color: var(--muted);
  font-size: var(--font-sm);
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--r-md);
  text-decoration: none;
  transition: all var(--t-fast);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.nav-link:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.nav-link.active { color: var(--gold); background: var(--gold-bg); }
.nav-link.active svg { stroke: var(--gold); }

.nav-right { display: flex; align-items: center; gap: var(--space-3); }

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--text2);
  font-size: var(--font-sm);
  font-weight: 600;
  background: var(--bg3);
  border: 1px solid var(--border);
  padding: 6px 12px;
  border-radius: var(--r-lg);
}
.nav-user svg { stroke: var(--gold); flex-shrink: 0; }

/* ── 7. Buttons ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: var(--r-md);
  font-family: 'Lato', sans-serif;
  font-size: var(--font-sm);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

.btn-gold {
  background: linear-gradient(135deg, var(--gold3), var(--gold));
  color: #0a0a0a;
  font-weight: 900;
  box-shadow: 0 4px 16px rgba(212,175,55,0.3);
}
.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  box-shadow: 0 6px 24px rgba(212,175,55,0.45);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border2);
  color: var(--text2);
}
.btn-outline:hover { border-color: var(--gold3); color: var(--gold); background: var(--gold-bg); }

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid transparent;
}
.btn-ghost:hover { color: var(--text); background: var(--bg3); border-color: var(--border); }

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.25);
}
.btn-danger:hover { background: rgba(239,68,68,0.2); }

.btn-success {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid rgba(34,197,94,0.25);
}
.btn-success:hover { background: rgba(34,197,94,0.2); }

.btn-sm { min-height: 36px; padding: 0 14px; font-size: var(--font-xs); }
.btn-lg { min-height: 52px; padding: 0 32px; font-size: var(--font-lg); }
.btn-full { width: 100%; }

/* ── 8. Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-card);
  transition: border-color var(--t-med);
}
.card:hover { border-color: var(--border2); }
.card-glass {
  background: rgba(15,15,26,0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.card-gold {
  border-color: var(--border2);
  box-shadow: var(--shadow-card), var(--shadow-gold);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--space-4);
  margin-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: var(--font-md);
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.card-title svg { stroke: var(--gold); flex-shrink: 0; }

/* ── 9. Stat Cards ────────────────────────────────────────────────────────── */
.stat-card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--space-6);
  position: relative;
  overflow: hidden;
  transition: all var(--t-med);
  box-shadow: var(--shadow-card);
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold3), transparent);
  opacity: 0;
  transition: opacity var(--t-med);
}
.stat-card:hover { border-color: var(--border2); box-shadow: var(--shadow-card), var(--shadow-gold); }
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 40px; height: 40px;
  border-radius: var(--r-md);
  background: var(--gold-bg);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-4);
}
.stat-icon svg { stroke: var(--gold); }

.stat-label {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-2);
}
.stat-value {
  font-size: 1.75rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  transition: color var(--t-med);
}
.stat-value.positive { color: var(--green); }
.stat-value.negative { color: var(--red); }
.stat-value.gold { color: var(--gold); }

.stat-sub {
  font-size: var(--font-xs);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── 10. Badges ───────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: var(--font-xs);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.badge-gold    { background: var(--gold-bg);   color: var(--gold);  border: 1px solid var(--border2); }
.badge-green   { background: var(--green-bg);  color: var(--green); border: 1px solid rgba(34,197,94,0.25); }
.badge-red     { background: var(--red-bg);    color: var(--red);   border: 1px solid rgba(239,68,68,0.25); }
.badge-blue    { background: var(--blue-bg);   color: var(--blue);  border: 1px solid rgba(59,130,246,0.25); }
.badge-yellow  { background: var(--yellow-bg); color: var(--yellow);border: 1px solid rgba(234,179,8,0.25); }
.badge-muted   { background: var(--bg3); color: var(--muted); border: 1px solid var(--border); }

/* ── 11. Tables ───────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-sm);
}
.table th {
  background: var(--bg3);
  color: var(--muted);
  font-size: var(--font-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 12px 16px;
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.table th:first-child { border-radius: var(--r-sm) 0 0 0; }
.table th:last-child  { border-radius: 0 var(--r-sm) 0 0; }
.table td {
  padding: 14px 16px;
  border-bottom: 1px solid rgba(212,175,55,0.06);
  vertical-align: middle;
  color: var(--text2);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr {
  transition: background var(--t-fast);
}
.table tbody tr:hover td {
  background: rgba(212,175,55,0.04);
  color: var(--text);
}

/* ── 12. Forms ────────────────────────────────────────────────────────────── */
.form-group { margin-bottom: var(--space-5); }
.form-label {
  display: block;
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.form-input {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-md);
  padding: 11px 14px;
  font-size: var(--font-md);
  font-family: 'Lato', sans-serif;
  outline: none;
  min-height: 44px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.form-input:focus {
  border-color: var(--gold3);
  box-shadow: 0 0 0 3px rgba(212,175,55,0.1);
}
.form-input.error { border-color: var(--red); }
.form-input::placeholder { color: var(--muted); }

select.form-input { cursor: pointer; appearance: none; }

/* ── 13. Dividers ─────────────────────────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-5) 0;
}
.divider-gold { border-color: var(--border2); }

/* ── 14. Loading / Skeleton ───────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 0%, var(--bg4) 50%, var(--bg3) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.6s ease-in-out infinite;
  border-radius: var(--r-sm);
  display: inline-block;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.loading-spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--bg4);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-spinner.sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 15. Toast ────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg3);
  border: 1px solid var(--border2);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  font-size: var(--font-sm);
  font-weight: 600;
  max-width: 380px;
  z-index: 9999;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg), 0 0 24px rgba(212,175,55,0.08);
  animation: slideUpFade 0.3s var(--ease);
}
.toast.show { display: flex; }
.toast-success { border-color: rgba(34,197,94,0.35); color: var(--green); }
.toast-error   { border-color: rgba(239,68,68,0.35);  color: var(--red); }
.toast-info    { border-color: var(--border2); color: var(--gold); }
@keyframes slideUpFade {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

/* ── 16. Profit/Loss Colors ───────────────────────────────────────────────── */
.profit  { color: var(--green); font-weight: 700; }
.loss    { color: var(--red); font-weight: 700; }
.neutral { color: var(--muted); }

/* ── 17. Layout Utilities ─────────────────────────────────────────────────── */
.flex          { display: flex; }
.flex-col      { display: flex; flex-direction: column; }
.items-center  { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: var(--space-4); }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: var(--space-4); }
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2,1fr); }
  .grid-3 { grid-template-columns: repeat(2,1fr); }
}
@media (max-width: 640px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
}

/* ── 18. Empty States ─────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-12) var(--space-6);
  color: var(--muted);
}
.empty-state-icon {
  width: 56px; height: 56px;
  border-radius: var(--r-xl);
  background: var(--bg3);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-4);
}
.empty-state-icon svg { stroke: var(--muted); }
.empty-state h3 { color: var(--text2); margin-bottom: var(--space-2); font-size: var(--font-md); }
.empty-state p { font-size: var(--font-sm); margin-bottom: var(--space-4); }

/* ── 19. Tabs ─────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 4px;
  gap: 2px;
  width: fit-content;
}
.tab-btn {
  padding: 8px 18px;
  border-radius: var(--r-md);
  font-size: var(--font-sm);
  font-weight: 700;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: 'Lato', sans-serif;
  transition: all var(--t-fast);
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  background: linear-gradient(135deg, var(--gold3), var(--gold));
  color: #0a0a0a;
  box-shadow: 0 2px 8px rgba(212,175,55,0.3);
}

/* ── 20. Section Headers ──────────────────────────────────────────────────── */
.section-label {
  font-size: var(--font-xs);
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-3);
}
.section-label::before {
  content: '';
  width: 3px;
  height: 14px;
  background: linear-gradient(to bottom, var(--gold3), var(--gold));
  border-radius: 2px;
}

/* ── 21. Gold Glow Effects ────────────────────────────────────────────────── */
.glow-gold {
  box-shadow: 0 0 20px rgba(212,175,55,0.2), 0 0 60px rgba(212,175,55,0.08);
}
.text-gradient-gold {
  background: linear-gradient(135deg, var(--gold3), var(--gold2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── 22. Admin Specific ───────────────────────────────────────────────────── */
.admin-nav-brand { color: var(--yellow) !important; }
.admin-badge {
  background: rgba(234,179,8,0.12);
  color: var(--yellow);
  border: 1px solid rgba(234,179,8,0.3);
  padding: 4px 10px;
  border-radius: 20px;
  font-size: var(--font-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* ── 23. Responsive Hide/Show ─────────────────────────────────────────────── */
@media (max-width: 768px) {
  .hide-mobile { display: none !important; }
  .nav-links   { display: none; }
}
@media (min-width: 769px) {
  .hide-desktop { display: none !important; }
}

/* ── 24. Mobile Bottom Navigation ──────────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: rgba(8,8,16,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 8px 4px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  z-index: 200;
  grid-template-columns: repeat(5, 1fr);
}
.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  color: var(--muted);
  text-decoration: none;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  border-radius: var(--r-sm);
  transition: color var(--t-fast);
  min-height: 52px;
  justify-content: center;
}
.bottom-nav-item svg { stroke: currentColor; flex-shrink: 0; }
.bottom-nav-item.active { color: var(--gold); }
.bottom-nav-item:hover { color: var(--text); }

@media (max-width: 768px) {
  .bottom-nav { display: grid; }
  /* Push page content above bottom nav */
  .page-wrap, main { padding-bottom: 90px !important; }
  /* Hide top nav links on mobile */
  .nav-links { display: none !important; }
  /* Shrink top nav */
  .nav { padding: 0 16px; height: 56px; }
  .nav-user { display: none; }
}

/* ── 25. Global Mobile & Tablet Responsiveness ────────────────────────────── */
@media (max-width: 768px) {
  h1 { font-size: 1.35rem !important; }
  .page-wrap, main { padding: 16px 12px 90px !important; }
  .stats-row { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .content-grid { grid-template-columns: 1fr !important; gap: 16px !important; }
  .two-col { grid-template-columns: 1fr !important; }

  .page-head {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 20px !important;
  }
  .page-head .search-bar, .page-head .search-wrap {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* Mobile Tables & Touch Scroll */
  .table-responsive, [style*="overflow-x:auto"], #allocWrapper {
    width: 100% !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    border-radius: var(--r-md);
  }

  .table th, .table td, .alloc-table th, .alloc-table td {
    padding: 10px 10px !important;
    font-size: 0.78rem !important;
    white-space: nowrap;
  }

  .card { padding: var(--space-4) !important; }
  .stat-card { padding: 14px 12px !important; min-height: auto; }
  .stat-value { font-size: 1.25rem !important; word-break: break-word; }
  .stat-sub { font-size: 0.7rem !important; }
  .container { padding: 0 12px !important; }

  /* Mobile Modals */
  .modal-overlay, .modal-bg {
    padding: 12px !important;
    align-items: flex-end !important;
  }
  .modal {
    max-width: 100% !important;
    max-height: 88vh !important;
    border-radius: var(--r-xl) var(--r-xl) 0 0 !important;
    padding: 20px 16px !important;
  }

  /* Form Inputs on Mobile */
  .form-input, select.form-input {
    font-size: 16px !important; /* Prevents iOS auto-zoom */
    min-height: 44px;
  }

  /* Chat FAB mobile position */
  .chat-fab {
    bottom: 74px !important;
    right: 14px !important;
    width: 48px !important;
    height: 48px !important;
  }
  .chat-popup {
    bottom: 74px !important;
    right: 10px !important;
    left: 10px !important;
    width: auto !important;
    max-width: none !important;
    max-height: calc(100vh - 120px) !important;
  }
}

@media (max-width: 480px) {
  .stats-row { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .traders-grid, .trader-grid { grid-template-columns: 1fr !important; gap: 14px !important; }
  .features-grid { grid-template-columns: 1fr !important; }
  .steps-grid { grid-template-columns: 1fr 1fr !important; }
  .hero h1 { font-size: 2.0rem !important; }
  .hero-ctas { flex-direction: column !important; align-items: stretch !important; }
  .hero-ctas .btn { justify-content: center; }
  .balance-amount { font-size: 2.0rem !important; }

  .tabs {
    width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .tab-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 8px !important;
    font-size: 0.75rem !important;
    white-space: nowrap;
  }
  .cta-section { margin: 0 4px 30px !important; padding: 24px 14px !important; }

  /* Mobile Trader Cards & Actions */
  .trader-card { padding: 14px !important; }
  .trader-card-actions { flex-direction: column !important; gap: 8px !important; }
  .trader-card-actions .btn { width: 100% !important; justify-content: center !important; }
}
