/* ===============================================================
   TradeOptions — User Dashboard (frontend sample)
   Self-contained dark theme. Depends only on all.min.css (icons).
   =============================================================== */

:root {
  --brand: #00D094;
  --brand-dim: rgba(0, 208, 148, 0.15);
  --blue: #3B82F6;
  --cyan: #22D3EE;
  --amber: #F59E0B;
  --violet: #A855F7;
  --red: #F26D6D;

  --bg: #06100C;
  --surface: #0D1613;
  --surface-2: #111C18;
  --surface-3: #16231E;
  --border: rgba(255, 255, 255, 0.07);
  --border-2: rgba(255, 255, 255, 0.11);

  --title: #FFFFFF;
  --text: rgba(255, 255, 255, 0.62);
  --muted: rgba(255, 255, 255, 0.38);

  --sidebar-w: 262px;
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body.dash-body {
  background: var(--bg);
  color: var(--text);
  font-family: "Open Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 { color: var(--title); margin: 0; font-weight: 700; }
p { margin: 0; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

/* ---------- Layout shell ---------- */
.dash {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
}
/* Mobile menu overlay — hidden on desktop so it doesn't occupy a grid column */
.dash__backdrop { display: none; }

/* ---------- Sidebar ---------- */
.dash__sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 26px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.dash__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 8px 8px;
  margin-bottom: 22px;
}
.dash__logo img { height: 34px; width: auto; }

.dash__nav { display: flex; flex-direction: column; gap: 4px; }
.dash__nav-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 14px 12px 6px;
}
.dash__nav-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-weight: 500;
  transition: background .18s ease, color .18s ease;
  border: 1px solid transparent;
}
.dash__nav-item i { width: 18px; text-align: center; font-size: 15px; }
.dash__nav-item:hover { background: var(--surface-2); color: var(--title); }
.dash__nav-item.is-active {
  background: var(--surface-3);
  color: var(--title);
  border-color: var(--border-2);
}
.dash__nav-item.is-active i { color: var(--brand); }

.dash__sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 18px; }

/* ---------- Main ---------- */
.dash__main { min-width: 0; display: flex; flex-direction: column; }

.dash__topbar {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 30px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(6, 16, 12, 0.85);
  backdrop-filter: blur(8px);
  z-index: 5;
}
.dash__search {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 30px;
  padding: 10px 18px;
}
.dash__search i { color: var(--muted); }
.dash__search input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--title);
  outline: none;
  font-size: 14px;
}
.dash__topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.dash__icon-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text);
}
.dash__icon-btn:hover { color: var(--brand); }
.dash__profile { display: flex; align-items: center; gap: 11px; padding-left: 6px; }
.dash__profile img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border-2); }
.dash__profile-name { color: var(--title); font-weight: 600; line-height: 1.2; }
.dash__profile-mail { font-size: 12px; color: var(--muted); }

.dash__content { padding: 26px 30px 60px; }

