:root {
  --bg-base: #0a0e1a;
  --bg-card: #131722;
  --bg-card-2: #1a1e2e;
  --bg-elev: #1f2435;
  --border: #232838;
  --border-strong: #2a3146;
  --text: #e5e7eb;
  --text-mid: #9ca3af;
  --text-dim: #6b7280;
  --accent: #e63946;
  --accent-2: #ff6b75;
  --accent-soft: rgba(230, 57, 70, 0.12);
  --pos: #10b981;
  --neg: #ef4444;
  --warn: #f59e0b;
  --info: #3b82f6;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  --font: -apple-system, "Inter", system-ui, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg-base);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { color: var(--accent); }
button { font-family: inherit; cursor: pointer; }
hr { border: 0; border-top: 1px solid var(--border); margin: 16px 0; }
code, pre { font-family: var(--mono); }
.mono { font-family: var(--mono); }
.muted { color: var(--text-mid); }
.dim { color: var(--text-dim); font-size: 12px; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }

/* ─── App shell ──────────────────────────────────── */
.app-shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.sidebar {
  background: #0c1020;
  border-right: 1px solid var(--border);
  padding: 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; }
.sidebar-brand .logo-mark {
  width: 38px; height: 42px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.sidebar-brand .logo-mark img { width: auto; max-width: 100%; height: auto; max-height: 100%; display: block; }
.sidebar-brand .logo-text { font-weight: 700; letter-spacing: 0.12em; font-size: 14px; }
.sidebar-brand .logo-text small { display: block; color: var(--text-dim); font-weight: 400; font-size: 9px; letter-spacing: 0.18em; margin-top: 2px; }

.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--text-mid); text-decoration: none;
  font-size: 13.5px; transition: all 0.15s;
}
.nav-link:hover { background: var(--bg-card); color: var(--text); }
.nav-link.active { background: var(--accent-soft); color: var(--accent-2); }
.nav-link.active::before { content: ""; width: 3px; height: 16px; background: var(--accent); border-radius: 2px; margin-left: -12px; margin-right: 9px; }
.nav-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.5; }

.sidebar-footer { margin-top: auto; padding: 16px 8px 0; border-top: 1px solid var(--border); }
.sidebar-footer .badge-pending { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; background: rgba(245, 158, 11, 0.1); color: var(--warn); font-size: 11px; border-radius: 4px; }
.sidebar-footer .badge-pending::before { content: "●"; }

/* ─── Topbar ──────────────────────────────────── */
.topbar {
  background: var(--bg-base);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 10;
}
.topbar-title { font-size: 14px; color: var(--text-mid); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.client-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-card); padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 12px;
}
.client-chip .chip-avatar { width: 24px; height: 24px; border-radius: 50%; background: #ffffff; color: #0a0e1a; display: grid; place-items: center; font-weight: 800; font-size: 12px; border: 1px solid rgba(255,255,255,0.2); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 0; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; transition: all 0.15s; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: #d12030; }
.btn-ghost { background: transparent; color: var(--text-mid); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg-card); color: var(--text); }

/* ─── Main content ──────────────────────────────────── */
.main { padding: 24px; min-height: calc(100vh - 60px); }
.page-hero { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 22px; gap: 18px; }
.page-hero h1 { font-size: 22px; margin: 0 0 6px; font-weight: 600; }
.page-hero .hero-sub { color: var(--text-mid); font-size: 13px; }
.kicker { font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 6px; }

/* ─── Cards ──────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}
.card-title { font-size: 13px; font-weight: 600; color: var(--text-mid); display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.06em; }
.card-title a { font-size: 11.5px; font-weight: 500; color: var(--text-mid); }

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: 2fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1000px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ─── Identity row ──────────────────────────────────── */
.client-card { display: flex; align-items: center; gap: 18px; padding: 18px 22px; }
.client-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: #ffffff;
  display: grid; place-items: center;
  color: #0a0e1a; font-weight: 800; font-size: 28px; letter-spacing: 0.02em;
  font-family: Georgia, "Times New Roman", serif;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
}
.client-info h2 { font-size: 18px; margin: 0 0 2px; font-weight: 600; }
.client-info .client-id { font-family: var(--mono); color: var(--text-mid); font-size: 12px; }

.stats-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat {
  background: var(--bg-card-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.stat-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-dim); margin-bottom: 6px; }
.stat-value { font-size: 14px; font-weight: 600; }
.stat-value .check { color: var(--pos); margin-right: 4px; }
.stat-value .vip { color: var(--warn); margin-right: 4px; }

