:root {
  --bg:       #0a0a0a;
  --panel:    #111111;
  --panel2:   #141414;
  --border:   #1f1f1f;
  --border2:  #1a1a1a;
  --gold:     #c9a227;
  --gold-lt:  #f0c040;
  --teal:     #26a69a;
  --red:      #ef5350;
  --amber:    #f59e0b;
  --text:     #e0e0e0;
  --muted:    #888888;
  --dim:      #555555;
  --dimmer:   #444444;
  --dimmest:  #333333;
  --darkest:  #2a2a2a;
}

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

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
input, button, select, textarea { font-family: inherit; }
button { cursor: pointer; background: none; border: none; color: inherit; }

.num { font-variant-numeric: tabular-nums; }
.pos { color: var(--teal); }
.neg { color: var(--red); }
.gold { color: var(--gold); }

/* ── Scrollbar ─────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #222; border-radius: 2px; }

/* ── Layout helpers ────────────────────────────────────────────────── */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.overflow-x-auto { overflow-x: auto; }
.min-w-0 { min-width: 0; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.shrink-0 { flex-shrink: 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relative { position: relative; }
.absolute { position: absolute; }
.fixed { position: fixed; }
.inset-0 { inset: 0; }
.z-50 { z-index: 50; }
.hidden { display: none; }

/* ── Auth pages (login, signup) ────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.auth-box {
  width: 100%;
  max-width: 380px;
}

.auth-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 32px;
}

.logo-mark {
  width: 36px; height: 36px;
  background: var(--gold);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 16px; color: #000;
}

.logo-text { line-height: 1.1; }
.logo-text .top    { color: #fff; font-weight: 700; font-size: 11px; letter-spacing: .15em; text-transform: uppercase; }
.logo-text .bottom { color: var(--dim); font-size: 9px; letter-spacing: .2em; text-transform: uppercase; }

.auth-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.auth-card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border2);
}

.auth-card-header .label {
  font-size: 10px; color: var(--dim); text-transform: uppercase;
  letter-spacing: .12em; margin-bottom: 4px;
}

.auth-card-header h2 { color: #fff; font-size: 16px; font-weight: 600; }

.auth-card-body { padding: 24px; }

.auth-card-footer {
  padding: 16px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--dimmer);
  border-top: 1px solid var(--border2);
}

.auth-card-footer a { color: var(--gold); }

/* ── Form fields ───────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 10px; color: var(--dim); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 6px; }

.input {
  width: 100%;
  background: #0a0a0a;
  border: 1px solid #222;
  color: #fff;
  padding: 10px 12px;
  font-size: 14px;
  border-radius: 8px;
  outline: none;
  transition: border-color .15s;
}

.input::placeholder { color: #2a2a2a; }
.input:focus { border-color: var(--gold); }
.input.mono { font-family: monospace; letter-spacing: .1em; }

select.input { appearance: none; }

textarea.input { resize: none; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: opacity .15s, background .15s;
  border: none;
  text-decoration: none;
}

.btn-gold   { background: var(--gold);  color: #000; }
.btn-gold:hover { opacity: .88; }
.btn-teal   { background: var(--teal);  color: #000; }
.btn-teal:hover { opacity: .88; }
.btn-red    { background: var(--red);   color: #fff; }
.btn-red:hover { opacity: .88; }
.btn-ghost  { background: transparent; border: 1px solid #333; color: var(--muted); }
.btn-ghost:hover { border-color: #555; color: #fff; }
.btn-sm     { padding: 5px 12px; font-size: 11px; border-radius: 6px; }
.btn-full   { width: 100%; }
.btn-xs     { padding: 3px 8px; font-size: 10px; border-radius: 4px; }

.error-msg { color: var(--red); font-size: 12px; margin-top: 8px; }
.success-msg { color: var(--teal); font-size: 12px; margin-top: 8px; }

/* ── Alert banner ──────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-warn    { background: #1a1500; border: 1px solid rgba(240,192,64,.25); color: var(--gold-lt); }
.alert-error   { background: #1a0808; border: 1px solid rgba(239,83,80,.3);   color: var(--red); }
.alert-success { background: #0a1a18; border: 1px solid rgba(38,166,154,.3);  color: var(--teal); }
.alert-info    { background: #0d0d12; border: 1px solid #252535; color: var(--muted); }

.alert-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}
.alert-dot.warn    { background: var(--gold-lt); }
.alert-dot.error   { background: var(--red); }
.alert-dot.success { background: var(--teal); }

/* ── Card ──────────────────────────────────────────────────────────── */
.card {
  background: var(--panel2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.card-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-header .title { font-size: 12px; color: var(--muted); font-weight: 500; }
.card-body { padding: 20px; }

/* ── Table ─────────────────────────────────────────────────────────── */
.tbl { width: 100%; font-size: 12px; border-collapse: collapse; }
.tbl th { padding: 10px 16px; text-align: left; color: var(--dimmer); font-weight: 500; font-size: 11px; }
.tbl td { padding: 10px 16px; border-top: 1px solid var(--border2); }
.tbl tbody tr:hover { background: rgba(255,255,255,.02); }

/* ── Badge ─────────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--teal); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 999px; line-height: 1;
}
.badge-success { background: rgba(38,166,154,.2);  color: var(--teal);  border: 1px solid rgba(38,166,154,.3); }
.badge-danger  { background: rgba(239,83,80,.2);   color: var(--red);   border: 1px solid rgba(239,83,80,.3); }
.badge-warning { background: rgba(245,158,11,.2);  color: var(--amber); border: 1px solid rgba(245,158,11,.3); }
.badge-info    { background: rgba(91,155,213,.2);  color: #5b9bd5;      border: 1px solid rgba(91,155,213,.3); }
.badge-muted   { background: rgba(100,100,100,.15); color: var(--muted); border: 1px solid var(--border); }

/* ── Stat grid ─────────────────────────────────────────────────────── */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.stat-cell {
  padding: 20px;
  border-right: 1px solid var(--border2);
  border-bottom: 1px solid var(--border2);
}

.stat-cell:nth-child(2n)  { border-right: none; }
.stat-cell:nth-last-child(-n+2) { border-bottom: none; }

.stat-label { font-size: 11px; color: var(--dim); margin-bottom: 8px; }
.stat-value { font-size: 24px; font-weight: 600; color: #fff; }

/* ── Progress bar ──────────────────────────────────────────────────── */
.progress-wrap { margin-bottom: 12px; }
.progress-row  { display: flex; justify-content: space-between; font-size: 10px; margin-bottom: 4px; color: var(--muted); }
.progress-bar  { height: 6px; background: #1a1a00; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 999px; background: var(--gold-lt); transition: width .3s; }
.progress-fill.warn { background: var(--amber); }
.progress-fill.danger { background: var(--red); }

/* ── Sidebar dashboard layout ──────────────────────────────────────── */
.db-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.db-announce {
  height: 28px;
  background: #0d0d0d;
  border-bottom: 1px solid var(--border2);
  display: flex;
  align-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.marquee-track {
  display: flex;
  white-space: nowrap;
  animation: marquee 40s linear infinite;
}

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.marquee-track span { font-size: 11px; padding: 0 16px; display: inline-flex; align-items: center; gap: 24px; }

.db-body   { display: flex; flex: 1; overflow: hidden; }

.db-sidebar {
  width: 200px;
  flex-shrink: 0;
  background: var(--bg);
  border-right: 1px solid var(--border2);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 16px;
  flex-shrink: 0;
}

.sidebar-logo .mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 14px; color: #000; flex-shrink: 0;
}

.sidebar-logo .words .top    { color: #fff; font-weight: 700; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.sidebar-logo .words .bottom { color: var(--dim); font-size: 9px; letter-spacing: .2em; text-transform: uppercase; }

.sidebar-nav { flex: 1; padding: 0 8px 16px; }

.nav-section {
  font-size: 10px; color: #3a3a3a; font-weight: 600;
  text-transform: uppercase; letter-spacing: .15em;
  padding: 12px 12px 4px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500;
  color: var(--dim); cursor: pointer;
  transition: background .12s, color .12s;
  position: relative;
  text-decoration: none;
}

.nav-item:hover { color: #fff; background: #1a1a1a; }
.nav-item.active { background: var(--gold-lt); color: #000; }
.nav-item .icon  { width: 16px; height: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }

.sidebar-user {
  border-top: 1px solid var(--border2);
  padding: 12px;
  display: flex; align-items: center; gap: 8px;
}

.user-avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 900; color: #000; flex-shrink: 0;
}

.user-info { flex: 1; min-width: 0; }
.user-info .uname  { font-size: 11px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-info .uemail { font-size: 9px;  color: #444; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.db-main  { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }

.db-topbar {
  height: 40px; border-bottom: 1px solid var(--border2);
  background: var(--bg); display: flex; align-items: center;
  padding: 0 20px; gap: 8px; flex-shrink: 0;
}

.db-topbar .page-title { font-size: 12px; font-weight: 500; }
.db-topbar .spacer { flex: 1; }

.db-content { flex: 1; overflow-y: auto; padding: 24px; }

.section-title { font-size: 14px; font-weight: 600; color: #fff; margin-bottom: 12px; }

.content-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.content-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

@media (max-width: 768px) {
  .db-sidebar { display: none; }
  .content-grid, .content-grid-3 { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .db-content { padding: 16px; }
}

/* ── Rules panel ───────────────────────────────────────────────────── */
.rules-panel {
  background: #0d0d00;
  border: 1px solid rgba(240,192,64,.15);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── Trade terminal layout ─────────────────────────────────────────── */
.trade-layout {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.trade-bar {
  height: 28px; background: #0d0d0d; border-bottom: 1px solid var(--border2);
  display: flex; align-items: center; padding: 0 16px; gap: 12px; flex-shrink: 0;
  font-size: 10px;
}

.navbar {
  height: 36px; background: #0d0d0d; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 12px; gap: 2px; flex-shrink: 0;
  overflow-x: auto;
}

.sym-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 4px;
  font-size: 11px; font-weight: 500; color: var(--dim);
  cursor: pointer; white-space: nowrap; transition: background .12s, color .12s;
}

.sym-tab:hover  { color: #fff; background: #181818; }
.sym-tab.active { background: #1e1e1e; color: #fff; }
.sym-tab .price { font-size: 10px; }

.trade-body { display: flex; flex: 1; overflow: hidden; }

.watchlist-col { width: 188px; flex-shrink: 0; border-right: 1px solid var(--border); overflow: hidden; display: flex; flex-direction: column; }
.chart-col     { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.order-col     { width: 272px; flex-shrink: 0; border-left: 1px solid var(--border); overflow-y: auto; background: #0d0d0d; }

.chart-area  { flex: 1; overflow: hidden; }
.pos-area    { height: 176px; flex-shrink: 0; border-top: 1px solid var(--border); overflow-y: auto; }

/* ── Watchlist ──────────────────────────────────────────────────────── */
.watchlist-header {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border2);
  font-size: 10px; color: var(--dim);
  text-transform: uppercase; letter-spacing: .1em;
  flex-shrink: 0;
}

.watchlist-body { overflow-y: auto; flex: 1; }

.wl-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; cursor: pointer; transition: background .1s;
  border-bottom: 1px solid rgba(255,255,255,.03);
}

.wl-item:hover { background: #181818; }
.wl-item.active { background: #1e1e1e; }

.wl-sym  { font-size: 12px; font-weight: 600; color: #fff; }
.wl-type { font-size: 9px; color: var(--dim); text-transform: uppercase; margin-top: 1px; }
.wl-price { font-size: 12px; text-align: right; }
.wl-chg   { font-size: 10px; text-align: right; }

/* ── Chart toolbar ──────────────────────────────────────────────────── */
.chart-toolbar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 6px 12px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; min-height: 36px; background: #0d0d0d;
}

.tf-btn {
  padding: 3px 10px; font-size: 12px; color: var(--dimmer);
  border: 1px solid transparent; border-radius: 4px; transition: all .12s;
}

.tf-btn:hover  { color: var(--muted); }
.tf-btn.active { background: #1a1a1a; color: var(--gold); border-color: var(--gold); }

/* ── Order panel ───────────────────────────────────────────────────── */
.order-panel { padding: 12px; }

.dir-tabs { display: flex; gap: 4px; margin-bottom: 12px; }
.dir-tab  { flex: 1; padding: 8px; font-size: 12px; font-weight: 700; text-align: center; border-radius: 6px; border: 1px solid transparent; cursor: pointer; transition: all .12s; text-transform: uppercase; letter-spacing: .05em; }
.dir-tab.buy  { border-color: var(--teal);  color: var(--teal);  }
.dir-tab.sell { border-color: var(--red);   color: var(--red);   }
.dir-tab.buy.active  { background: var(--teal);  color: #000; }
.dir-tab.sell.active { background: var(--red);   color: #fff; }

.order-field { margin-bottom: 10px; }
.order-field label { display: block; font-size: 10px; color: var(--dim); margin-bottom: 4px; letter-spacing: .08em; text-transform: uppercase; }
.order-input { width: 100%; background: #0d0d0d; border: 1px solid #1e1e1e; color: #fff; padding: 7px 10px; font-size: 13px; border-radius: 6px; outline: none; transition: border-color .15s; }
.order-input:focus { border-color: var(--gold); }
.order-input::placeholder { color: #2a2a2a; }

.lev-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.lev-btn  { padding: 5px 2px; font-size: 10px; border: 1px solid #1e1e1e; border-radius: 4px; text-align: center; cursor: pointer; color: var(--dim); transition: all .12s; background: #0d0d0d; }
.lev-btn.active { border-color: var(--gold); color: var(--gold); background: #1a1500; }

.price-display { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 12px; }

/* ── Account stats ──────────────────────────────────────────────────── */
.account-stats { border-top: 1px solid var(--border); padding: 12px; }
.stat-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 11px; border-bottom: 1px solid rgba(255,255,255,.03); }
.stat-row:last-child { border-bottom: none; }
.stat-row .lbl { color: var(--dim); }
.stat-row .val { color: var(--muted); font-variant-numeric: tabular-nums; }

/* ── Positions table ───────────────────────────────────────────────── */
.pos-table { font-size: 11px; width: 100%; border-collapse: collapse; }
.pos-table th { padding: 6px 14px; color: #444; font-weight: 500; text-align: left; white-space: nowrap; }
.pos-table td { padding: 6px 14px; border-top: 1px solid var(--border2); white-space: nowrap; }

/* ── Admin layout ──────────────────────────────────────────────────── */
.admin-header {
  height: 44px; background: #0d0d0d; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 20px; gap: 16px; flex-shrink: 0;
}

.admin-badge {
  font-size: 9px; border: 1px solid var(--border); padding: 2px 6px;
  color: var(--dimmer); text-transform: uppercase; letter-spacing: .1em;
}

.admin-body { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }

.admin-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; margin-bottom: 20px; }

@media (max-width: 900px) { .admin-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 500px) { .admin-stats { grid-template-columns: repeat(2, 1fr); } }

.admin-stat {
  background: var(--panel); border: 1px solid var(--border); padding: 16px;
}

.admin-stat .lbl { font-size: 10px; color: var(--dimmer); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 4px; }
.admin-stat .val { font-size: 28px; font-weight: 700; }

.admin-tabs { display: flex; border-bottom: 1px solid var(--border); gap: 0; margin-bottom: 20px; }
.admin-tab  { padding: 10px 20px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--dimmer); cursor: pointer; border-bottom: 2px solid transparent; transition: color .15s; }
.admin-tab:hover  { color: var(--muted); }
.admin-tab.active { color: #fff; border-bottom-color: var(--gold); }

.admin-table { width: 100%; font-size: 12px; border-collapse: collapse; }
.admin-table th { padding: 8px 16px; text-align: left; color: #333; font-weight: 400; text-transform: uppercase; letter-spacing: .08em; font-size: 10px; }
.admin-table td { padding: 10px 16px; border-top: 1px solid #141414; }
.admin-table tbody tr:hover { background: #0f0f0f; }

.admin-section { background: var(--panel); border: 1px solid var(--border); margin-bottom: 20px; }
.admin-section-header { padding: 10px 16px; border-bottom: 1px solid var(--border2); display: flex; align-items: center; gap: 8px; }
.admin-section-header .title { font-size: 11px; color: var(--dimmer); text-transform: uppercase; letter-spacing: .1em; }

/* ── Notification bell ──────────────────────────────────────────────── */
.notif-panel {
  position: absolute; right: 0; top: 36px; width: 320px;
  background: #161616; border: 1px solid #242424;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,.6);
  overflow: hidden; z-index: 100;
}

.notif-header { padding: 12px 16px; border-bottom: 1px solid #1e1e1e; display: flex; align-items: center; justify-content: space-between; }

/* ── Tabs (purchase, challenges, etc) ──────────────────────────────── */
.tab-row { display: flex; gap: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-btn { padding: 6px 16px; font-size: 12px; border-radius: 6px; border: 1px solid #222; color: var(--dim); cursor: pointer; transition: all .12s; }
.tab-btn.active { background: var(--gold); border-color: var(--gold); color: #000; }
.tab-btn:hover:not(.active) { border-color: #444; color: #fff; }

/* ── Package cards ──────────────────────────────────────────────────── */
.pkg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }

.pkg-card {
  background: var(--panel2); border: 1px solid var(--border);
  border-radius: 12px; padding: 20px; cursor: pointer; transition: border-color .15s;
}

.pkg-card:hover { border-color: var(--gold); }
.pkg-card.selected { border-color: var(--gold); background: #0d0d00; }
.pkg-card .size  { font-size: 22px; font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.pkg-card .label { font-size: 12px; color: var(--muted); }
.pkg-card .price { font-size: 26px; font-weight: 700; color: #fff; margin-top: 12px; }
.pkg-card .psub  { font-size: 11px; color: var(--dim); }

/* ── Payment method selector ────────────────────────────────────────── */
.pay-method-row { display: flex; gap: 8px; flex-wrap: wrap; }
.pay-btn { flex: 1; min-width: 110px; padding: 10px 8px; border: 1px solid #222; border-radius: 8px; text-align: center; cursor: pointer; font-size: 12px; color: var(--dim); transition: all .15s; }
.pay-btn.active { border-color: var(--gold); background: #1a1600; color: #fff; }
.pay-btn:hover:not(.active) { border-color: #444; color: #fff; }

/* ── Equity chart container ─────────────────────────────────────────── */
.equity-chart { position: relative; height: 200px; }

/* ── Inline copy button ─────────────────────────────────────────────── */
.copy-btn { font-size: 10px; padding: 3px 8px; border: 1px solid #2a2a2a; color: #555; border-radius: 4px; cursor: pointer; transition: all .15s; }
.copy-btn:hover { border-color: #444; color: #888; }
.copy-btn.copied { border-color: var(--teal); color: var(--teal); }

/* ── Spinner ────────────────────────────────────────────────────────── */
.spinner { width: 12px; height: 12px; border: 2px solid #333; border-top-color: #666; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Mobile sidebar ─────────────────────────────────────────────────── */
.mobile-overlay { display: none; }

@media (max-width: 768px) {
  .mobile-overlay { display: block; position: fixed; inset: 0; z-index: 49; background: rgba(0,0,0,.6); }
  .db-sidebar { display: none; }
  .db-sidebar.mobile-open {
    display: flex; position: fixed; left: 0; top: 0; bottom: 0;
    z-index: 50; width: 200px;
  }
}

/* ── Status chips ───────────────────────────────────────────────────── */
.status-chip { font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.status-chip.unverified { color: var(--dim); }
.status-chip.pending    { color: var(--amber); }
.status-chip.active     { color: var(--teal); }
.status-chip.suspended  { color: var(--red); }
.status-chip.breached   { color: var(--red); }
.status-chip.declined   { color: var(--red); }

/* ── Utility margins ───────────────────────────────────────────────── */
.mt-1 { margin-top:  4px; }  .mt-2 { margin-top:  8px; }
.mt-3 { margin-top: 12px; }  .mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }  .mt-8 { margin-top: 32px; }
.mb-1 { margin-bottom:  4px; } .mb-2 { margin-bottom:  8px; }
.mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-5 > * + * { margin-top: 20px; }

/* ── App layout (shared pages) ──────────────────────────────────────── */
.app-layout { display: flex; height: 100vh; overflow: hidden; }
.app-layout .db-sidebar { flex-shrink: 0; }
.main-content { flex: 1; overflow-y: auto; padding: 2rem; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.page-title { font-size: 1.4rem; font-weight: 700; color: #fff; }

/* ── Empty state ────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--muted); }

/* ── Alert ──────────────────────────────────────────────────────────── */
.alert { padding: 0.75rem 1rem; border-radius: 6px; margin-bottom: 1.5rem; font-size: 0.9rem; }
.alert-danger  { background: rgba(239,83,80,.12); border: 1px solid rgba(239,83,80,.3); color: var(--red); }
.alert-success { background: rgba(38,166,154,.12); border: 1px solid rgba(38,166,154,.3); color: var(--teal); }
.alert-warning { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.3); color: var(--amber); }

/* ── Section card ───────────────────────────────────────────────────── */
.section-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; margin-bottom: 1.5rem; }
.section-title { font-size: 1rem; font-weight: 600; color: #fff; margin-bottom: 1.25rem; }
.optional { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
.form-section { margin-bottom: 2rem; }

/* ── Challenges grid ────────────────────────────────────────────────── */
.challenges-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.25rem; }
.challenge-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem; }
.challenge-card-header { display: flex; justify-content: space-between; align-items: flex-start; }
.challenge-package { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 2px; }
.challenge-size { font-size: 1.5rem; font-weight: 700; color: #fff; }
.challenge-credentials { background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.5rem; }
.credential-row { display: flex; align-items: center; gap: 0.5rem; }
.cred-label { font-size: 0.75rem; color: var(--muted); width: 70px; flex-shrink: 0; }
.cred-value { font-family: monospace; font-size: 0.9rem; color: var(--gold-lt); flex: 1; }
.challenge-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.ch-stat { display: flex; flex-direction: column; gap: 2px; }
.ch-stat-label { font-size: 0.72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ch-stat-value { font-size: 0.9rem; font-weight: 600; color: #fff; }
.challenge-card-footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.ch-date { font-size: 0.75rem; color: var(--dim); }

/* ── Package selection ──────────────────────────────────────────────── */
.packages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.75rem; }
.package-card { position: relative; cursor: pointer; }
.package-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.package-card > div { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; text-align: center; transition: all .15s; }
.package-card input:checked ~ div, .package-card > div.selected { border-color: var(--gold); background: rgba(201,162,39,.08); }
.package-card > div:hover { border-color: #333; }
.pkg-name { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; margin-bottom: 4px; }
.pkg-size { font-size: 1.1rem; font-weight: 700; color: #fff; margin-bottom: 4px; }
.pkg-price { font-size: 1rem; color: var(--gold-lt); font-weight: 600; }

/* ── Package card checked fix ───────────────────────────────────────── */
.package-card input[type="radio"]:checked + div { border-color: var(--gold); background: rgba(201,162,39,.08); }
.package-card input[type="radio"] + div { border: 1px solid var(--border); border-radius: 8px; padding: 1rem; text-align: center; transition: all .15s; }

/* ── Payment grid ───────────────────────────────────────────────────── */
.payment-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.payment-card { cursor: pointer; }
.payment-card input[type="radio"] { position: absolute; opacity: 0; width: 0; height: 0; }
.payment-card input[type="radio"] + div,
.payment-card > .pay-coin { display: none; } /* handled via label structure below */
.payment-card { position: relative; }
.payment-card input[type="radio"] + * { display: none; }
/* Use direct label styling */
.payment-card { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; cursor: pointer; transition: all .15s; min-width: 110px; text-align: center; }
.payment-card:has(input:checked) { border-color: var(--gold); background: rgba(201,162,39,.08); }
.payment-card input { position: absolute; opacity: 0; width: 0; }
.pay-coin { font-size: 1rem; font-weight: 700; color: #fff; }
.pay-label { font-size: 0.75rem; color: var(--muted); margin-top: 2px; }

/* ── Coupon row ─────────────────────────────────────────────────────── */
.coupon-row { display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }

/* ── Order summary ──────────────────────────────────────────────────── */
.order-summary { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; max-width: 400px; }
.os-row { display: flex; justify-content: space-between; padding: 0.4rem 0; border-bottom: 1px solid var(--border2); font-size: 0.9rem; color: var(--muted); }
.os-row:last-child { border: none; }
.os-total { font-weight: 700; font-size: 1rem; color: #fff; }

/* ── Offers list (purchase page) ────────────────────────────────────── */
.offers-list { display: flex; flex-direction: column; gap: 0.5rem; }
.offer-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0; border-bottom: 1px solid var(--border2); }
.offer-row:last-child { border: none; }
.offer-coupon { font-family: monospace; background: var(--bg); border: 1px solid var(--border); padding: 2px 8px; border-radius: 4px; color: var(--gold-lt); font-size: 0.85rem; }
.offer-desc { color: var(--muted); font-size: 0.85rem; flex: 1; }

/* ── Offers cards page ──────────────────────────────────────────────── */
.offers-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; }
.offer-card { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1.5rem; position: relative; display: flex; flex-direction: column; gap: 0.6rem; }
.offer-tag { position: absolute; top: 1rem; right: 1rem; font-size: 0.7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 8px; border-radius: 10px; }
.offer-tag.personal { background: rgba(201,162,39,.15); color: var(--gold-lt); }
.offer-tag.global { background: rgba(38,166,154,.12); color: var(--teal); }
.offer-title { font-size: 1rem; font-weight: 600; color: #fff; }
.offer-desc-text { font-size: 0.85rem; color: var(--muted); }
.offer-discount { font-size: 1.75rem; font-weight: 700; color: var(--gold-lt); }
.offer-restriction { font-size: 0.75rem; color: var(--muted); background: var(--bg); border: 1px solid var(--border); padding: 2px 8px; border-radius: 4px; display: inline-block; }
.offer-coupon-box { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.25rem; }
.offer-coupon-code { font-family: monospace; font-size: 1.1rem; color: var(--gold-lt); letter-spacing: .1em; }
.offer-expiry { font-size: 0.75rem; color: var(--dim); }

/* ── Pending page ───────────────────────────────────────────────────── */
.pending-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; max-width: 600px; }
.pending-status { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 2rem; padding-bottom: 2rem; border-bottom: 1px solid var(--border); }
.pending-icon { font-size: 2rem; }
.pending-title { font-size: 1.1rem; font-weight: 600; color: #fff; margin-bottom: 0.4rem; }
.pending-sub { font-size: 0.88rem; color: var(--muted); line-height: 1.6; }
.pending-details { display: flex; flex-direction: column; gap: 0.75rem; margin-bottom: 1.5rem; }
.pd-row { display: flex; justify-content: space-between; align-items: center; }
.pd-label { color: var(--muted); font-size: 0.88rem; }
.pd-value { font-weight: 500; color: #fff; }
.pd-value.highlight { color: var(--gold-lt); font-size: 1.1rem; font-weight: 700; }
.wallet-box { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; margin: 1.5rem 0; }
.wallet-label { font-size: 0.8rem; color: var(--muted); margin-bottom: 0.5rem; }
.wallet-address { font-family: monospace; font-size: 0.9rem; color: var(--gold-lt); word-break: break-all; margin-bottom: 0.75rem; }
.pending-note { background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.2); border-radius: 6px; padding: 0.85rem 1rem; font-size: 0.85rem; color: var(--muted); line-height: 1.6; margin-bottom: 1rem; }

/* ── Stats page ─────────────────────────────────────────────────────── */
.stat-card { background: var(--panel); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; }
.stat-label { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 0.4rem; }
.stat-value { font-size: 1.4rem; font-weight: 700; color: #fff; }
.stats-overview { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.stats-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 1.5rem; }
.highlight-trade { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 1.25rem; }
.best-trade { border-color: rgba(38,166,154,.3); }
.worst-trade { border-color: rgba(239,83,80,.3); }
.ht-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 0.4rem; }
.ht-symbol { font-size: 1.1rem; font-weight: 700; color: #fff; }
.ht-profit { font-size: 1.4rem; font-weight: 700; margin: 0.25rem 0; }
.ht-meta { font-size: 0.8rem; color: var(--dim); text-transform: uppercase; }
.symbol-bars { display: flex; flex-direction: column; gap: 0.75rem; }
.sym-bar-row { display: flex; align-items: center; gap: 0.75rem; }
.sym-bar-label { width: 80px; font-size: 0.85rem; color: var(--muted); }
.sym-bar-track { flex: 1; height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; }
.sym-bar-fill { height: 100%; background: var(--gold); border-radius: 4px; transition: width .3s; }
.sym-bar-count { width: 30px; text-align: right; font-size: 0.8rem; color: var(--dim); }

/* ── Rules page ─────────────────────────────────────────────────────── */
.rules-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.rule-card { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 1.25rem; }
.rule-icon { font-size: 1.6rem; font-weight: 900; margin-bottom: 0.5rem; }
.rule-icon.danger  { color: var(--red); }
.rule-icon.warning { color: var(--amber); }
.rule-icon.success { color: var(--teal); }
.rule-icon.info    { color: #5b9bd5; }
.rule-name { font-weight: 600; color: #fff; margin-bottom: 0.5rem; }
.rule-desc { font-size: 0.83rem; color: var(--muted); line-height: 1.6; }
.instruments-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.instr-group { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 1rem; }
.instr-group-title { font-weight: 600; color: var(--gold-lt); margin-bottom: 0.4rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: .05em; }
.instr-list { font-size: 0.82rem; color: var(--muted); line-height: 1.7; }
.faq-list { display: flex; flex-direction: column; gap: 0.75rem; }
.faq-item { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.faq-item summary { padding: 1rem 1.25rem; cursor: pointer; font-weight: 500; color: #ddd; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq-item summary::after { content: '+'; color: var(--gold); font-size: 1.2rem; }
.faq-item[open] summary::after { content: '−'; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-answer { padding: 0 1.25rem 1rem; color: var(--muted); font-size: 0.88rem; line-height: 1.7; border-top: 1px solid var(--border2); margin-top: 0; padding-top: 0.75rem; }

/* ── Reactivate page ────────────────────────────────────────────────── */
.reactivate-card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 2rem; max-width: 600px; }
.breach-notice { display: flex; gap: 1rem; align-items: flex-start; padding: 1rem; background: rgba(239,83,80,.08); border: 1px solid rgba(239,83,80,.2); border-radius: 8px; margin-bottom: 1.5rem; }
.breach-icon { font-size: 1.5rem; }
.breach-title { font-weight: 600; color: var(--red); margin-bottom: 0.25rem; }
.breach-sub { font-size: 0.88rem; color: var(--muted); }
.reactivation-fee-box { text-align: center; padding: 1.5rem; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 1.5rem; }
.fee-label { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 0.5rem; }
.fee-amount { font-size: 2.5rem; font-weight: 900; color: var(--gold-lt); }
.fee-note { font-size: 0.8rem; color: var(--dim); margin-top: 0.25rem; }
.coupon-notice { background: rgba(201,162,39,.08); border: 1px solid rgba(201,162,39,.2); border-radius: 6px; padding: 0.75rem 1rem; font-size: 0.88rem; color: var(--muted); margin-bottom: 1.5rem; }
.reactivate-info { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.reactivate-info h3 { font-size: 0.9rem; font-weight: 600; color: #fff; margin-bottom: 0.75rem; }
.reactivate-info ul { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.reactivate-info li { font-size: 0.85rem; color: var(--muted); padding-left: 1rem; position: relative; }
.reactivate-info li::before { content: '→'; position: absolute; left: 0; color: var(--gold); }

/* ── Text helpers ───────────────────────────────────────────────────── */
.text-success { color: var(--teal); }
.text-danger  { color: var(--red); }
.text-warning { color: var(--amber); }
.text-muted   { color: var(--muted); }

/* ── btn-warning ────────────────────────────────────────────────────── */
.btn-warning { background: var(--amber); color: #000; font-weight: 600; }
.btn-warning:hover { background: #f0a800; }

/* ── Table wrap ─────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }

/* ── Btn ghost ──────────────────────────────────────────────────────── */
.btn-ghost { color: var(--muted); }
.btn-ghost:hover { color: #ddd; }

/* ── Btn lg ─────────────────────────────────────────────────────────── */
.btn-lg { padding: 0.75rem 2rem; font-size: 0.95rem; }

/* ── Sidebar user section ───────────────────────────────────────────── */
.su-logout svg { display: block; }
