/* ============================================
   Trader Rebahan — Polished Global Styles
   Mobile-first responsive design system
   ============================================ */
:root {
  --bg: #080808;
  --surface: #0d0d0d;
  --surface-2: #141414;
  --surface-3: #1a1a1a;
  --border: rgba(255,255,255,.08);
  --border-strong: rgba(255,255,255,.14);
  --border-hover: rgba(255,255,255,.2);
  --gold: #fcd34d;
  --gold-light: #fde68a;
  --gold-strong: #f59e0b;
  --text: #fafafa;
  --muted: rgba(255,255,255,.6);
  --muted-2: rgba(255,255,255,.45);
  --muted-3: rgba(255,255,255,.3);
  --shadow-soft: 0 4px 24px -8px rgba(0,0,0,.4);
  --shadow-lg: 0 12px 40px -8px rgba(0,0,0,.5);
}

* { box-sizing: border-box; }
html, body { background: var(--bg); color: var(--text); font-family: 'Plus Jakarta Sans', system-ui, sans-serif; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
body { font-feature-settings: "ss01","cv11"; overflow-x: hidden; }
h1, h2, h3, h4 { font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.02em; }
::selection { background: rgba(252,211,77,.3); color: #fff; }

button, a.btn, .side-item { min-height: 36px; }
@media (max-width: 768px) {
  button, a.btn, .side-item { min-height: 44px; }
}

.bg-blobs::before, .bg-blobs::after {
  content: ''; position: fixed; pointer-events: none; border-radius: 9999px; filter: blur(80px); z-index: 0;
}
.bg-blobs::before { width: 480px; height: 480px; left: -10%; top: -10%; background: rgba(245,158,11,.15); }
.bg-blobs::after  { width: 420px; height: 420px; right: -8%; top: 18%; background: rgba(253,224,138,.08); }
@media (max-width: 768px) {
  .bg-blobs::before, .bg-blobs::after { filter: blur(60px); opacity: .7; }
  .bg-blobs::before { width: 320px; height: 320px; }
  .bg-blobs::after  { width: 280px; height: 280px; }
}

.card { background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 22px; transition: border-color .15s, background .15s; }
.card-soft { background: rgba(255,255,255,.035); border: 1px solid var(--border); border-radius: 16px; }
.card-hover:hover { border-color: var(--border-hover); background: rgba(255,255,255,.05); }
@media (max-width: 640px) {
  .card { border-radius: 18px; }
  .card-soft { border-radius: 14px; }
}

.input {
  background: rgba(255,255,255,.04); border: 1px solid var(--border);
  color: var(--text); border-radius: 12px; padding: 12px 16px; width: 100%;
  outline: none; transition: border .15s, background .15s, box-shadow .15s;
  font-size: 15px; font-family: inherit;
}
.input:focus { border-color: rgba(252,211,77,.5); background: rgba(255,255,255,.06); box-shadow: 0 0 0 3px rgba(252,211,77,.1); }
.input::placeholder { color: rgba(255,255,255,.3); }
.input:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 640px) {
  .input { font-size: 16px; padding: 13px 16px; }
}

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; font-weight: 600; transition: all .15s; cursor: pointer; border: 0; font-family: inherit; }
.btn-gold { background: var(--gold); color: #000; }
.btn-gold:hover:not(:disabled) { background: var(--gold-light); transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn-gold:active { transform: translateY(0); }
.btn-outline { background: transparent; border: 1px solid var(--border-strong); color: var(--text); }
.btn-outline:hover:not(:disabled) { background: rgba(255,255,255,.06); border-color: var(--border-hover); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn.loading { color: transparent; position: relative; pointer-events: none; }
.btn.loading::after {
  content: ''; position: absolute; width: 18px; height: 18px;
  border: 2px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
  top: 50%; left: 50%; margin: -9px 0 0 -9px; color: #000;
}
.btn-outline.loading::after { color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

.pill { display: inline-flex; align-items: center; gap: .4rem; padding: 4px 12px; font-size: 11px; border-radius: 9999px; border: 1px solid var(--border); background: rgba(255,255,255,.05); color: rgba(255,255,255,.7); letter-spacing: .02em; white-space: nowrap; }
.pill-gold { border-color: rgba(252,211,77,.25); background: rgba(252,211,77,.10); color: #fcd34d; }
.pill-green { border-color: rgba(52,211,153,.25); background: rgba(52,211,153,.08); color: #6ee7b7; }
.pill-red { border-color: rgba(248,113,113,.25); background: rgba(248,113,113,.08); color: #fca5a5; }
.pill-blue { border-color: rgba(96,165,250,.25); background: rgba(96,165,250,.08); color: #93c5fd; }

.text-muted { color: var(--muted); }
.text-muted-2 { color: var(--muted-2); }

.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th { text-align: left; padding: 12px 14px; color: var(--muted); font-weight: 500; border-bottom: 1px solid var(--border); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.tbl td { padding: 14px; border-bottom: 1px solid var(--border); color: rgba(255,255,255,.85); }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(255,255,255,.02); }

.tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
  .tbl-mobile-hide { display: none; }
  .tbl-mobile-cards { display: block; }
}
@media (min-width: 769px) {
  .tbl-mobile-cards { display: none; }
}

.row-card { background: rgba(255,255,255,.03); border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.row-card:last-child { margin-bottom: 0; }
.row-card .row-label { font-size: 10px; color: var(--muted-2); text-transform: uppercase; letter-spacing: .08em; }
.row-card .row-value { font-size: 14px; color: rgba(255,255,255,.9); margin-top: 2px; }

.side-item { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; color: rgba(255,255,255,.65); font-size: 14px; transition: all .15s; }
.side-item:hover { background: rgba(255,255,255,.05); color: #fff; }
.side-item.active { background: var(--gold); color: #000; font-weight: 600; }

.stat { background: rgba(255,255,255,.04); border: 1px solid var(--border); border-radius: 18px; padding: 16px; transition: border-color .15s; }
.stat:hover { border-color: var(--border-hover); }
.stat-label { color: var(--muted-2); font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; }
.stat-value { font-size: 26px; font-weight: 600; margin-top: 6px; font-family: 'Space Grotesk', sans-serif; letter-spacing: -0.02em; }
.stat-trend { font-size: 11px; margin-top: 4px; display: flex; align-items: center; gap: 4px; }
.stat-trend.up { color: #6ee7b7; }
.stat-trend.down { color: #fca5a5; }
@media (max-width: 640px) {
  .stat { padding: 14px; border-radius: 16px; }
  .stat-value { font-size: 22px; }
}

/* TOAST */
.toast-container { position: fixed; right: 16px; top: 16px; z-index: 100; max-width: calc(100vw - 32px); width: 380px; pointer-events: none; }
@media (max-width: 480px) {
  .toast-container { right: 8px; top: 8px; left: 8px; width: auto; }
}
.toast {
  background: rgba(20,20,20,.95);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 14px 16px;
  display: flex; gap: 12px; align-items: flex-start;
  margin-bottom: 10px; pointer-events: auto;
  box-shadow: var(--shadow-lg);
  animation: toastIn .3s cubic-bezier(.22,1,.36,1);
  font-size: 14px; color: #fff;
}
.toast.success { border-color: rgba(52,211,153,.35); }
.toast.error { border-color: rgba(248,113,113,.35); }
.toast.info { border-color: rgba(96,165,250,.35); }
.toast-icon { width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 600; }
.toast.success .toast-icon { background: rgba(52,211,153,.18); color: #6ee7b7; }
.toast.error .toast-icon { background: rgba(248,113,113,.18); color: #fca5a5; }
.toast.info .toast-icon { background: rgba(96,165,250,.18); color: #93c5fd; }
.toast-body { flex: 1; line-height: 1.5; }
.toast-close { background: none; border: 0; color: var(--muted-2); cursor: pointer; padding: 0; font-size: 18px; line-height: 1; transition: color .15s; }
.toast-close:hover { color: #fff; }
.toast.hide { animation: toastOut .25s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

/* DRAWER */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.6);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 90; opacity: 0; pointer-events: none; transition: opacity .25s;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: 280px; max-width: 85vw;
  background: #0a0a0a; border-right: 1px solid var(--border);
  z-index: 95; transform: translateX(-100%);
  transition: transform .25s cubic-bezier(.22,1,.36,1);
  display: flex; flex-direction: column; padding: 20px;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.drawer.open { transform: translateX(0); }
.drawer-close { position: absolute; top: 16px; right: 16px; background: none; border: 0; color: #fff; font-size: 24px; cursor: pointer; padding: 4px 8px; line-height: 1; }
.hamburger { display: none; background: none; border: 0; cursor: pointer; padding: 10px; color: #fff; }
.hamburger svg { width: 24px; height: 24px; }
@media (max-width: 1023px) {
  .hamburger { display: inline-flex; }
}
@media (min-width: 1024px) {
  .drawer-backdrop, .drawer { display: none; }
}

.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .empty-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; background: rgba(255,255,255,.04); border: 1px solid var(--border); display: grid; place-items: center; font-size: 28px; }
.empty-state h2 { font-size: 18px; margin-bottom: 8px; }
.empty-state p { color: var(--muted); font-size: 14px; margin-bottom: 20px; }

.fade-in { animation: fadeIn .4s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.line-glow { filter: drop-shadow(0 0 8px rgba(252,211,77,.35)); }

select.input { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 40px; }

code, .mono { font-family: 'JetBrains Mono', monospace; }

.otp-input {
  text-align: center; font-family: 'JetBrains Mono', monospace;
  font-size: 28px; letter-spacing: 0.4em; padding: 18px 12px; font-weight: 600;
}
@media (max-width: 480px) {
  .otp-input { font-size: 22px; letter-spacing: 0.3em; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: #0d0d0d; }
::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a3a; }

body.drawer-open { overflow: hidden; }

@media (max-width: 640px) {
  h1.text-3xl { font-size: 24px; }
  h1.text-4xl { font-size: 28px; }
}