/* ─── Balance card ──────────────────────────────────── */
.balance-card { padding: 26px; }
.balance-label { color: var(--text-mid); font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.balance-value { font-size: 36px; font-weight: 700; margin-bottom: 4px; letter-spacing: -0.02em; }
.balance-value .currency { font-size: 18px; color: var(--text-mid); font-weight: 500; margin-left: 6px; }
.balance-sub { color: var(--text-mid); font-size: 12.5px; margin-bottom: 18px; }
.balance-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ─── Table ──────────────────────────────────── */
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
.tbl th { color: var(--text-dim); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; background: transparent; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr:hover td { background: rgba(255,255,255,0.015); }
.asset-cell { display: flex; align-items: center; gap: 10px; }
.asset-icon {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700;
  color: #fff;
}
.asset-icon.usdc { background: #2775ca; }
.asset-icon.usdt { background: #26a17b; }
.asset-icon.btc  { background: #f7931a; }
.asset-icon.eth  { background: #627eea; }
.asset-icon.pol  { background: #8247e5; }
.asset-icon.trx  { background: #ff060a; }
.asset-icon.other{ background: #4b5563; }
.asset-name b { display: block; font-weight: 600; }
.asset-name small { color: var(--text-mid); font-size: 11.5px; }

/* ─── Wallet list ──────────────────────────────────── */
.wallet-list { display: flex; flex-direction: column; gap: 10px; }
.wallet-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; background: var(--bg-card-2); border-radius: var(--radius-sm); border: 1px solid var(--border); }
.wallet-row:hover { border-color: var(--border-strong); }
.wallet-meta b { display: block; font-size: 13px; }
.wallet-meta .addr { font-family: var(--mono); color: var(--text-mid); font-size: 11.5px; word-break: break-all; }
.wallet-badge { font-size: 10px; padding: 3px 8px; border-radius: 999px; font-weight: 700; letter-spacing: 0.06em; }
.wallet-badge.pol  { background: rgba(130,71,229,0.18); color: #b794ff; }
.wallet-badge.eth  { background: rgba(98,126,234,0.18); color: #98aaff; }
.wallet-badge.btc  { background: rgba(247,147,26,0.18); color: #ffc16e; }
.wallet-badge.trx  { background: rgba(255,6,10,0.18); color: #ff6e72; }
.wallet-badge.more { background: rgba(75,85,99,0.4); color: var(--text); }

.copy-btn { background: transparent; border: 1px solid var(--border); color: var(--text-mid); border-radius: 4px; padding: 3px 8px; font-size: 11px; }
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }

/* ─── Status pills ──────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.pill.ok    { background: rgba(16,185,129,0.15); color: var(--pos); }
.pill.warn  { background: rgba(245,158,11,0.15); color: var(--warn); }
.pill.err   { background: rgba(239,68,68,0.15); color: var(--neg); }
.pill.info  { background: rgba(59,130,246,0.15); color: var(--info); }

/* ─── Banner ──────────────────────────────────── */
.banner-pending {
  background: linear-gradient(90deg, rgba(245,158,11,0.12), rgba(245,158,11,0.05));
  border-left: 3px solid var(--warn);
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 12.5px; color: #fcd9a0;
  margin-bottom: 18px;
}

/* ─── Login page ──────────────────────────────────── */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 40px 16px;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(230,57,70,0.12), transparent),
    radial-gradient(900px 500px at 10% 110%, rgba(59,130,246,0.08), transparent),
    var(--bg-base);
}
.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 34px 32px;
  width: 100%; max-width: 400px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
.login-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-bottom: 24px; }
.login-brand .logo-mark { width: 60px; height: 66px; display: grid; place-items: center; }
.login-brand .logo-mark img { width: auto; max-width: 100%; height: auto; max-height: 100%; display: block; }
.login-brand .logo-text { font-weight: 700; letter-spacing: 0.18em; font-size: 16px; }
.login-brand .logo-text small { display: block; color: var(--text-dim); font-weight: 400; font-size: 10px; letter-spacing: 0.20em; margin-top: 4px; text-align: center; }

.login-card h1 { font-size: 18px; margin: 0 0 4px; text-align: center; font-weight: 600; }
.login-card .sub { color: var(--text-mid); font-size: 13px; text-align: center; margin-bottom: 22px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 12px; color: var(--text-mid); font-weight: 500; }
.field input {
  background: var(--bg-card-2); border: 1px solid var(--border); color: var(--text);
  padding: 11px 14px; border-radius: var(--radius-sm); font-size: 14px;
  font-family: var(--font); outline: 0;
}
.field input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(230,57,70,0.15); }

.btn-block { display: block; width: 100%; padding: 12px; font-size: 14px; margin-top: 6px; }

.login-meta { margin-top: 18px; font-size: 11px; color: var(--text-dim); text-align: center; line-height: 1.7; }
.login-meta a { color: var(--text-mid); }

.pending-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.3);
  color: var(--warn); padding: 4px 10px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
}
.pending-tag::before { content: "●"; font-size: 8px; }

.error-box {
  background: rgba(239,68,68,0.12); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5;
  padding: 10px 14px; border-radius: var(--radius-sm); font-size: 12.5px; margin-bottom: 14px;
}

/* ─── Sticky footer ──────────────────────────────────── */
.app-footer {
  border-top: 1px solid var(--border);
  padding: 18px 24px;
  font-size: 11.5px;
  color: var(--text-dim);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
}
.app-footer a { color: var(--text-mid); }

@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
