/* ==========================================================================
   تریدر هاب — پنل مدیریت سرمایه — 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; }
[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
   -------------------------------------------------------------------------- */
.auth-shell {
  min-height: 100vh; display: grid; place-items: center; padding: 32px 20px; position: relative; overflow: hidden;
}
.auth-glow { position: absolute; border-radius: 50%; filter: blur(80px); z-index: 0; }
.auth-glow.a { width: 520px; height: 520px; background: rgba(99,102,241,.25); top: -180px; right: -120px; }
.auth-glow.b { width: 460px; height: 460px; background: rgba(14,165,183,.22); bottom: -160px; left: -120px; }
.auth-card {
  position: relative; z-index: 1;
  width: 100%; max-width: 440px;
  background: var(--surface); border-radius: var(--radius-xl); border: 1px solid var(--line);
  box-shadow: var(--shadow-lg); padding: 36px 32px 28px;
}
.auth-brand { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.auth-brand h1 { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.auth-brand p { margin-top: 2px; color: var(--muted); font-size: 13px; }
.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: 60px; height: 60px; font-size: 22px; }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-foot { margin-top: 18px; color: var(--muted-2); font-size: 12.5px; text-align: center; }

/* --------------------------------------------------------------------------
   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); }

.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-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; }
.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;
}
@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
   -------------------------------------------------------------------------- */
@media (max-width: 1240px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .sidebar {
    position: static; width: 100%; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap;
    border-left: 0; border-bottom: 1px solid var(--line); padding: 10px 14px; gap: 10px;
  }
  .side-brand-text p { display: none; }
  .side-nav { flex-direction: row; flex-wrap: wrap; order: 3; width: 100%; flex: unset; }
  .side-link { width: auto; height: 38px; font-size: 12px; padding: 0 10px; }
  .side-foot { border-top: 0; padding: 0; margin-inline-start: auto; flex-direction: row; align-items: center; }
  .side-user-text { display: none; }
  .content { padding: 16px 14px 60px; }
  .wd-bank-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .topbar { padding: 0 14px; }
}
@media (max-width: 640px) {
  .stat-grid { grid-template-columns: 1fr; }
  .auth-card { padding: 28px 20px 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .modal-grid { grid-template-columns: 1fr; }
}
@media (max-width: 420px) {
  .side-link span { display: none; }
  .side-link { padding: 0 10px; }
}
