/* ==========================================================================
   تریدر هاب — پنل مدیریت سرمایه — Soft Modern Console (RTL)
   ========================================================================== */

@font-face {
  font-family: "Vazirmatn";
  src: url("/static/vendor/fonts/vazirmatn-var.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f8fafd;
  --surface-muted: #f2f6fb;

  --line: #e8edf6;
  --line-strong: #dbe4f0;

  --text: #0f172a;
  --text-2: #334155;
  --muted: #52627a;
  --muted-2: #657488;

  --brand: #4f6ef7;
  --brand-strong: #3f57d6;
  --brand-2: #0ea5b7;
  --brand-soft: #eef2ff;
  --brand-tint: #f4f6ff;

  --success: #0f9d76;
  --success-soft: #e9f8f2;
  --success-line: #c6ecdf;
  --warn: #b45309;
  --warn-soft: #fff5e6;
  --warn-line: #fbe3c2;
  --danger: #b91c1c;
  --danger-soft: #fdeeee;
  --danger-line: #f7cccc;

  --radius-xl: 26px;
  --radius-lg: 20px;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 9px;

  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 18px 44px -30px rgba(15, 23, 42, 0.22);
  --shadow-lg: 0 30px 80px -34px rgba(15, 23, 42, 0.34);
  --ring: 0 0 0 4px rgba(79, 110, 247, 0.14);

  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Vazirmatn", monospace;
  --sans: "Vazirmatn", "Segoe UI", Tahoma, system-ui, sans-serif;
  --sidebar-w: 264px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[v-cloak] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1100px 620px at 100% -12%, rgba(99, 102, 241, 0.10), transparent 62%),
    radial-gradient(900px 560px at -12% 8%, rgba(14, 165, 183, 0.08), transparent 58%),
    var(--bg);
  background-attachment: fixed;
}

h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: rgba(79, 110, 247, 0.18); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }

::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cfdaea; border-radius: 999px; border: 3px solid transparent; background-clip: padding-box; }

/* --------------------------------------------------------------------------
   3. Utilities
   -------------------------------------------------------------------------- */
