/* ============ Base ============ */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --bg: #0a0e1a;
  --bg-2: #111729;
  --surface: #161d31;
  --surface-2: #1d2540;
  --line: #2a3354;
  --text: #eaf0ff;
  --muted: #8b94b8;
  --accent: #8b5cff;
  --accent-2: #c33aa6;
  --ok: #2ee6a8;
  --warn: #ffb547;
  --danger: #ff5b6e;
  --grad: linear-gradient(135deg, #6c5cff 0%, #b94aff 60%, #ff4d8d 100%);
  --grad-card: radial-gradient(circle at 85% 15%, rgba(255, 140, 210, 0.35), transparent 50%),
               radial-gradient(circle at 15% 90%, rgba(110, 50, 220, 0.5), transparent 55%),
               linear-gradient(135deg, #150932 0%, #2b1063 30%, #5a1a90 65%, #a02ba8 100%);
  --grad-card-2: linear-gradient(135deg, #ff6a3d 0%, #c33aa6 50%, #4f3cb0 100%);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* ============ Light theme ============ */
[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f0f2f8;
  --line: #dde3ee;
  --text: #1a1f33;
  --muted: #6b7290;
  --accent: #6b3df0;
  --accent-2: #a52690;
  --ok: #15a878;
  --warn: #e8951e;
  --danger: #d83b50;
  --shadow-card: 0 8px 24px rgba(110, 90, 175, 0.12);
}
[data-theme="light"] .auth-card,
[data-theme="light"] .panel,
[data-theme="light"] .modal-card,
[data-theme="light"] .notif-dropdown {
  box-shadow: var(--shadow-card);
}
[data-theme="light"] .auth-card { background: rgba(255, 255, 255, 0.92); }
[data-theme="light"] .orb-1 { background: #b9a8ff; opacity: 0.35; }
[data-theme="light"] .orb-2 { background: #ffb0d5; opacity: 0.35; }
[data-theme="light"] .orb-3 { background: #ffd5b0; opacity: 0.2; }
[data-theme="light"] .sidebar,
[data-theme="light"] .admin-side {
  background: var(--bg-2);
}
[data-theme="light"] .stub-icon.ok-icon {
  background: rgba(21, 168, 120, 0.14);
}

/* ============ Toast notifications ============ */
.toasts {
  position: fixed;
  top: 20px; left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex; flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: calc(100vw - 40px);
  align-items: center;
}
.toast {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
  padding: 12px 14px;
  min-width: 260px;
  max-width: 380px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  pointer-events: auto;
  animation: toastIn 0.22s ease;
  font-size: 13px;
  color: var(--text);
}
.toast.success { border-left-color: var(--ok); }
.toast.error { border-left-color: var(--danger); }
.toast.info { border-left-color: var(--accent); }
.toast.warn { border-left-color: var(--warn); }
.toast-icon {
  font-size: 16px; font-weight: 700;
  flex-shrink: 0; width: 22px; text-align: center;
}
.toast.success .toast-icon { color: var(--ok); }
.toast.error .toast-icon { color: var(--danger); }
.toast.info .toast-icon { color: var(--accent); }
.toast.warn .toast-icon { color: var(--warn); }
.toast-body { flex: 1; line-height: 1.4; word-wrap: break-word; }
.toast-close {
  background: transparent; border: 0;
  color: var(--muted); cursor: pointer;
  font-size: 18px; padding: 0;
  line-height: 1; opacity: 0.7;
  flex-shrink: 0;
}
.toast-close:hover { opacity: 1; }
.toast.out { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(-12px) scale(0.96); }
}
@media (max-width: 520px) {
  .toasts { top: 12px; left: 12px; right: 12px; transform: none; align-items: stretch; }
  .toast { min-width: 0; max-width: 100%; }
}

/* ============ Skeleton loaders ============ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--surface-2) 50%, var(--bg-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: 6px;
  color: transparent !important;
  user-select: none;
  display: inline-block;
  min-height: 1em;
}
.skeleton-block { display: block; height: 16px; margin: 4px 0; }
.skeleton-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.skeleton-row:last-child { border-bottom: 0; }
.skeleton-circle { width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0; }
.skeleton-line { flex: 1; }
.skeleton-line > .skeleton { display: block; height: 12px; margin: 4px 0; }
.skeleton-line > .skeleton:first-child { width: 60%; }
.skeleton-line > .skeleton:last-child { width: 40%; }
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

html, body { height: 100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, .brand-name, .balance-amount, .stat-value, .view-title, .user-name {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  letter-spacing: -0.02em;
}

a { color: var(--accent); text-decoration: none; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }

/* ============ Auth ============ */
.auth-body {
  display: flex; align-items: safe center; justify-content: center;
  min-height: 100vh; padding: 32px 20px;
  position: relative;
}
.auth-bg {
  position: fixed; inset: 0; z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.orb {
  position: absolute; border-radius: 50%; filter: blur(80px); opacity: 0.5;
}
.orb-1 { width: 400px; height: 400px; background: #4f7cff; top: -100px; left: -100px; }
.orb-2 { width: 500px; height: 500px; background: #7c5cff; bottom: -200px; right: -150px; }
.orb-3 { width: 300px; height: 300px; background: #ff6a3d; top: 50%; left: 50%; opacity: 0.25; }

.auth-shell { position: relative; z-index: 1; width: 100%; max-width: 480px; }
.auth-brand {
  display: flex; align-items: center; gap: 14px; margin-bottom: 24px; color: #fff;
}
.brand-mark {
  width: 48px; height: 48px; border-radius: 14px;
  background: var(--grad); display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(79, 124, 255, 0.4);
  color: #fff;
}
.brand-mark.sm { width: 36px; height: 36px; border-radius: 10px; }
.brand-mark svg { width: 26px; height: 26px; }
.brand-mark.sm svg { width: 20px; height: 20px; }
.brand-name { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.brand-sub { color: var(--muted); font-size: 13px; }

.auth-card {
  background: rgba(22, 29, 49, 0.85);
  backdrop-filter: blur(20px);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 12px; margin-bottom: 24px; }
.tab {
  flex: 1; padding: 10px; border: 0; background: transparent; color: var(--muted);
  border-radius: 8px; cursor: pointer; font-weight: 500; transition: all 0.2s;
}
.tab.active { background: var(--surface-2); color: var(--text); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); }

.form { display: none; }
.form.active { display: block; }
.form h2 { font-size: 22px; margin-bottom: 4px; letter-spacing: -0.3px; }
.subtitle { color: var(--muted); margin-bottom: 20px; font-size: 13px; }

label { display: block; color: var(--muted); font-size: 12px; margin: 12px 0 6px; font-weight: 500; }
input[type="text"], input[type="email"], input[type="tel"], input[type="password"], input[type="number"], select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  outline: none; transition: border-color 0.2s, background 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: var(--surface); }
input::placeholder { color: #4a5478; }

.row { display: flex; gap: 12px; }
.row.between { justify-content: space-between; align-items: center; margin: 12px 0; }
.col { flex: 1; }

.check { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 13px; cursor: pointer; margin: 12px 0; }
.check input { width: auto; }
.link { color: var(--accent); font-size: 13px; cursor: pointer; }

.btn {
  width: 100%; padding: 12px 16px; border: 0; border-radius: 10px; cursor: pointer;
  font-weight: 600; transition: transform 0.1s, box-shadow 0.2s, background 0.2s;
  margin-top: 16px;
}
.btn.primary {
  background: var(--grad); color: #fff;
  box-shadow: 0 6px 18px rgba(139, 92, 255, 0.35);
}
.btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(185, 74, 255, 0.5);
}
.btn.primary:active { transform: translateY(0); box-shadow: 0 4px 12px rgba(139, 92, 255, 0.4); }
.btn.ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--surface); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger:hover { background: #e8475a; }

.divider { text-align: center; color: var(--muted); margin: 18px 0 4px; font-size: 12px; position: relative; }
.divider:before, .divider:after { content: ''; position: absolute; top: 50%; width: 40%; height: 1px; background: var(--line); }
.divider:before { left: 0; } .divider:after { right: 0; }

.msg { margin-top: 14px; font-size: 13px; min-height: 20px; }
.msg.error { color: var(--danger); }
.msg.success { color: var(--ok); }
.msg.wait { color: var(--warn); display: flex; align-items: center; gap: 8px; }
.msg.wait::before {
  content: '';
  width: 12px; height: 12px;
  border: 2px solid var(--warn);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

.auth-footer { text-align: center; color: var(--muted); font-size: 12px; margin-top: 20px; }

/* ============ Auth feature chips ============ */
.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.feature-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  background: rgba(22, 29, 49, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  transition: transform 0.2s, border-color 0.2s;
}
.feature-chip:hover { transform: translateY(-1px); }
.feature-chip svg {
  width: 14px; height: 14px;
  color: var(--accent);
  flex-shrink: 0;
}
.feature-chip.primary-feature {
  background: linear-gradient(135deg, rgba(46, 230, 168, 0.14), rgba(139, 92, 255, 0.08));
  border-color: rgba(46, 230, 168, 0.4);
  color: var(--text);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(46, 230, 168, 0.12);
}
.feature-chip.primary-feature svg { color: var(--ok); }

/* ============ Registration quick quiz ============ */
.reg-quiz {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.quiz-head {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 8px;
}
.reg-quiz label { margin-top: 12px; }
.reg-quiz select:invalid { color: #4a5478; }

/* ============ Region block page ============ */
.region-block-card {
  text-align: center;
  padding: 42px 32px;
}
.region-block-icon {
  width: 96px; height: 96px;
  margin: 0 auto 24px;
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(139, 92, 255, 0.15), transparent 70%);
  border-radius: 50%;
}
.region-block-icon svg { width: 80%; height: 80%; }
.region-block-card h2 { margin-bottom: 12px; font-size: 22px; }
.region-block-card .subtitle { margin-bottom: 18px; }
.region-block-hint {
  color: var(--muted); font-size: 13px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 14px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  text-align: left;
  line-height: 1.5;
}
.region-back-link {
  display: inline-block;
  margin-top: 16px;
  font-size: 13px;
  color: var(--muted);
}
.region-back-link:hover { color: var(--accent); }

/* ============ Wizard ============ */
.wizard-progress {
  display: flex; gap: 6px; margin: 4px 0 22px;
}
.wp-step {
  flex: 1; height: 4px; background: var(--bg-2); border-radius: 2px;
  transition: background 0.3s;
}
.wp-step.active { background: var(--grad); }

.wizard-step { display: none; }
.wizard-step.active { display: block; animation: fade 0.25s ease; }

.wizard-nav {
  display: flex; gap: 10px; margin-top: 22px;
}
.wizard-nav .btn { margin-top: 0; flex: 1; }
.wizard-nav .btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.hint-text {
  color: var(--muted); font-size: 11px; margin-top: 6px;
  display: flex; align-items: center; gap: 6px;
}
.hint-text:before {
  content: 'ⓘ'; font-style: normal; color: var(--accent);
}

.agreements { display: flex; flex-direction: column; gap: 4px; margin-top: 18px; }
.agreements .check { margin: 4px 0; align-items: flex-start; }
.agreements .check input { margin-top: 3px; }

/* Processing screen */
.processing {
  text-align: center; padding: 20px 0;
  animation: fade 0.3s ease;
}
.processing h3 { font-size: 20px; margin: 18px 0 22px; letter-spacing: -0.3px; }
.processing-spinner {
  width: 56px; height: 56px; margin: 16px auto 0;
  border: 3px solid var(--bg-2); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.check-line {
  text-align: left; padding: 12px 14px; background: var(--bg-2);
  border-radius: 10px; margin: 8px 0; color: var(--muted); font-size: 14px;
  display: flex; align-items: center; gap: 10px;
  transition: all 0.3s;
}
.check-line:before {
  content: '○'; color: var(--muted); font-size: 18px;
  display: inline-block; width: 18px;
}
.check-line.done { color: var(--text); background: rgba(46, 230, 168, 0.08); }
.check-line.done:before { content: '✓'; color: var(--ok); }

/* ============ App layout ============ */
.app-body { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; background: var(--bg-2); border-right: 1px solid var(--line);
  padding: 22px 16px; display: flex; flex-direction: column; gap: 6px;
  position: sticky; top: 0; height: 100vh;
}
.brand-row { display: flex; align-items: center; gap: 12px; padding: 6px 8px 18px; font-weight: 700; font-size: 16px; }
.brand-row.center { justify-content: center; padding: 0 0 18px; }

.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px; border-radius: 10px; color: var(--muted);
  cursor: pointer; transition: all 0.2s; background: transparent; border: 0;
  font-weight: 500; font-size: 14px; text-align: left; width: 100%;
}
.nav-item:hover { background: var(--surface); color: var(--text); }
.nav-item.active { background: var(--surface-2); color: var(--text); }
.nav-item .ic {
  width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-item .ic svg { width: 100%; height: 100%; display: block; }
.icon-btn svg { width: 20px; height: 20px; display: block; }
.nav-item.logout { margin-top: auto; color: var(--danger); }
.nav-item.logout:hover { background: rgba(255, 91, 110, 0.1); }

.main { flex: 1; padding: 24px 32px; max-width: 1400px; }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.hello { color: var(--muted); font-size: 13px; }
.user-name { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--line); color: var(--text); cursor: pointer; font-size: 16px;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
  padding: 0;
}
.icon-btn:hover { background: var(--surface-2); border-color: rgba(139, 92, 255, 0.4); }

/* ============ Notifications ============ */
.notif-wrap { position: relative; }
.notif-badge {
  position: absolute; top: -5px; right: -5px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 10px;
  min-width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 2px var(--bg);
  animation: pulse 1.5s infinite;
}
.notif-dropdown {
  position: absolute; top: calc(100% + 10px); right: 0;
  width: 360px; max-height: 480px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  z-index: 90;
  animation: fade 0.15s ease;
  display: flex; flex-direction: column;
}
.notif-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.notif-head h4 { font-size: 15px; font-weight: 600; }
.notif-mark {
  background: transparent; border: 0;
  color: var(--accent); font-size: 12px; cursor: pointer;
  padding: 4px 8px; border-radius: 6px;
  transition: background 0.15s;
}
.notif-mark:hover { background: rgba(139, 92, 255, 0.12); }
.notif-list {
  overflow-y: auto;
  padding: 6px;
  flex: 1;
}
.notif-list .empty { padding: 28px 14px; font-size: 13px; }
.notif-item {
  display: flex; gap: 12px; padding: 12px;
  border-radius: 10px; transition: background 0.15s;
}
.notif-item.unread {
  background: rgba(139, 92, 255, 0.08);
  position: relative;
}
.notif-item.unread::before {
  content: ''; position: absolute; top: 50%; right: 10px;
  transform: translateY(-50%);
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(139, 92, 255, 0.2);
}
.notif-icon {
  width: 38px; height: 38px; border-radius: 50%;
  background: rgba(46, 230, 168, 0.15); color: var(--ok);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  flex-shrink: 0;
}
.notif-mid { flex: 1; min-width: 0; }
.notif-title { font-weight: 500; font-size: 13px; }
.notif-title b { font-weight: 700; color: var(--ok); }
.notif-sub {
  color: var(--muted); font-size: 12px; margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.notif-time { color: var(--muted); font-size: 11px; margin-top: 4px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--grad);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 700; font-size: 14px;
}
.avatar.admin-avatar { background: linear-gradient(135deg, #ff6a3d, #c33aa6); }
.badge { background: linear-gradient(135deg, #ff6a3d, #c33aa6); padding: 6px 10px; border-radius: 8px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; }

.view { display: none; }
.view.active { display: block; animation: fade 0.2s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.view h2 { font-size: 22px; font-weight: 700; margin-bottom: 16px; letter-spacing: -0.3px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }

/* ============ Bank card ============ */
.card-stack { display: flex; flex-direction: column; gap: 16px; align-items: stretch; }
.bank-card {
  background: var(--grad-card);
  border-radius: 18px;
  padding: 22px 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1.586 / 1;
  max-width: 440px;
  width: 100%;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  box-shadow:
    0 20px 50px rgba(110, 30, 175, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.bank-card::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(255, 255, 255, 0.16), transparent 55%),
    linear-gradient(120deg, transparent 50%, rgba(255, 255, 255, 0.06) 52%, transparent 54%);
  pointer-events: none;
}
/* Holographic shimmer sweep on hover */
.bank-card::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(105deg,
    transparent 35%,
    rgba(255, 255, 255, 0.18) 48%,
    rgba(255, 200, 255, 0.12) 52%,
    transparent 65%);
  transform: translateX(-120%);
  transition: transform 1s cubic-bezier(0.25, 0.8, 0.3, 1);
  pointer-events: none;
  z-index: 2;
}
.bank-card:hover::after { transform: translateX(120%); }
.bank-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.bank-card:hover {
  transform: translateY(-3px);
  box-shadow:
    0 28px 60px rgba(110, 30, 175, 0.55),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}
.bank-card.sm { padding: 16px 18px; max-width: none; }

.bank-card-top {
  display: flex; justify-content: space-between; align-items: flex-start;
  position: relative; z-index: 1;
}
.bank-card-brand {
  display: flex; align-items: center; gap: 9px;
  font-size: 15px; font-weight: 700; letter-spacing: 0.4px;
}
.bank-card-brand-icon { width: 22px; height: 22px; flex-shrink: 0; }
.bank-card-wave { width: 26px; height: 26px; opacity: 0.9; color: #fff; }

.bank-card-chip { display: none; }

.bank-card-number {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 22px;
  letter-spacing: 2.5px;
  font-weight: 500;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  position: relative; z-index: 1;
  align-self: end;
}
.bank-card.sm .bank-card-number { font-size: 17px; letter-spacing: 2px; }

.bank-card-bottom {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 14px; position: relative; z-index: 1;
}
.bank-card-info { min-width: 0; }
.bank-card-bottom .lbl {
  font-size: 9px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 3px;
}
.bank-card-bottom .val {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bank-card.sm .bank-card-bottom .val { font-size: 12px; }
.bank-card-logo {
  font-size: 22px; font-weight: 800; font-style: italic; letter-spacing: -1px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}
.bank-card.sm .bank-card-logo { font-size: 18px; }

.balance-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px 26px;
  position: relative;
  overflow: hidden;
}
.balance-box::before {
  content: '';
  position: absolute; top: -40%; right: -10%;
  width: 200px; height: 200px;
  background: radial-gradient(circle, rgba(139, 92, 255, 0.12), transparent 70%);
  pointer-events: none;
}
.balance-label {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  font-weight: 600;
}
.balance-amount {
  font-size: 52px;
  font-weight: 800;
  letter-spacing: -2px;
  margin-bottom: 10px;
  line-height: 1;
  background: linear-gradient(180deg, var(--text) 0%, color-mix(in srgb, var(--text) 65%, transparent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-variant-numeric: tabular-nums;
}
.balance-amount .cur {
  font-size: 28px;
  font-weight: 600;
  color: var(--muted);
  -webkit-text-fill-color: var(--muted);
  vertical-align: 14px;
  margin-right: 4px;
}
.balance-account {
  color: var(--muted);
  font-size: 12px;
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.5px;
}
@media (max-width: 520px) {
  .balance-amount { font-size: 40px; letter-spacing: -1.5px; }
  .balance-amount .cur { font-size: 22px; vertical-align: 10px; }
}

/* ============ Actions ============ */
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-content: start; }
.action {
  display: flex; align-items: center; gap: 14px;
  padding: 20px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); cursor: pointer; text-align: left;
  transition: transform 0.18s ease, background 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}
.action::after {
  content: '→';
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%) translateX(-4px);
  color: var(--muted); opacity: 0; font-size: 16px;
  transition: opacity 0.2s, transform 0.2s;
}
.action:hover {
  transform: translateY(-2px);
  background: var(--surface-2);
  border-color: rgba(139, 92, 255, 0.4);
  box-shadow: 0 14px 32px rgba(139, 92, 255, 0.18);
}
.action:hover::after { opacity: 1; transform: translateY(-50%) translateX(0); }
.action:active { transform: translateY(0); }
.action-icon {
  width: 46px; height: 46px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; flex-shrink: 0;
  transition: transform 0.2s;
}
.action:hover .action-icon { transform: scale(1.08); }
.action.deposit .action-icon { background: rgba(46, 230, 168, 0.15); color: var(--ok); }
.action.withdraw .action-icon { background: rgba(255, 181, 71, 0.15); color: var(--warn); }
.action.transfer .action-icon { background: rgba(255, 181, 71, 0.15); color: var(--warn); }
.action.verify .action-icon { background: rgba(139, 92, 255, 0.15); color: var(--accent); }
.action-title { font-weight: 600; font-size: 15px; }
.action-sub { color: var(--muted); font-size: 12px; margin-top: 2px; }

/* Verify spans full width as a secondary banner-style action */
.action.verify {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(139, 92, 255, 0.06), rgba(195, 58, 166, 0.04));
  border-color: rgba(139, 92, 255, 0.2);
}
.action.verify:hover {
  background: linear-gradient(135deg, rgba(139, 92, 255, 0.12), rgba(195, 58, 166, 0.08));
}

/* ============ Panels ============ */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 20px;
  margin-bottom: 20px;
}
.panel-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-head h3 { font-size: 16px; font-weight: 600; }
.panel-mini { margin-top: 18px; }
.panel-mini h4 { font-size: 14px; margin-bottom: 10px; color: var(--muted); }

.tx-list { display: flex; flex-direction: column; }
.tx-row {
  display: flex; align-items: center; gap: 14px; padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.tx-row:last-child { border-bottom: 0; }
.tx-ic {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; flex-shrink: 0;
}
.tx-ic.ok { background: rgba(46, 230, 168, 0.15); color: var(--ok); }
.tx-ic.warn { background: rgba(255, 91, 110, 0.15); color: var(--danger); }
.tx-mid { flex: 1; }
.tx-title { font-weight: 500; font-size: 14px; }
.tx-sub { color: var(--muted); font-size: 12px; }
.tx-amt { font-weight: 600; font-size: 14px; }
.tx-amt.ok { color: var(--ok); }
.tx-amt.warn { color: var(--danger); }
.tx-amt.rejected { color: var(--muted); text-decoration: line-through; }
.tx-ic.rejected { background: rgba(120, 120, 140, 0.15); color: var(--muted); }

/* Transaction status badges */
.tx-pending-row { background: rgba(255, 181, 71, 0.04); border-radius: 8px; padding-left: 6px; padding-right: 6px; margin-left: -6px; margin-right: -6px; }
.tx-rejected-row { opacity: 0.55; }
.tx-rejected-row .tx-title { text-decoration: line-through; }
.tx-badge {
  display: inline-block;
  font-size: 9.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  vertical-align: middle;
}
.tx-badge.warn { background: rgba(255, 181, 71, 0.18); color: var(--warn); }
.tx-badge.rejected { background: rgba(120, 120, 140, 0.18); color: var(--muted); }

.tx-actions { display: flex; gap: 6px; margin-top: 8px; }
.btn-mini {
  padding: 5px 10px; border-radius: 7px;
  font-size: 11px; font-weight: 600;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); cursor: pointer;
  transition: all 0.15s;
}
.btn-mini.ok {
  color: var(--ok);
  border-color: rgba(46, 230, 168, 0.4);
  background: rgba(46, 230, 168, 0.08);
}
.btn-mini.ok:hover { background: rgba(46, 230, 168, 0.18); }
.btn-mini.danger {
  color: var(--danger);
  border-color: rgba(255, 91, 110, 0.4);
  background: rgba(255, 91, 110, 0.06);
}
.btn-mini.danger:hover { background: rgba(255, 91, 110, 0.14); }

/* Settings — section heading */
.panel-h { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

/* Card limits */
.limits-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.limit-item {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; background: var(--bg-2); border-radius: 12px;
  border: 1px solid var(--line);
  transition: border-color 0.2s, transform 0.2s;
}
.limit-item:hover { border-color: rgba(139, 92, 255, 0.3); transform: translateY(-1px); }
.limit-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(139, 92, 255, 0.12);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.limit-icon svg { width: 22px; height: 22px; }
.limit-info { flex: 1; min-width: 0; }
.limit-label { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.limit-value { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }
.limit-value span { font-size: 11px; color: var(--muted); font-weight: 500; margin-left: 4px; }

@media (max-width: 600px) {
  .limits-grid { grid-template-columns: 1fr; }
}

/* Preferences toggles in Settings */
.pref-row {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.pref-row:last-child { border-bottom: 0; }
.pref-info { flex: 1; min-width: 0; }
.pref-title { font-weight: 600; font-size: 14px; }
.pref-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

.toggle {
  background: transparent;
  border: 0;
  padding: 6px 4px;
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  color: var(--text);
  font-size: 13px;
  flex-shrink: 0;
}
.toggle-track {
  width: 42px; height: 24px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.toggle-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 18px; height: 18px;
  background: var(--muted);
  border-radius: 50%;
  transition: left 0.2s, background 0.2s;
}
.toggle.on .toggle-track {
  background: rgba(139, 92, 255, 0.18);
  border-color: var(--accent);
}
.toggle.on .toggle-thumb {
  left: 21px;
  background: var(--accent);
}
.toggle-label {
  color: var(--muted); font-weight: 600;
  min-width: 36px; text-align: right;
}
.toggle.on .toggle-label { color: var(--text); }

/* Contact IT Department cards */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 600px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
}
.contact-card:hover {
  border-color: rgba(139, 92, 255, 0.4);
  transform: translateY(-1px);
  background: var(--surface);
}
.contact-icon {
  width: 42px; height: 42px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center; justify-content: center;
  flex-shrink: 0;
}
.contact-icon-email {
  background: rgba(79, 124, 255, 0.14);
  color: #4f7cff;
}
.contact-icon-tg {
  background: rgba(34, 158, 217, 0.14);
  color: #229ed9;
}
.contact-icon svg { display: block; }
.contact-mid {
  flex: 1; min-width: 0;
}
.contact-label {
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.7px;
  font-weight: 600;
  margin-bottom: 3px;
}
.contact-value {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.contact-arrow {
  color: var(--muted);
  font-size: 18px;
  transition: transform 0.2s, color 0.2s;
  flex-shrink: 0;
}
.contact-card:hover .contact-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* Help row */
.help-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px; background: var(--bg-2); border-radius: 12px;
  border: 1px solid var(--line);
}
.help-info { flex: 1; min-width: 0; }
.help-title { font-weight: 600; font-size: 14px; }
.help-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }
.help-row .btn { width: auto; margin: 0; flex-shrink: 0; padding: 10px 18px; }
@media (max-width: 520px) {
  .help-row { flex-direction: column; align-items: stretch; }
  .help-row .btn { width: 100%; }
}

.empty { color: var(--muted); text-align: center; padding: 28px 14px; font-size: 13px; }

/* ============ Cards page ============ */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; }
.grid-cards > div { display: flex; flex-direction: column; gap: 12px; }
.card-info { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: grid; gap: 8px; font-size: 13px; }
.card-info .lbl { color: var(--muted); }

/* ============ Verify ============ */
.verify-panel { max-width: 600px; }
.verify-panel p { color: var(--muted); margin: 12px 0; }
.verify-status { font-size: 14px; }
.verify-status .ok { color: var(--ok); } .verify-status .warn { color: var(--warn); }
.verify-steps { display: grid; gap: 10px; margin: 18px 0; }
.vs { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--bg-2); border-radius: 10px; font-size: 14px; }
.vs span { width: 24px; height: 24px; border-radius: 50%; background: var(--grad); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }

/* ============ Settings ============ */
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-grid .lbl { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.profile-grid .val { font-size: 15px; font-weight: 500; }

/* ============ Modal ============ */
.modal {
  position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(6px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal.open { display: flex; animation: fade 0.2s ease; }
.modal-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 28px; width: 100%; max-width: 440px; position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.modal-close {
  position: absolute; top: 14px; right: 14px;
  width: 32px; height: 32px; border-radius: 8px; background: var(--bg-2); border: 0;
  color: var(--text); font-size: 20px; cursor: pointer;
}
.modal-card h3 { font-size: 20px; margin-bottom: 4px; letter-spacing: -0.3px; }
.modal-card .subtitle { margin-bottom: 16px; }
.upload-box {
  border: 2px dashed var(--line); border-radius: 12px; padding: 28px; text-align: center;
  color: var(--muted); cursor: pointer; margin: 8px 0;
}
.upload-box:hover { border-color: var(--accent); color: var(--text); }
.stub-note {
  margin-top: 14px; padding: 10px 14px; background: rgba(255, 181, 71, 0.1);
  border: 1px solid rgba(255, 181, 71, 0.3); border-radius: 8px;
  color: var(--warn); font-size: 12px; text-align: center;
}

/* "Contact support" CTA inside the code-entry modal */
.btn-support {
  margin-top: 14px;
  width: 100%;
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  color: var(--accent);
  background: rgba(139, 92, 255, 0.08);
  border: 1px solid rgba(139, 92, 255, 0.3);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}
.btn-support:hover {
  background: rgba(139, 92, 255, 0.18);
  border-color: rgba(139, 92, 255, 0.55);
  transform: translateY(-1px);
}
.btn-support svg {
  width: 16px; height: 16px;
  display: block;
  flex-shrink: 0;
}

/* Small subtle link to cancel an in-progress transfer */
.trf-cancel-link {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 8px;
  background: transparent;
  border: 0;
  color: var(--muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  text-align: center;
  transition: color 0.15s;
}
.trf-cancel-link:hover { color: var(--danger); text-decoration: underline; }
.stub-result { text-align: center; }
.stub-icon { font-size: 48px; margin-bottom: 8px; opacity: 0.7; }
.stub-icon.ok-icon {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  background: rgba(46, 230, 168, 0.16);
  color: var(--ok);
  border-radius: 50%;
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  opacity: 1;
  box-shadow: 0 0 0 4px rgba(46, 230, 168, 0.08);
}
.stub-result h3 { margin-bottom: 10px; }
.stub-result p { color: var(--muted); margin-bottom: 8px; }

/* ============ Admin ============ */
.hidden { display: none !important; }

#adminPanel {
  display: flex;
  flex: 1;
  min-height: 100vh;
  width: 100%;
}
@media (max-width: 800px) {
  #adminPanel { flex-direction: column; }
}

.admin-login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; }
.admin-login:before {
  content: ''; position: fixed; inset: 0; z-index: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255, 106, 61, 0.2), transparent 50%),
              radial-gradient(circle at 80% 80%, rgba(195, 58, 166, 0.2), transparent 50%);
}
.admin-card { width: 100%; max-width: 420px; position: relative; z-index: 1; }
.admin-card h2 { margin-top: 8px; }
.hint { margin-top: 14px; text-align: center; color: var(--muted); font-size: 12px; }
.hint code { background: var(--bg-2); padding: 2px 6px; border-radius: 4px; }

.admin-side { background: var(--bg-2); }
.admin-side .brand-mark { background: linear-gradient(135deg, #ff6a3d, #c33aa6); box-shadow: 0 8px 24px rgba(195, 58, 166, 0.4); }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 1100px) { .stats-row { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 18px 18px 22px;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
}
.stat::before {
  content: '';
  position: absolute; top: 14px; bottom: 14px; left: 0;
  width: 3px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.stat:nth-child(2)::before { background: var(--ok); }
.stat:nth-child(3)::before { background: var(--warn); }
.stat:nth-child(4)::before { background: var(--accent-2); }
.stat:hover { transform: translateY(-1px); border-color: rgba(139, 92, 255, 0.3); }
.stat:hover::before { opacity: 1; }
.stat-label {
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  font-weight: 600;
}
.stat-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
}

.admin-grid { grid-template-columns: 1fr 1fr; }
.search {
  width: 220px; padding: 8px 12px; border-radius: 8px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text); outline: none;
}

.panel-head-tools { display: flex; align-items: center; gap: 8px; }
.btn-tool {
  padding: 8px 14px; border-radius: 9px;
  background: var(--bg-2); border: 1px solid var(--line);
  color: var(--text); cursor: pointer; font-size: 12px; font-weight: 500;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.btn-tool:hover {
  background: var(--surface-2);
  border-color: rgba(139, 92, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(139, 92, 255, 0.12);
}
.btn-tool:active { transform: translateY(0); }
.btn-tool.danger { color: var(--danger); }
.btn-tool.danger:hover {
  background: rgba(255, 91, 110, 0.08);
  border-color: rgba(255, 91, 110, 0.5);
  box-shadow: 0 4px 12px rgba(255, 91, 110, 0.15);
}

.empty-actions {
  display: flex; flex-direction: column; align-items: center;
  gap: 8px; padding: 36px 24px;
}
.empty-icon { font-size: 42px; opacity: 0.6; }
.empty-title { font-size: 16px; font-weight: 600; color: var(--text); }
.empty-hint { font-size: 13px; color: var(--muted); text-align: center; max-width: 320px; }
.empty-hint code { background: var(--bg-2); padding: 1px 6px; border-radius: 4px; font-size: 12px; }
.empty-actions .btn { width: auto; margin-top: 10px; padding: 10px 18px; }

.users-list { max-height: 600px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; }
.user-row {
  display: flex; align-items: center; gap: 12px; padding: 12px;
  border-radius: 10px; cursor: pointer; transition: all 0.2s;
  border: 1px solid transparent;
}
.user-row:hover { background: var(--bg-2); }
.user-row.selected {
  background: linear-gradient(90deg, rgba(139, 92, 255, 0.12), transparent);
  border-color: rgba(139, 92, 255, 0.4);
  box-shadow: inset 3px 0 0 var(--accent);
  padding-left: 14px;
}
.ava {
  width: 38px; height: 38px; border-radius: 50%; background: var(--grad);
  display: flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: 13px;
}
.ava.big { width: 56px; height: 56px; font-size: 18px; }
.user-mid { flex: 1; }
.user-name-row { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.user-sub { color: var(--muted); font-size: 12px; font-family: 'JetBrains Mono', monospace; }
.user-bal { font-weight: 700; font-size: 14px; }
.vtag { background: rgba(46, 230, 168, 0.15); color: var(--ok); font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 600; }

.client-head { display: flex; align-items: center; gap: 14px; margin-bottom: 18px; }
.client-name { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.client-sub { color: var(--muted); font-size: 13px; font-family: 'JetBrains Mono', monospace; }
.client-info { background: var(--bg-2); border-radius: 10px; padding: 14px; display: grid; gap: 8px; font-size: 13px; }
.client-info .lbl { color: var(--muted); }
.client-info .ok { color: var(--ok); } .client-info .warn { color: var(--warn); }
.mono-sm { font-family: 'JetBrains Mono', monospace; font-size: 12px; }

/* Compact head with inline actions */
.client-head-compact {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}
.client-head-info { flex: 1; min-width: 0; }
.client-head-info .client-name { font-size: 17px; }
.client-head-info .client-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.client-head-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.vtag.inline {
  background: rgba(46, 230, 168, 0.15); color: var(--ok);
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  font-weight: 600;
}

/* Balance management — primary action card */
.balance-edit.primary-action {
  background: linear-gradient(135deg, rgba(139, 92, 255, 0.1), rgba(195, 58, 166, 0.08));
  border: 1px solid rgba(139, 92, 255, 0.25);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 14px;
}
.be-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.be-head h4 { font-size: 14px; font-weight: 600; color: var(--text); }
.current-balance { font-size: 13px; color: var(--muted); }
.current-balance b { color: var(--text); font-size: 15px; }
.be-grid {
  display: grid; grid-template-columns: 130px 1fr 1fr; gap: 8px;
  margin-bottom: 10px;
}
.be-grid input { margin: 0; padding: 10px 12px; }
.be-buttons { display: flex; gap: 8px; }
.be-buttons .btn { margin: 0; flex: 1; padding: 10px; font-size: 13px; }

@media (max-width: 900px) {
  .be-grid { grid-template-columns: 1fr; }
  .client-head-actions { width: 100%; }
}

/* Tabs inside client card */
.client-tabs {
  display: flex; gap: 4px; background: var(--bg-2);
  padding: 4px; border-radius: 10px;
  margin-bottom: 12px;
}
.ctab {
  flex: 1; padding: 8px 12px; border: 0; background: transparent;
  color: var(--muted); border-radius: 7px; cursor: pointer;
  font-weight: 500; font-size: 13px; transition: all 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.ctab:hover { color: var(--text); }
.ctab.active { background: var(--surface-2); color: var(--text); box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); }
.ctab-badge {
  font-size: 10px; padding: 1px 6px; border-radius: 8px;
  background: var(--line); color: var(--muted);
  min-width: 18px; text-align: center;
}
.ctab.active .ctab-badge { background: var(--accent); color: #fff; }
.ctab-content { animation: fade 0.2s ease; }
.ctab-content.hidden { display: none; }

.card-tab-grid {
  display: grid; grid-template-columns: 320px 1fr; gap: 16px;
  align-items: start;
}
.card-tab-grid .bank-card.sm { max-width: 320px; }
@media (max-width: 1100px) {
  .card-tab-grid { grid-template-columns: 1fr; }
}

.tx-list-tab { max-height: 380px; overflow-y: auto; }

.kyc-block {
  margin-top: 18px; background: var(--bg-2); border-radius: 12px;
  border: 1px solid var(--line); overflow: hidden;
}
.kyc-block summary {
  padding: 14px 16px; cursor: pointer; font-weight: 600; font-size: 14px;
  list-style: none; display: flex; align-items: center; justify-content: space-between;
  user-select: none;
}
.kyc-block summary::-webkit-details-marker { display: none; }
.kyc-block summary:after { content: '▾'; color: var(--muted); transition: transform 0.2s; }
.kyc-block[open] summary:after { transform: rotate(180deg); }
.kyc-block summary:hover { background: var(--surface); }
.kyc-grid {
  padding: 0 16px 16px; display: grid; gap: 14px;
}
.kyc-section {
  background: var(--surface); border-radius: 10px; padding: 12px 14px;
  display: grid; gap: 6px; font-size: 12.5px;
}
.kyc-section h5 {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
  color: var(--accent); margin-bottom: 4px; font-weight: 700;
}
.kyc-section .lbl { color: var(--muted); }

/* ============ Admin view switching ============ */
.aview { display: none; }
.aview.active { display: block; animation: fade 0.2s ease; }
.view-title { font-size: 22px; font-weight: 700; margin-bottom: 18px; letter-spacing: -0.3px; }

.bar-row { margin-bottom: 14px; }
.bar-row:last-child { margin-bottom: 0; }
.bar-label {
  display: flex; justify-content: space-between;
  font-size: 13px; margin-bottom: 6px;
}
.bar-label .bar-value { font-weight: 700; }
.bar-track {
  height: 8px; background: var(--bg-2); border-radius: 4px;
  overflow: hidden;
}
.bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.bar-fill.ok { background: linear-gradient(90deg, #2ee6a8, #4fd6e4); }
.bar-fill.warn { background: linear-gradient(90deg, #ffb547, #ff8c47); }
.bar-fill.danger { background: linear-gradient(90deg, #ff5b6e, #c33aa6); }

.top-clients { display: flex; flex-direction: column; gap: 8px; }
.top-client {
  display: flex; align-items: center; gap: 14px;
  padding: 12px; background: var(--bg-2); border-radius: 12px;
  border: 1px solid var(--line);
}
.top-rank {
  font-weight: 800; color: var(--accent);
  font-size: 14px; min-width: 28px;
}
.top-mid { flex: 1; min-width: 0; }
.top-name { font-weight: 600; font-size: 14px; }
.top-sub {
  font-size: 12px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.top-bal { font-weight: 700; font-size: 15px; color: var(--ok); }

.settings-block { padding: 4px 2px; }
.settings-note {
  color: var(--muted); font-size: 13px; line-height: 1.55;
}
.settings-note code {
  background: var(--bg-2); padding: 2px 6px; border-radius: 4px;
  font-size: 12px; color: var(--accent);
}

/* Transfer codes block in admin */
.code-edit input,
.code-edit textarea {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  letter-spacing: 1.5px;
}
.code-edit .muted { color: var(--muted); font-style: italic; }
.code-edit .mono-sm { font-family: 'JetBrains Mono', 'Courier New', monospace; letter-spacing: 1px; }
.code-edit .current-balance .ok { color: var(--ok); }

.codes-list {
  display: flex; flex-direction: column; gap: 4px;
  margin: 12px 0;
  background: var(--bg-2);
  border-radius: 10px;
  padding: 8px;
}
.code-item {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; border-radius: 6px;
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 13px;
  border: 1px solid transparent;
  transition: background 0.15s;
}
.code-item .ci-num {
  font-size: 11px; color: var(--muted); min-width: 24px;
  font-family: -apple-system, sans-serif;
}
.code-item .ci-code { flex: 1; letter-spacing: 2px; }
.code-item .ci-status {
  font-size: 11px; color: var(--muted);
  font-family: -apple-system, sans-serif;
}
.code-item.done { opacity: 0.55; }
.code-item.done .ci-code { text-decoration: line-through; }
.code-item.done .ci-status { color: var(--ok); }
.code-item.current {
  background: rgba(139, 92, 255, 0.10);
  border-color: rgba(139, 92, 255, 0.4);
}
.code-item.current .ci-status { color: var(--accent); font-weight: 600; }

.code-controls { display: flex; flex-direction: column; gap: 10px; }
.cc-row {
  display: flex; gap: 8px; align-items: center;
}
.cc-row input[type="number"] {
  width: 70px; padding: 8px 10px;
  font-family: inherit; letter-spacing: 0;
}
.cc-row .btn { width: auto; margin: 0; padding: 8px 14px; font-size: 13px; flex: 0 0 auto; }
.code-edit textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  outline: none; resize: vertical;
  font-size: 13px;
}
.code-edit textarea:focus { border-color: var(--accent); background: var(--surface); }

/* Client side: code-progress dots in the transfer modal */
.code-progress {
  display: flex; gap: 6px; justify-content: center;
  margin: 16px 0 8px;
}
.code-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  transition: all 0.2s;
}
.code-dot.done {
  background: var(--ok);
  border-color: var(--ok);
  box-shadow: 0 0 0 2px rgba(46, 230, 168, 0.2);
}
.code-dot.current {
  background: var(--accent);
  border-color: var(--accent);
  animation: pulse 1.5s infinite;
}

/* ============ Chat / Support ============ */
.chat-panel {
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
  min-height: 560px;
}
.chat-header {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.chat-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--grad);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 14px;
  flex-shrink: 0;
}
.chat-title { font-weight: 600; font-size: 15px; }
.chat-status {
  color: var(--muted); font-size: 12px;
  display: flex; align-items: center; gap: 8px;
  margin-top: 2px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 4px rgba(46, 230, 168, 0.18);
  flex-shrink: 0;
}
.chat-messages {
  flex: 1; overflow-y: auto;
  padding: 22px;
  display: flex; flex-direction: column; gap: 10px;
  min-height: 380px;
  max-height: 520px;
}
.chat-messages .empty { margin: auto; }

.msg-bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  animation: fade 0.2s ease;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.msg-bubble.sent {
  align-self: flex-end;
  background: var(--grad);
  color: #fff;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 14px rgba(79, 124, 255, 0.25);
}
.msg-bubble.recv {
  align-self: flex-start;
  background: var(--bg-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--line);
}
.msg-time {
  font-size: 10px;
  opacity: 0.7;
  margin-top: 4px;
}

.chat-input {
  display: flex; gap: 10px; align-items: center;
  padding: 14px 18px;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
}
.chat-input input[type="text"] { flex: 1; margin: 0; }
.chat-input .btn {
  width: auto; margin: 0;
  padding: 10px 22px;
  flex-shrink: 0;
}
.chat-attach {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.chat-attach:hover {
  color: var(--accent);
  border-color: rgba(139, 92, 255, 0.4);
  background: rgba(139, 92, 255, 0.08);
}
.chat-attach svg { display: block; }

/* Pending photo preview shown above the input */
.chat-preview {
  position: relative;
  margin: 0 18px;
  padding: 8px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  display: inline-flex;
  align-self: flex-start;
}
.chat-preview img {
  max-height: 90px;
  max-width: 140px;
  border-radius: 6px;
  display: block;
  object-fit: cover;
}
.chat-preview-clear {
  position: absolute; top: -8px; right: -8px;
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 0;
  background: var(--danger);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
.chat-preview-clear:hover { transform: scale(1.05); }

/* Image inside a message bubble */
.msg-image {
  display: block;
  max-width: 100%;
  max-height: 260px;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: zoom-in;
  object-fit: cover;
}
.msg-bubble:has(.msg-image:only-child) { padding: 6px; }
.msg-bubble .msg-image + .msg-text { margin-top: 2px; }
.chat-mini .msg-image { max-height: 180px; }

/* Admin: compact chat inside client card */
.chat-mini { margin-top: 18px; }
.chat-mini-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 10px;
}
.chat-mini-head h4 { font-size: 14px; color: var(--muted); }
.chat-mini-meta { color: var(--muted); font-size: 11px; }
.chat-messages-admin {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 220px; max-height: 320px;
  padding: 14px;
}
.chat-mini .msg-bubble { font-size: 13px; max-width: 85%; }
.chat-input-admin {
  margin-top: 10px;
  padding: 0;
  border-top: 0;
  background: transparent;
}

/* Unread dot on nav */
.unread-dot {
  display: inline-block;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
  margin-left: auto;
  box-shadow: 0 0 0 3px rgba(255, 91, 110, 0.2);
  animation: pulse 1.5s infinite;
}
.unread-dot.hidden { display: none; }
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}

/* ============ Scrollbar ============ */
* { scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ============ Transaction category icons ============ */
.tx-cat {
  width: 38px; height: 38px;
  border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.tx-cat.cat-income   { background: rgba(46, 230, 168, 0.12); color: var(--ok); border-color: rgba(46, 230, 168, 0.25); }
.tx-cat.cat-outgoing { background: rgba(255, 181, 71, 0.12); color: var(--warn); border-color: rgba(255, 181, 71, 0.25); }
.tx-cat.cat-system   { background: rgba(139, 92, 255, 0.12); color: var(--accent); border-color: rgba(139, 92, 255, 0.25); }
.tx-cat.cat-rejected { background: rgba(120, 120, 140, 0.12); color: var(--muted); border-color: rgba(120, 120, 140, 0.25); }
.tx-cat svg { width: 18px; height: 18px; }

/* ============ Responsive ============ */
/* ============ Tablet & Mobile ============ */
@media (max-width: 880px) {
  /* Sidebar becomes a sticky top bar with horizontal scrollable nav */
  .app-body { flex-direction: column; }

  .sidebar {
    width: 100%; height: auto;
    position: sticky; top: 0; z-index: 50;
    flex-direction: column;
    padding: 12px 14px;
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(17, 23, 41, 0.96);
    backdrop-filter: blur(10px);
  }
  .sidebar .brand-row { padding: 2px 0 8px; font-size: 14px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
  .sidebar .brand-mark.sm { width: 32px; height: 32px; border-radius: 8px; }

  /* Grid of tiles — icon on top, label below. All items visible without scrolling. */
  .sidebar nav {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 0; padding: 0;
  }

  .nav-item {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: center; justify-content: center;
    gap: 4px;
    padding: 10px 6px;
    font-size: 11px;
    text-align: center;
    line-height: 1.25;
    min-height: 56px;
    white-space: normal;
    position: relative;
    border-radius: 10px;
  }
  .nav-item .ic { width: 22px; height: 22px; }
  .nav-item.logout {
    grid-column: 1 / -1;
    flex-direction: row;
    margin-top: 4px;
    padding: 10px;
    font-size: 12px;
    align-self: stretch;
    min-height: auto;
  }
  .nav-item.logout .ic { width: 18px; height: 18px; }
  .unread-dot {
    position: absolute; top: 6px; right: 6px;
    margin: 0;
  }

  /* Main content */
  .main { padding: 16px; max-width: 100%; }

  /* Topbar */
  .topbar { margin-bottom: 18px; gap: 12px; }
  .topbar-right { gap: 10px; }
  .hello { font-size: 12px; }
  .user-name { font-size: 17px; }
  .icon-btn { width: 38px; height: 38px; font-size: 14px; }
  .avatar { width: 38px; height: 38px; font-size: 13px; }

  /* Grids */
  .grid-2 { grid-template-columns: 1fr; gap: 16px; }
  .actions { grid-template-columns: 1fr 1fr; gap: 10px; }
  .admin-grid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .profile-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Stats */
  .stat { padding: 14px; }
  .stat-value { font-size: 22px; }

  /* Bank card — keep aspect ratio, just shrink padding */
  .bank-card { padding: 18px 20px; }
  .bank-card-number { font-size: 18px; letter-spacing: 1.8px; }
  .bank-card-brand { font-size: 14px; }
  .bank-card-logo { font-size: 20px; }

  /* Action buttons */
  .action { padding: 14px; gap: 10px; }
  .action-icon { width: 38px; height: 38px; font-size: 16px; }
  .action-title { font-size: 14px; }
  .action-sub { font-size: 11px; }

  /* Admin panel head tools */
  .panel-head { flex-wrap: wrap; gap: 10px; align-items: stretch; }
  .panel-head-tools { width: 100%; flex-wrap: wrap; }
  .search { flex: 1 1 180px; width: auto; min-width: 0; }

  /* Admin client card */
  .client-head-compact { flex-wrap: wrap; }
  .client-head-info { flex: 1 1 60%; min-width: 0; }
  .client-head-actions { flex: 1 1 100%; justify-content: flex-start; flex-wrap: wrap; }
  .be-head { flex-direction: column; align-items: flex-start; gap: 4px; }
  .be-grid { grid-template-columns: 1fr; }
  .card-tab-grid { grid-template-columns: 1fr; }
  .ctab { font-size: 12px; padding: 7px 8px; gap: 4px; }

  /* Auth */
  .auth-card { padding: 26px 22px; border-radius: 16px; }

  /* Modal */
  .modal-card { padding: 22px 20px; border-radius: 16px; }
  .modal-card h3 { font-size: 18px; }

  /* Notif dropdown — constrain to viewport */
  .notif-dropdown {
    width: calc(100vw - 28px);
    max-width: 360px;
    right: 0;
  }

  /* Chat */
  .chat-panel { min-height: 460px; }
  .chat-messages { min-height: 300px; max-height: 400px; padding: 16px; }
  .chat-header { padding: 14px 16px; }
  .chat-input { padding: 12px 14px; }

  /* Region block */
  .region-block-card { padding: 34px 22px; }
}

@media (max-width: 520px) {
  /* One-column actions on phones */
  .actions { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr; }

  .main { padding: 14px; }

  /* Title */
  .user-name { font-size: 16px; }
  .view h2 { font-size: 19px; }

  /* Balance amount */
  .balance-amount { font-size: 26px; }
  .balance-box { padding: 18px; }
  .balance-account { word-break: break-all; }

  /* Bank card */
  .bank-card { padding: 16px 18px; gap: 8px; }
  .bank-card-number { font-size: 16px; letter-spacing: 1.4px; }
  .bank-card-chip { width: 40px; height: 30px; }
  .bank-card-brand { font-size: 13px; }
  .bank-card-bottom .val { font-size: 12px; }
  .bank-card-logo { font-size: 18px; }

  /* Balance management buttons stacked */
  .be-buttons { flex-direction: column; }
  .be-buttons .btn { width: 100%; }

  /* Modal */
  .modal { padding: 14px; }
  .modal-card { padding: 22px 18px; }

  /* Auth */
  .auth-body { padding: 16px; }
  .auth-card { padding: 22px 18px; }
  .auth-card h2 { font-size: 19px; }
  .auth-brand { gap: 10px; margin-bottom: 18px; }
  .brand-name { font-size: 19px; }
  .brand-sub { font-size: 12px; }

  /* Chat */
  .chat-messages { min-height: 260px; max-height: 340px; padding: 14px; }
  .msg-bubble { max-width: 88%; font-size: 13px; }
  .chat-input { padding: 10px 12px; }
  .chat-input .btn { padding: 10px 16px; font-size: 13px; }

  /* Notif dropdown — almost full width */
  .notif-dropdown { width: calc(100vw - 16px); right: -4px; }
  .notif-item { padding: 10px; }
  .notif-icon { width: 34px; height: 34px; }

  /* Tabs (auth login/register) */
  .tab { font-size: 13px; padding: 9px; }

  /* Region block */
  .region-block-card { padding: 28px 18px; }
  .region-block-icon { width: 80px; height: 80px; margin-bottom: 18px; }
  .region-block-card h2 { font-size: 19px; }

  /* Admin head actions */
  .client-head-actions .btn-tool { flex: 1 1 auto; padding: 7px 10px; font-size: 11px; }
}