/* ---------- Panels ---------- */
.panel { display: none; }
.panel.is-active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { font-size: 28px; margin-bottom: 4px; }
.page-head p { color: var(--text); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  border: 1px solid transparent; border-radius: 10px;
  padding: 11px 18px; font-weight: 600; font-size: 14px;
  transition: filter .18s ease, background .18s ease;
}
.btn--primary { background: var(--brand); color: #04140E; }
.btn--primary:hover { filter: brightness(1.08); }
.btn--blue { background: var(--blue); color: #fff; }
.btn--ghost { background: var(--surface-2); color: var(--title); border-color: var(--border); }
.btn--ghost:hover { background: var(--surface-3); }
.btn--block { width: 100%; justify-content: center; }

.chip-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 9px 14px; font-size: 13px;
}
.chip-btn:hover { color: var(--title); }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.card__title { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.card__title i { color: var(--muted); font-size: 13px; }
.card__tools { display: flex; align-items: center; gap: 8px; }

/* ---------- Watchlist strip ---------- */
.watchstrip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 22px;
  overflow-x: auto;
}
.watchstrip__label { color: var(--title); font-weight: 600; white-space: nowrap; display: flex; align-items: center; gap: 8px; padding-right: 6px; }
.watchstrip__label i { color: var(--muted); }
.watchstrip__divider { width: 1px; height: 26px; background: var(--border); }
.watch-pill { display: flex; align-items: center; gap: 8px; white-space: nowrap; padding: 4px 8px; }
.watch-pill__ic { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }
.watch-pill b { color: var(--title); font-weight: 700; }
.watch-pill .val { color: var(--text); }
.up { color: var(--brand); }
.down { color: var(--red); }

/* ---------- Dashboard grid ---------- */
.dash-grid { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.dash-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ---------- Total assets ---------- */
.total__value { font-size: 34px; color: var(--title); font-weight: 800; letter-spacing: -0.5px; }
.total__change { color: var(--brand); font-weight: 600; margin-top: 2px; display: inline-flex; align-items: center; gap: 6px; }
.total__spark { margin-top: 10px; }

.actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.action {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px 6px; color: var(--text); font-size: 12px; font-weight: 600;
}
.action i { font-size: 16px; color: var(--brand); }
.action:hover { background: var(--surface-3); color: var(--title); }

/* ---------- Analytics chart ---------- */
.chart { position: relative; }
.chart svg { width: 100%; height: auto; display: block; }
.chart__tooltip {
  position: absolute; left: 47%; top: 24%;
  background: var(--surface-3); border: 1px solid var(--border-2);
  border-radius: 12px; padding: 12px 14px; min-width: 150px;
  box-shadow: 0 18px 40px rgba(0,0,0,.4);
}
.chart__tooltip .date { color: var(--title); font-weight: 600; font-size: 12px; margin-bottom: 8px; }
.chart__tooltip .row { display: flex; align-items: center; justify-content: space-between; gap: 18px; font-size: 12px; }
.chart__tooltip .row + .row { margin-top: 4px; }
.chart__tooltip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 7px; }

/* ---------- Distributions ---------- */
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut { position: relative; width: 150px; height: 150px; flex: 0 0 150px; }
.donut svg { transform: rotate(-90deg); }
.donut__center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut__center b { display: block; color: var(--title); font-size: 20px; }
.donut__center span { font-size: 11px; color: var(--muted); }
.legend { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.legend__row { display: flex; align-items: center; gap: 12px; }
.legend__dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.legend__name { color: var(--title); font-weight: 600; }
.legend__pct { font-size: 12px; color: var(--muted); }
.legend__val { margin-left: auto; color: var(--title); font-weight: 700; }

.distbar { display: flex; gap: 4px; margin-bottom: 20px; }
.distbar span { height: 8px; border-radius: 6px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 560px; }
.tbl th {
  text-align: left; font-size: 12px; color: var(--muted); font-weight: 600;
  padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.tbl th .sort { margin-left: 6px; opacity: .5; }
.tbl td { padding: 14px; border-bottom: 1px solid var(--border); color: var(--text); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .asset { display: flex; align-items: center; gap: 10px; color: var(--title); font-weight: 600; }
.coin-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff; }

.badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge--success { background: rgba(0,208,148,.14); color: var(--brand); }
.badge--failed { background: rgba(242,109,109,.14); color: var(--red); }
.badge--pending { background: rgba(245,158,11,.14); color: var(--amber); }

/* ---------- Portfolio mini list ---------- */
.pf-list { display: flex; flex-direction: column; }
.pf-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.pf-row:last-child { border-bottom: 0; }
.pf-row__name { color: var(--title); font-weight: 600; }
.pf-row__sub { font-size: 12px; color: var(--muted); }
.pf-row__spark { margin-left: auto; }
.pf-row__val { text-align: right; min-width: 92px; }
.pf-row__val b { color: var(--title); display: block; }
.searchbox { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.searchbox input { border: 0; background: transparent; color: var(--title); outline: none; flex: 1; font-size: 13px; }
.searchbox .kbd { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; }

/* ---------- Deposits ---------- */
.deposit-grid { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; margin-bottom: 20px; }
.method-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 20px; }
.method {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 12px; padding: 14px; cursor: pointer; transition: border-color .18s ease, background .18s ease;
}
.method:hover { border-color: var(--border-2); }
.method.is-selected { border-color: var(--brand); background: var(--brand-dim); }
.method__ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-size: 16px; }
.method__name { color: var(--title); font-weight: 600; }
.method__net { font-size: 12px; color: var(--muted); }
.method__check { margin-left: auto; color: var(--brand); opacity: 0; }
.method.is-selected .method__check { opacity: 1; }

.field { margin-bottom: 16px; }
.field label { display: block; color: var(--title); font-weight: 600; font-size: 13px; margin-bottom: 8px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.input, .amount input {
  width: 100%; background: var(--surface-2); border: 1px solid var(--border);
  border-radius: 10px; padding: 12px 14px; color: var(--title); font-size: 14px; outline: none;
}
.input:focus, .amount input:focus { border-color: var(--brand); }
.amount { position: relative; }
.amount span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.amount input { padding-left: 30px; }

.wallet {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border: 1px dashed var(--border-2);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 6px;
}
.wallet code { color: var(--title); font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; }
.wallet button { margin-left: auto; background: transparent; border: 0; color: var(--brand); font-weight: 600; white-space: nowrap; }

.upload {
  border: 1px dashed var(--border-2); border-radius: 10px; padding: 22px;
  text-align: center; color: var(--muted); cursor: pointer; background: var(--surface-2);
}
.upload i { font-size: 20px; display: block; margin-bottom: 8px; color: var(--text); }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.steps li { display: flex; gap: 12px; }
.steps .num { flex: 0 0 26px; height: 26px; border-radius: 50%; background: var(--brand-dim); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12px; }
.steps .st-title { color: var(--title); font-weight: 600; }
.note {
  display: flex; gap: 10px; align-items: flex-start;
  background: rgba(245,158,11,.08); border: 1px solid rgba(245,158,11,.25);
  border-radius: 10px; padding: 12px 14px; margin-top: 18px; font-size: 13px;
}
.note i { color: var(--amber); margin-top: 2px; }

/* ---------- Utility ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.stat-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.tile__label { font-size: 12px; color: var(--muted); }
.tile__value { font-size: 22px; color: var(--title); font-weight: 800; margin-top: 6px; }
.tile__delta { font-size: 12px; margin-top: 4px; }

.mobile-only { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .dash-grid { grid-template-columns: 1fr; }
  .deposit-grid { grid-template-columns: 1fr; }
  .stat-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
  .dash { grid-template-columns: 1fr; }
  .dash__sidebar {
    position: fixed; left: 0; top: 0; z-index: 40; width: 78%; max-width: 300px;
    transform: translateX(-100%); transition: transform .25s ease;
  }
  .dash.nav-open .dash__sidebar { transform: none; }
  .dash__backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 30; }
  .dash.nav-open .dash__backdrop { display: block; }
  .mobile-only { display: grid; }
  .dash__profile-info { display: none; }
  .dash__content { padding: 20px 16px 50px; }
  .dash__topbar { padding: 14px 16px; }
}
@media (max-width: 560px) {
  .method-grid { grid-template-columns: 1fr; }
  .grid-2, .stat-tiles { grid-template-columns: 1fr; }
  .actions { grid-template-columns: repeat(2, 1fr); }
}

/* Avatar initials (shared with admin) */
.avatar-initials {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--brand); font-weight: 700; font-size: 13px; border: 1px solid var(--border-2);
}

/* Market panel — large, well-spaced category tabs */
.market-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 20px;
}
.market-tab {
  padding: 13px 30px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  border-radius: 12px;
  border: 1px solid var(--border-2);
  background: var(--surface-2);
  color: var(--muted);
  cursor: pointer;
  transition: all .2s ease;
}
.market-tab:hover {
  color: var(--title);
  border-color: var(--brand);
}
.market-tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #05130d;
}
@media (max-width: 575px) {
  .market-tab { padding: 11px 20px; font-size: 15px; }
}