.mono { font-family: var(--mono); }
.ltr { direction: ltr; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.spacer { flex: 1; }
.pos { color: var(--success); }
.neg { color: var(--danger); }
.flat { color: var(--muted); }
.ellipsis { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

.ic { width: 18px; height: 18px; fill: currentColor; flex: 0 0 auto; }
.ic.sep { width: 14px; height: 14px; color: var(--muted-2); }

/* chips */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 999px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
  background: var(--surface-muted); color: var(--muted);
}
.chip.tiny { height: 20px; padding: 0 8px; font-size: 10.5px; }
.chip.success { background: var(--success-soft); color: #047857; border-color: var(--success-line); }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: var(--warn-line); }
.chip.danger { background: var(--danger-soft); color: var(--danger); border-color: var(--danger-line); }
.chip.accent { background: var(--brand-soft); color: var(--brand-strong); border-color: #dfe5ff; }
.chip.muted { background: var(--surface-muted); color: var(--muted); }

/* --------------------------------------------------------------------------
   4. Buttons
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 1px solid transparent; border-radius: 13px;
  font-size: 13.5px; font-weight: 700;
  background: var(--surface-muted); color: var(--text-2);
  transition: transform 0.1s var(--ease), box-shadow 0.15s var(--ease), background 0.15s;
}
.btn:hover { background: #e9eef7; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.primary { background: linear-gradient(135deg, var(--brand), #6d5cf6); color: #fff; box-shadow: 0 10px 26px -12px rgba(79,110,247,.55); }
.btn.primary:hover { box-shadow: 0 14px 30px -12px rgba(79,110,247,.6); background: linear-gradient(135deg, var(--brand-strong), #5d4cf0); }
.btn.success { background: var(--success); color: #fff; }
.btn.success:hover { background: #0c8a5f; }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #a31212; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { background: var(--surface-soft); color: var(--text-2); }
.btn.block { width: 100%; }
.btn.lg { height: 46px; font-size: 14.5px; border-radius: 15px; }
.btn.sm { height: 34px; padding: 0 12px; font-size: 12.5px; border-radius: 11px; }
.btn.xs { height: 28px; padding: 0 9px; font-size: 11px; border-radius: 9px; gap: 6px; }
.btn.xs .ic { width: 13px; height: 13px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; background: transparent; border-radius: 9px; color: var(--muted); }
.icon-btn:hover { background: var(--surface-muted); color: var(--text-2); }
.link-btn { border: 0; background: none; color: var(--brand); font-weight: 700; padding: 0; }
.link-btn:hover { color: var(--brand-strong); text-decoration: underline; }

/* --------------------------------------------------------------------------
   5. Auth screen — split hero + form
   -------------------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh; display: grid; grid-template-columns: 1.08fr 1fr;
  background: #edf1f8;
}

/* --- hero (brand panel) --- */
.auth-hero {
  position: relative; overflow: hidden; display: flex; align-items: center;
  padding: 56px 48px; color: #e6ebf7;
  background:
    radial-gradient(1100px 700px at 80% -15%, rgba(79, 110, 247, .4) 0%, transparent 55%),
    radial-gradient(900px 620px at -10% 115%, rgba(14, 165, 183, .38) 0%, transparent 55%),
    linear-gradient(165deg, #101a33 0%, #0b1226 60%, #0c1d24 100%);
}
.auth-hero-inner { position: relative; z-index: 2; width: 100%; max-width: 520px; margin-inline: auto; display: flex; flex-direction: column; gap: 24px; }
.auth-brand { display: flex; align-items: center; gap: 16px; }
.auth-brand h1 { font-size: 23px; font-weight: 800; letter-spacing: -0.01em; color: #f2f6ff; }
.auth-brand p { margin-top: 3px; color: #8f9dc4; font-size: 12.5px; }
.auth-headline { font-size: 38px; line-height: 1.34; font-weight: 800; letter-spacing: -0.02em; color: #f8faff; }
.auth-headline span { background: linear-gradient(90deg, #7dd3fc 0%, #a5b4fc 48%, #c4b5fd 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-tagline { color: #aab4d6; font-size: 13.5px; line-height: 2.1; margin-top: -8px; }
.auth-points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.auth-points li {
  display: flex; align-items: center; gap: 13px; font-size: 13px; line-height: 1.9; color: #c6cdec;
  background: rgba(148, 163, 184, .07); border: 1px solid rgba(148, 163, 184, .15);
  border-radius: 16px; padding: 11px 13px; backdrop-filter: blur(6px);
}
.pt-ic {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: grid; place-items: center;
  color: #7dd3fc; background: rgba(56, 189, 248, .13); border: 1px solid rgba(56, 189, 248, .28);
}
.pt-ic .ic { width: 20px; height: 20px; }
.auth-candles { position: absolute; inset-inline: 0; bottom: -4px; width: 100%; height: 44%; min-height: 200px; z-index: 1; }
.c-grid line { stroke: rgba(148, 163, 184, .13); stroke-width: 1; stroke-dasharray: 3 8; }
.c-area { fill: url(#cAreaGrad); }
.c-line {
  fill: none; stroke: url(#cLineGrad); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 0 14px rgba(125, 211, 252, .45));
}

/* --- form side --- */
.auth-side {
  display: grid; place-items: center; padding: 44px 24px; position: relative;
  background: #edf1f8;
  background-image: radial-gradient(rgba(100, 116, 139, .17) 1.1px, transparent 1.2px);
  background-size: 22px 22px;
}
.auth-card {
  position: relative; width: 100%; max-width: 410px;
  background: var(--surface); border-radius: 26px; border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgba(15, 23, 42, .35), 0 1px 0 rgba(255, 255, 255, .9) inset;
  padding: 32px 30px 26px; display: flex; flex-direction: column; gap: 20px;
}
.auth-card-head h2 { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; }
.auth-card-head p { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }

.auth-input { position: relative; display: flex; align-items: center; }
.auth-input .lead-ic {
  position: absolute; z-index: 2; inset-inline-start: 14px; width: 19px; height: 19px;
  color: var(--muted-2); pointer-events: none; transition: color .2s;
}
.auth-input input {
  height: 47px; border-radius: 13px; padding-inline-start: 44px; background: #fbfcff;
  border: 1px solid var(--line-strong); font-size: 13.5px; width: 100%; outline: 0;
  transition: box-shadow .2s, border-color .2s, background .2s;
}
.auth-input input::placeholder { color: var(--muted-2); }
.auth-input input:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(79, 110, 247, .16); }
.auth-input:focus-within .lead-ic { color: var(--brand-strong); }
.auth-input.has-toggle input { padding-inline-end: 46px; }
.auth-eye {
  position: absolute; z-index: 2; inset-inline-end: 8px; width: 38px; height: 38px;
  display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent;
  color: var(--muted-2); cursor: pointer; transition: background .2s, color .2s;
}
.auth-eye:hover { background: var(--surface-muted); color: var(--text-2); }
.auth-eye .ic { width: 19px; height: 19px; }

.auth-submit { justify-content: space-between !important; padding-inline: 18px !important; }
.auth-submit-ic { width: 20px; height: 20px; opacity: .92; }
.auth-divider { display: flex; align-items: center; gap: 12px; color: var(--muted-2); font-size: 11px; font-weight: 700; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-foot { color: var(--muted-2); font-size: 12px; text-align: center; line-height: 2; margin: 0; }

.logo {
  display: grid; place-items: center;
  width: 56px; height: 56px; border-radius: 17px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-weight: 800; font-size: 21px; letter-spacing: 0.02em;
  box-shadow: 0 12px 28px -12px rgba(79, 110, 247, .6);
}
.logo.lg { width: 46px; height: 46px; font-size: 17px; border-radius: 14px; }
.logo.xl { width: 62px; height: 62px; font-size: 22px; border-radius: 19px; }

/* --------------------------------------------------------------------------
   6. App layout + sidebar
   -------------------------------------------------------------------------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; align-self: flex-start;
  width: var(--sidebar-w); height: 100vh; flex: 0 0 var(--sidebar-w);
  display: flex; flex-direction: column; gap: 18px;
  padding: 22px 18px;
  background: rgba(255,255,255,.75); backdrop-filter: blur(14px);
  border-left: 1px solid var(--line);
}
.side-brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; }
.side-brand-text h1 { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.side-brand-text p { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

.side-nav { display: flex; flex-direction: column; gap: 4px; flex: 1; overflow-y: auto; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  height: 44px; padding: 0 12px; border: 0; border-radius: 13px;
  background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 600;
  text-align: right; width: 100%; transition: background .15s var(--ease), color .15s var(--ease);
}
.side-link:hover { background: var(--surface-muted); color: var(--text); }
.side-link.active { background: var(--brand-soft); color: var(--brand-strong); }
.side-link.danger { color: var(--muted); }
.side-link.danger:hover { background: var(--danger-soft); color: var(--danger); }
.nav-badge { margin-inline-start: auto; background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn-line); border-radius: 999px; font-size: 11px; font-weight: 800; padding: 2px 8px; font-style: normal; }
.side-foot { border-top: 1px solid var(--line); padding-top: 14px; display: flex; flex-direction: column; gap: 10px; }
.side-user { display: flex; align-items: center; gap: 11px; padding: 0 6px; }
.side-user-text b { display: block; font-size: 13px; }
.side-user-text span { font-size: 11px; color: var(--muted); }
.avatar {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #eef2ff, #e0f2fe); color: var(--brand-strong);
  font-weight: 800; font-size: 14px;
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 12px;
  height: 58px; padding: 0 24px;
  background: rgba(243,246,251,.8); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.crumb { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); min-width: 0; }
.crumb-root { color: var(--brand-strong); font-weight: 700; }
.net-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); background: var(--surface); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; }
.net-chip .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.net-chip .dot.ok { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.topbar-brand { display: none; } /* shown only on small screens */

.content { padding: 22px 24px 60px; max-width: 1500px; width: 100%; margin-inline: auto; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }

/* --------------------------------------------------------------------------
   7. Toolbar
   -------------------------------------------------------------------------- */
.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.search { display: flex; align-items: center; gap: 9px; height: 40px; padding: 0 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; min-width: 260px; transition: box-shadow .2s, border-color .2s; }
.search:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.search input { border: 0; outline: 0; background: transparent; width: 100%; font-size: 13px; }
.search .ic { color: var(--muted-2); }

/* --------------------------------------------------------------------------
   8. Cards + stats
   -------------------------------------------------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card); padding: 18px;
}
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-h h2 { font-size: 15.5px; font-weight: 800; letter-spacing: -0.01em; color: var(--text-2); }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 18px 16px; box-shadow: var(--shadow-card); display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.stat-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 11.5px; color: var(--muted-2); }
.hero-stat { background: linear-gradient(140deg, #4338ca 0%, #4f6ef7 45%, #0ea5b7 100%); border: 0; color: #fff; }
.hero-stat .stat-label { color: rgba(255,255,255,.85); }
.hero-stat .stat-value { color: #fff; }
.hero-stat .stat-sub { color: rgba(255,255,255,.85); }
.hero-stat .stat-sub b { color: #fff; }
.pending-tag { color: #fde68a; font-weight: 700; }

.cell-user { display: flex; flex-direction: column; min-width: 0; line-height: 1.5; }
.cell-user b { font-size: 13px; }
.cell-user span { font-size: 11px; }

/* --------------------------------------------------------------------------
   9. Chart
   -------------------------------------------------------------------------- */
.chart-card { overflow: hidden; }
.chart-card .card-h { margin-bottom: 2px; }
.chart-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.chart-side { display: flex; align-items: center; gap: 10px; }

/* dark neon chart */
.chart-dark {
  background: linear-gradient(165deg, #0f172a 0%, #0b1120 100%);
  border: 1px solid #1e293b;
  box-shadow: 0 18px 44px -22px rgba(2, 6, 23, 0.6), 0 0 0 1px rgba(56, 189, 248, 0.04) inset;
}
.chart-dark .card-h h2 { color: #e2e8f0; }
.chart-dark .chart-sub { color: #64748b; }
.chart-dark .chart-foot { color: #64748b; }
.chart-delta {
  font-family: var(--mono); font-size: 14px; font-weight: 800; direction: ltr; display: inline-block;
  padding: 5px 12px; border-radius: 12px; border: 1px solid transparent; letter-spacing: 0.01em;
}
.chart-delta.pos { color: #34d399; background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.3); }
.chart-delta.neg { color: #f87171; background: rgba(248, 113, 113, 0.12); border-color: rgba(248, 113, 113, 0.3); }
.chart-delta.flat { color: #94a3b8; background: rgba(148, 163, 184, 0.1); border-color: rgba(148, 163, 184, 0.25); }
.chart-pct {
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  padding: 5px 11px; border-radius: 12px; border: 1px solid transparent; direction: ltr; display: inline-block;
}
.chart-pct.pos { color: #34d399; background: rgba(52, 211, 153, 0.1); border-color: rgba(52, 211, 153, 0.25); }
.chart-pct.neg { color: #f87171; background: rgba(248, 113, 113, 0.1); border-color: rgba(248, 113, 113, 0.25); }
.chart-pct.flat { color: #94a3b8; background: rgba(148, 163, 184, 0.08); border-color: rgba(148, 163, 184, 0.2); }

.echarts-box { width: 100%; height: 270px; display: block; margin-top: 4px; }
.chart-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--muted-2); font-size: 11px; margin-top: 10px; padding: 0 6px; }
.chart-empty { display: grid; place-items: center; height: 200px; color: #64748b; font-size: 13px; background: rgba(148, 163, 184, 0.06); border-radius: var(--radius-sm); border: 1px dashed rgba(148, 163, 184, 0.2); }

/* --------------------------------------------------------------------------
   10. Forms
   -------------------------------------------------------------------------- */
.form-card { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; font-weight: 700; color: var(--text-2); }
.input, .select {
  height: 42px; padding: 0 13px; font-size: 13.5px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  outline: 0; transition: box-shadow .2s, border-color .2s; width: 100%;
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: var(--ring); }
.input.lg, .input.mono.lg { height: 50px; font-size: 17px; font-weight: 700; }
.input:disabled { background: var(--surface-muted); color: var(--muted-2); }
textarea.input { height: auto; padding: 12px 13px; resize: vertical; }
.form-error { background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 12.5px; }
.form-ok { background: var(--success-soft); border: 1px solid var(--success-line); color: #047857; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 12.5px; }
.form-actions { display: flex; gap: 10px; }
.readonly-strip, .balance-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.balance-strip.accent, .readonly-strip > div { display: flex; flex-direction: column; gap: 2px; }
.readonly-strip span, .balance-strip span { font-size: 11px; color: var(--muted); }
.readonly-strip b, .balance-strip b { font-size: 15px; font-variant-numeric: tabular-nums; }
.balance-strip.accent { background: var(--brand-tint); border-color: #dfe5ff; }
.balance-strip.accent b { color: var(--brand-strong); }

.seg-group { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; }
.seg-group legend { font-size: 12px; font-weight: 700; color: var(--text-2); margin-bottom: 4px; }
.seg-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; background: var(--surface); transition: border-color .2s, background .2s; }
.seg-item input { accent-color: var(--brand); width: 17px; height: 17px; }
.seg-item small { display: block; color: var(--muted); font-size: 11px; margin-top: 1px; }
.seg-item.active { border-color: var(--brand); background: var(--brand-tint); box-shadow: var(--ring); }
.seg-body b { font-size: 13.5px; }

.check { display: flex; align-items: flex-start; gap: 10px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); margin-top: 2px; }
.check.disabled { opacity: .55; cursor: not-allowed; }
.modal-sep {
  display: flex; align-items: center; gap: 10px; margin-top: 2px;
  font-size: 11.5px; font-weight: 700; color: var(--muted-2);
}
.modal-sep::before, .modal-sep::after { content: ""; height: 1px; background: var(--line); flex: 1; }
.hint-list { margin: 0; padding: 0 18px 0 0; display: flex; flex-direction: column; gap: 10px; color: var(--text-2); font-size: 13px; line-height: 1.9; }

/* withdrawal boxes */
.wd-box { border: 1px solid var(--line); background: var(--surface-soft); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.wd-box.blocked { border-color: var(--danger-line); background: var(--danger-soft); }
.wd-box-row { display: flex; align-items: center; gap: 8px; }
.wd-address { display: block; font-size: 12px; background: #0f172a; color: #a5f3fc; border-radius: var(--radius-sm); padding: 10px 12px; direction: ltr; overflow-wrap: anywhere; font-family: var(--mono); }
.wd-warn { display: flex; align-items: flex-start; gap: 9px; font-size: 12px; color: #7c4a03; background: var(--warn-soft); border: 1px solid var(--warn-line); border-radius: var(--radius-sm); padding: 10px 12px; line-height: 1.9; }
.wd-warn.compact { font-size: 11.5px; }
.wd-warn .ic { color: var(--warn); margin-top: 3px; }
.wd-block-text { font-size: 12px; color: var(--danger); background: rgba(185,28,28,.06); border-radius: var(--radius-xs); padding: 8px 10px; }
.wd-bank-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.wd-bank-grid.readonly div { display: flex; flex-direction: column; gap: 2px; }
.wd-bank-grid span { font-size: 11px; color: var(--muted); }
.wd-bank-grid b { font-size: 13px; }

/* admin withdrawal cards */
.wd-card { display: flex; flex-direction: column; gap: 12px; }
.wd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.wd-head-side { display: flex; align-items: center; gap: 14px; }
.wd-amount { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.wd-details { display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }
.wd-details .addr-ok { color: #047857; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.wd-details .addr-ok .ic { width: 14px; height: 14px; }
.wd-bank-grid.readonly, .wd-bank-grid { grid-template-columns: repeat(3, 1fr); }
.wd-admin-note { font-size: 12px; color: var(--muted); background: var(--surface-soft); border-radius: var(--radius-sm); padding: 9px 12px; }
.wd-actions { display: flex; gap: 10px; border-top: 1px dashed var(--line-strong); padding-top: 12px; }

/* --------------------------------------------------------------------------
   11. Tables (centered, fixed columns)
   -------------------------------------------------------------------------- */
.table-wrap {
  width: 100%; max-width: 100%; overflow: auto; max-height: 64vh;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
}
.table-wrap .tbl { border-radius: 0; border: 0; }
.tbl {
  display: table; table-layout: fixed; width: 100%; min-width: 720px;
  border-collapse: separate; border-spacing: 0; font-size: 13px; color: var(--text-2);
}
.tbl thead th {
  position: sticky; top: 0; z-index: 3;
  padding: 11px 12px; text-align: center;
  background: var(--surface-soft); border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: 11px; font-weight: 700; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.tbl tbody td {
  padding: 11px 12px; border-bottom: 1px solid #eef1f8; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-align: center;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: #f8faff; }
.tbl .r { text-align: center; font-variant-numeric: tabular-nums; }
.tbl .mono { direction: ltr; unicode-bidi: plaintext; text-align: center; }
.tbl .actions-cell { text-align: center; white-space: nowrap; }
.tbl .actions-cell .btn + .btn { margin-inline-start: 6px; }
.tbl .empty-cell { text-align: center; padding: 28px 12px; color: var(--muted-2); }

/* --------------------------------------------------------------------------
   12. Tabs
   -------------------------------------------------------------------------- */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 16px; border: 1px solid var(--line); background: var(--surface); border-radius: 11px; font-size: 12.5px; font-weight: 700; color: var(--muted); transition: all .15s; }
.tab:hover { color: var(--text); border-color: var(--line-strong); }
.tab.active { background: var(--brand-soft); color: var(--brand-strong); border-color: #dfe5ff; }
.tab-count { font-style: normal; background: rgba(0,0,0,.06); border-radius: 8px; padding: 1px 7px; font-size: 11px; }

/* --------------------------------------------------------------------------
   13. Modals + toast
   -------------------------------------------------------------------------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(15, 23, 42, .45);
  display: grid; place-items: center; padding: 24px; backdrop-filter: blur(4px);
}
.modal-card {
  width: min(560px, 100%); background: var(--surface); border-radius: var(--radius-lg);
  border: 1px solid var(--line); box-shadow: var(--shadow-lg); padding: 20px;
  display: flex; flex-direction: column; gap: 14px; animation: modal-in .22s var(--ease) both;
  max-height: min(92vh, 900px); overflow-y: auto; overscroll-behavior: contain;
}
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-head h3 { font-size: 16px; font-weight: 800; }
.modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal-text { color: var(--text-2); font-size: 13px; line-height: 2; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid var(--line); padding-top: 14px; }

.toast {
  position: fixed; bottom: 24px; inset-inline: 0; margin-inline: auto; z-index: 80;
  width: fit-content; max-width: min(92vw, 480px);
  padding: 12px 18px; border-radius: var(--radius); font-size: 13px; font-weight: 700;
  background: #0f172a; color: #e2e8f0; box-shadow: var(--shadow-lg);
}
.toast.error { background: #450a0a; color: #fecaca; }

/* --------------------------------------------------------------------------
   14. Responsive — phone & small tablet
   -------------------------------------------------------------------------- */
@media (max-width: 1240px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .content { padding-inline: 18px; }
}

@media (max-width: 1024px) {
  .content { padding: 18px 16px 60px; }
  .topbar { padding: 0 16px; }
  .tbl { min-width: 680px; }
}

@media (max-width: 900px) {
  /* login */
  .auth-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-hero { padding: 26px 22px 84px; }
  .auth-headline, .auth-tagline, .auth-points { display: none; }
  .auth-candles { min-height: 120px; height: 76px; opacity: .8; }
  .auth-hero-inner { gap: 0; max-width: 520px; }
  .auth-brand h1 { font-size: 19px; }
  .auth-side { padding: 0 16px 32px; margin-top: -56px; position: relative; z-index: 3; background: transparent; background-image: none; }

  /* app shell: fixed app-style bottom navigation */
  .app { flex-direction: column; }
  .sidebar {
    position: fixed; z-index: 40; inset-inline: 0; bottom: 0; top: auto; align-self: stretch;
    width: 100%; height: auto; flex: 0 0 auto;
    flex-direction: row; align-items: stretch; gap: 0; flex-wrap: nowrap;
    padding: 5px 4px max(5px, env(safe-area-inset-bottom, 0px));
    border-left: 0; border-top: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, .94); backdrop-filter: blur(18px);
    box-shadow: 0 -12px 32px -18px rgba(15, 23, 42, .35);
  }
  .side-brand { display: none; }
  .side-nav {
    order: 1; flex: 1 1 auto; flex-direction: row; flex-wrap: nowrap; gap: 1px;
    overflow: visible; padding: 0; margin: 0; scroll-snap-type: none;
  }
  .side-nav::-webkit-scrollbar { display: none; }
  .side-link {
    position: relative; flex: 1 1 0; min-width: 0; width: auto;
    flex-direction: column; justify-content: center; align-items: center; gap: 3px;
    height: 56px; padding: 3px 1px 2px; border-radius: 14px; background: transparent;
    font-size: 9.5px; line-height: 1.15; font-weight: 700; color: var(--muted);
    text-align: center; scroll-snap-align: none;
  }
  .side-link span { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-link .ic { width: 20px; height: 20px; }
  .side-link:active { background: var(--surface-muted); }
  .side-link.active { background: var(--brand-soft); color: var(--brand-strong); }
  .side-link.active .ic { color: var(--brand-strong); }
  .side-link.danger { color: var(--muted); }
  .side-link.danger:active { background: var(--danger-soft); }
  .side-foot {
    order: 2; flex: 0 0 auto; display: flex; flex-direction: row; align-items: stretch;
    border-top: 0; padding: 0; margin: 0; gap: 0;
  }
  .side-user { display: none; }
  .side-foot .side-link { flex: 0 0 62px; min-width: 54px; height: 56px; }
  .nav-badge {
    position: absolute; top: 1px; inset-inline-start: 6px; margin: 0;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
    font-size: 9px; line-height: 16px; text-align: center; font-style: normal;
  }

  .topbar { height: 52px; padding: 0 14px; position: sticky; top: 0; z-index: 30; background: rgba(243,246,251,.88); backdrop-filter: blur(12px); }
  .topbar-brand { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-weight: 800; font-size: 12px; letter-spacing: .03em; }
  .crumb .sep, .crumb-root { display: none; }
  .crumb { font-size: 12px; color: var(--muted); }
  .net-chip { font-size: 10.5px; padding: 4px 9px; }

  .content { padding: 14px 12px calc(84px + env(safe-area-inset-bottom, 0px)); }
  .stack { gap: 14px; }
  .card { padding: 14px; border-radius: var(--radius); }
  .card-h { margin-bottom: 10px; }
  .card-h h2 { font-size: 14.5px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .stat-card { padding: 14px 14px 12px; gap: 2px; }
  .stat-value { font-size: 20px; }
  .stat-sub { font-size: 11px; }
  .echarts-box { height: 215px; }
  .chart-side { gap: 6px; flex-wrap: wrap; }
  .chart-delta { font-size: 12.5px; padding: 4px 10px; }
  .chart-pct { font-size: 11px; padding: 4px 8px; }

  /* forms + strips */
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .grid-2 { grid-template-columns: 1fr; gap: 14px; }
  .modal-grid { grid-template-columns: 1fr; }
  .modal-card { width: 100%; max-width: 100%; padding: 16px 14px 14px; border-radius: 18px; }
  .modal-backdrop { padding: 10px; align-items: end; }
  .modal-foot { flex-wrap: wrap; }
  .modal-foot .btn { flex: 1 1 auto; }
  .readonly-strip, .balance-strip { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px; }
  .wd-bank-grid { grid-template-columns: 1fr; gap: 8px; }
  .wd-head-side { gap: 8px; }
  .wd-amount { font-size: 17px; }
  .wd-actions { flex-wrap: wrap; gap: 8px; }
  .wd-actions .btn { flex: 1 1 auto; }
  .seg-item { padding: 11px 12px; gap: 10px; }

  /* toolbar: full-width search + compact actions */
  .toolbar { gap: 8px; }
  .toolbar .search { flex: 1 1 100%; min-width: 0; order: -1; height: 40px; }
  .toolbar .muted.small { display: none; }
  .toolbar .spacer { display: none; }
  .toolbar .btn { flex: 1 1 auto; }

  /* tables: swipe scroll, no nested vertical scroll */
  .table-wrap { max-height: none; overflow-x: auto; overflow-y: visible; border-radius: var(--radius-sm); -webkit-overflow-scrolling: touch; }
  .tbl { min-width: 640px; font-size: 12px; }
  .tbl thead th, .tbl tbody td { padding: 10px 10px; }

  /* prevent iOS zoom on focus */
  .input, .select, textarea.input, .search input, .auth-input input { font-size: 16px; }
  .auth-input input { height: 50px; }
  .icon-btn { width: 40px; height: 40px; }
}

@media (max-width: 560px) {
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .hero-stat { grid-column: 1 / -1; }
  .stat-value { font-size: 19px; }
  .hero-stat .stat-value { font-size: 23px; }
  .card { padding: 13px 12px; }
  .chart-sub { font-size: 10.5px; }
  .wd-amount { font-size: 15px; }
  .toast { bottom: max(14px, env(safe-area-inset-bottom, 0px)); font-size: 12px; padding: 11px 14px; }
  .auth-card { padding: 26px 20px 22px; border-radius: 22px; }
  .auth-card-head h2 { font-size: 21px; }
  .auth-candles { min-height: 90px; }
}

@media (max-width: 380px) {
  .stat-grid { grid-template-columns: 1fr; }
  .stat-value { font-size: 18px; }
  .side-link { font-size: 8.5px; padding: 2px 0 1px; height: 52px; }
  .side-foot .side-link { flex-basis: 52px; height: 52px; }
}
