:root {
  --bg: #f5f7fb;
  --bg-accent: #eef2f7;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --border: #e8ecf1;
  --primary: #2563eb;
  --primary-soft: #e8f0fe;
  --primary-hover: #1d4ed8;
  --sidebar: #ffffff;
  --sidebar-w: 248px;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --warning: #b45309;
  --warning-bg: #fff7e8;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.05);
  --font: "DM Sans", "Segoe UI", sans-serif;
  --transition: 180ms ease;
}

[data-theme="dark"] {
  --bg: #0f1419;
  --bg-accent: #151b24;
  --card: #1a222d;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --border: #2a3441;
  --sidebar: #151b24;
  --primary-soft: #1e3a5f;
  --warning-bg: #3b2f14;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(900px 420px at 0% 0%, rgba(37, 99, 235, 0.05), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  padding: 18px 12px;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 22px;
  font-weight: 700;
  font-size: 18px;
  color: var(--text);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 36px; height: 36px; border-radius: 11px;
  background: linear-gradient(145deg, #3b82f6, #0ea5e9);
  color: #fff; display: grid; place-items: center; font-weight: 800;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}
.brand-mark.sm { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 11px;
  object-fit: contain; background: #fff;
  border: 1px solid var(--border);
}

.nav-section {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  padding: 18px 12px 8px;
  font-weight: 700;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--muted);
  margin-bottom: 3px;
  text-decoration: none;
  font-weight: 500;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.nav-link i { width: 18px; text-align: center; font-size: 14px; }
.nav-link:hover {
  background: var(--bg-accent);
  color: var(--text);
  text-decoration: none;
}
.nav-link.active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  border-bottom: 1px solid transparent;
}

.alert-2fa {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 11px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  animation: fadeIn .35s ease;
  text-decoration: none;
  transition: filter .15s ease;
}
.alert-2fa:hover { filter: brightness(.97); color: #92400e; }
.alert-2fa.is-on {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}
.alert-2fa.is-on:hover { color: #065f46; }

.twofa-steps {
  margin: 0 0 20px;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.7;
}
.twofa-qr-block {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
}
.twofa-qr {
  width: 200px;
  height: 200px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.icon-btn {
  width: 40px; height: 40px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  display: grid; place-items: center;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition), transform var(--transition);
}
.icon-btn:hover { color: var(--text); border-color: #cfd7e3; transform: translateY(-1px); }

.lang-dropdown, .user-dropdown { position: relative; }
.lang-menu, .user-menu {
  display: none;
  position: absolute;
  right: 0; top: calc(100% + 8px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  min-width: 190px;
  z-index: 50;
  padding: 6px;
  animation: popIn .16s ease;
}
.lang-dropdown.open .lang-menu,
.user-dropdown.open .user-menu { display: block; }
.lang-menu button, .user-menu a {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
  font: inherit;
}
.lang-menu button:hover, .user-menu a:hover { background: var(--bg-accent); }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--text);
  padding: 4px 6px 4px 4px;
  border-radius: 999px;
}
.user-chip:hover { background: rgba(0,0,0,.03); }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: linear-gradient(145deg, #7c3aed, #6366f1);
  color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 13px;
}
.user-meta { text-align: left; line-height: 1.2; }
.user-meta strong { display: block; font-size: 13px; }
.user-meta span { font-size: 11px; color: var(--muted); }

.content {
  padding: 8px 28px 40px;
  max-width: 1120px;
  width: 100%;
  margin: 0 auto;
  animation: fadeIn .3s ease;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 14px;
  font-weight: 500;
}
.back-link:hover { color: var(--text); text-decoration: none; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.card-head h1, .card-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.card-head p { margin: 0; color: var(--muted); }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: #f3f4f6;
  color: #4b5563;
}
.badge-live { background: var(--success-bg); color: var(--success); }
.badge-kyc { background: var(--warning-bg); color: var(--warning); }
.badge-count { background: #f3f4f6; color: var(--muted); }

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 10px 0 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.stat {
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--bg-accent), transparent);
}
.stat label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.stat strong { font-size: 20px; letter-spacing: -0.02em; }
.stat.accent strong { color: var(--primary); }

.account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 4px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.account-row:hover { background: rgba(37, 99, 235, 0.02); }
.account-row:last-child { border-bottom: 0; }
.account-id {
  font-weight: 700;
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.account-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
  margin-top: 8px;
}
.account-metrics b { color: var(--text); font-weight: 600; }
.account-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.account-block {
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.account-block:last-child { border-bottom: 0; }
.account-block .account-row {
  border-bottom: 0;
  padding-bottom: 12px;
}
.pos-wrap {
  margin: 0 4px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg-accent);
}
.pos-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--card);
}
.pos-head strong { font-size: 13px; }
.pos-head span { font-size: 12px; color: var(--muted); }
.pos-empty {
  margin: 0;
  padding: 14px 12px;
  color: var(--muted);
  font-size: 13px;
}
.pos-table {
  font-size: 12.5px;
  background: var(--card);
  margin: 0;
}
.pos-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  white-space: nowrap;
}
.pos-table td { white-space: nowrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 9px 14px;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  transition: transform var(--transition), background var(--transition), filter var(--transition);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 6px 14px rgba(37,99,235,.25); }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { filter: brightness(0.97); color: var(--primary); }
.btn-outline { background: #fff; border-color: #bfdbfe; color: var(--primary); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--muted); }
.btn-block { width: 100%; }
.btn-lg { padding: 12px 18px; font-size: 14px; }

.method-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.method-row:hover { background: rgba(37,99,235,.02); }
.method-row:last-child { border-bottom: 0; }
.method-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; color: #fff; flex-shrink: 0;
  font-weight: 700; font-size: 16px;
  box-shadow: 0 6px 12px rgba(0,0,0,.08);
}
.method-body { flex: 1; min-width: 0; }
.method-body h3 { margin: 0; font-size: 15px; }
.method-body .sub { color: var(--muted); font-size: 12px; margin-top: 2px; }
.method-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.form-group { margin-bottom: 14px; }
.form-label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 600;
}
.form-control {
  width: 100%;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--text);
  border-radius: 10px;
  padding: 11px 12px;
  font: inherit;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: #93c5fd;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}
.form-control[readonly] { opacity: .85; }
.form-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.form-section-title {
  font-size: 11px;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
  margin: 22px 0 12px;
}

.profile-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 8px;
}
.profile-head .avatar { width: 54px; height: 54px; font-size: 18px; }
.verify-link { margin-left: auto; color: #d97706; font-weight: 600; }

.upload-box {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1.5px dashed #cbd5e1;
  background: #f8fafc;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
}
.upload-box:hover { border-color: #93c5fd; background: #f0f7ff; }
.upload-box input { display: none; }
.upload-badge {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.upload-text strong { color: var(--primary); display: block; }
.upload-text span { color: var(--muted); font-size: 12px; }

.guide-box {
  background: #f8fafc;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 16px 0 20px;
}
.guide-box li {
  list-style: none;
  margin: 8px 0;
  color: var(--muted);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.guide-box i { color: var(--primary); margin-top: 3px; }

.table { width: 100%; border-collapse: collapse; }
.table th, .table td {
  text-align: left;
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.table th { color: var(--muted); font-weight: 600; }
.table tr:hover td { background: rgba(37,99,235,.02); }

.status-pending { color: #b45309; font-weight: 600; }
.status-approved { color: var(--success); font-weight: 600; }
.status-rejected { color: var(--danger); font-weight: 600; }

.flash {
  border-radius: 11px;
  padding: 12px 14px;
  margin-bottom: 16px;
  font-weight: 500;
  animation: fadeIn .25s ease;
}
.flash-success { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1100px 560px at 8% -8%, rgba(37,99,235,.14), transparent 58%),
    radial-gradient(900px 500px at 100% 0%, rgba(14,165,233,.10), transparent 55%),
    linear-gradient(180deg, #f8fafc, #eef2f7);
}
.auth-center {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.auth-center .flash { width: 100%; max-width: 460px; }
.auth-center:has(.auth-card.wide) .flash { max-width: 680px; }
.auth-center .footer-note { width: 100%; text-align: center; }
.auth-card {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 30px;
  animation: popIn .25s ease;
}
.auth-card.wide { max-width: 680px; }
.auth-center:has(.auth-card.wide) { max-width: 680px; }
.auth-card h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: -0.03em; }
.auth-card .lead { color: var(--muted); margin: 0 0 22px; }
.auth-brand {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; font-weight: 700; color: var(--text);
}
.captcha-box {
  display: inline-block;
  background: linear-gradient(135deg, #111827, #1f2937);
  color: #fff;
  letter-spacing: .35em;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  user-select: none;
}
.footer-note {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  margin-top: 28px;
}

.sidebar-toggle {
  display: none;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  width: 38px; height: 38px;
  margin-right: 8px;
}

.deposit-meta {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 22px;
}
.deposit-meta-item {
  background: #f3f5f8;
  border-radius: 10px;
  padding: 12px 14px;
}
.deposit-meta-item span {
  display: block;
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.deposit-meta-item strong {
  font-size: 16px;
  font-weight: 700;
}
.deposit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  align-items: start;
}
.qr-wrap {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
}
.qr-wrap img { display: block; border-radius: 4px; }
.qr-hint {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 12px 0;
}
.address-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.address-row .form-control { font-size: 12px; }

.bank-info-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #f8fafc;
}
.method-notes {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: #fffbeb;
}
.method-notes .form-section-title {
  margin-bottom: 8px;
  color: #92400e;
}
.method-notes-body {
  font-size: 13px;
  line-height: 1.55;
  color: #78350f;
  white-space: pre-wrap;
}
.bank-row span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: 6px;
}
.receipt-upload { margin-top: 4px; }

.admin-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}
.admin-page-head h1 { margin: 0 0 4px; font-size: 24px; }
.admin-page-head p { margin: 0; color: var(--muted); }

.pm-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.pm-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pm-card.is-off { opacity: .7; }
.pm-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.pm-icon {
  width: 42px; height: 42px; border-radius: 12px;
  color: #fff; display: grid; place-items: center; font-weight: 700;
}
.pm-badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.pm-card h3 { margin: 4px 0 0; font-size: 16px; }
.pm-code { margin: 0; color: var(--muted); font-size: 12px; }
.pm-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.pm-stats span { display: block; font-size: 11px; color: var(--muted); }
.pm-stats strong { font-size: 13px; }
.pm-detail {
  font-size: 12px;
  color: var(--muted);
  background: #f3f5f8;
  border-radius: 8px;
  padding: 8px 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-actions { display: flex; gap: 8px; margin-top: 6px; }
.pm-form-card { margin-top: 8px; }
.pm-form-footer {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.pm-conditional { margin-top: 4px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal-card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 24px;
  animation: popIn .2s ease;
}
.modal-card h3 { margin: 0 0 10px; font-size: 18px; }
.modal-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.55; }
.modal-card-error { text-align: center; }
.modal-icon-error {
  width: 56px; height: 56px; margin: 0 auto 14px;
  border-radius: 50%; background: #fef2f2; color: #dc2626;
  display: grid; place-items: center; font-size: 22px;
}

.kyc-state {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 16px; border-radius: 12px; margin-bottom: 18px;
}
.kyc-state i { font-size: 22px; margin-top: 2px; }
.kyc-state strong { display: block; margin-bottom: 4px; }
.kyc-state p { margin: 0; font-size: 13px; color: var(--muted); }
.kyc-state-ok { background: #ecfdf5; border: 1px solid #a7f3d0; }
.kyc-state-ok i { color: #059669; }
.kyc-state-wait { background: #fffbeb; border: 1px solid #fde68a; }
.kyc-state-wait i { color: #d97706; }
.kyc-state-bad { background: #fef2f2; border: 1px solid #fecaca; }
.kyc-state-bad i { color: #dc2626; }
.kyc-upload-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px;
}
.kyc-admin-head {
  display: flex; justify-content: space-between; gap: 12px;
  align-items: flex-start; margin-bottom: 14px; flex-wrap: wrap;
}
.kyc-docs-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px;
}
.kyc-doc-item {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px;
  background: #f8fafc; display: flex; flex-direction: column; gap: 8px;
}
.kyc-doc-meta { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.kyc-doc-name { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kyc-admin-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.kyc-admin-actions form { display: flex; gap: 8px; flex-wrap: wrap; }

.settings-layout {
  display: grid; grid-template-columns: 240px 1fr; gap: 18px; align-items: start;
}
.settings-nav { display: flex; flex-direction: column; gap: 8px; position: sticky; top: 16px; }
.settings-nav-item {
  display: block; padding: 12px 14px; border-radius: 12px;
  border: 1px solid var(--border); background: var(--card); text-decoration: none; color: inherit;
}
.settings-nav-item strong { display: block; font-size: 14px; }
.settings-nav-item span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.settings-panels { display: flex; flex-direction: column; gap: 14px; }
.settings-panel h2 { margin: 0; font-size: 18px; }
.brand-preview-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 16px; }
.brand-preview {
  display: flex; gap: 12px; align-items: center;
  padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: #f8fafc;
}
.brand-preview img { width: 48px; height: 48px; object-fit: contain; border-radius: 10px; background: #fff; }
.brand-preview .favicon-preview { width: 32px; height: 32px; }
.brand-preview strong { display: block; }
.brand-preview span { font-size: 12px; color: var(--muted); }
.settings-save-bar {
  position: sticky; bottom: 12px; padding: 12px; border-radius: 12px;
  background: rgba(255,255,255,.9); border: 1px solid var(--border);
  backdrop-filter: blur(8px); display: flex; justify-content: flex-end;
}

.notif-dropdown { position: relative; }
.notif-bell { position: relative; }
.notif-badge {
  position: absolute; top: -2px; right: -2px;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--card);
}
.notif-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 8px);
  width: min(360px, 92vw); max-height: 420px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; z-index: 80;
}
.notif-dropdown.open .notif-menu { display: block; }
.notif-menu-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 14px; border-bottom: 1px solid var(--border);
}
.notif-mark-all {
  border: 0; background: transparent; color: #2563eb;
  font-size: 12px; font-weight: 600; cursor: pointer;
}
.notif-list { max-height: 360px; overflow: auto; }
.notif-empty { padding: 24px; text-align: center; color: var(--muted); font-size: 13px; }
.notif-item {
  display: block; padding: 12px 14px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border); background: transparent;
}
.notif-item:hover { background: #f8fafc; }
.notif-item.is-unread { background: #eff6ff; }
.notif-item.is-unread .notif-item-title { font-weight: 700; }
.notif-item-title { font-size: 13px; margin-bottom: 2px; }
.notif-item-body { font-size: 12px; color: var(--muted); line-height: 1.4; }
.notif-item-time { font-size: 11px; color: var(--muted); margin-top: 6px; }

.table-wrap { overflow-x: auto; }
.admin-table td { vertical-align: middle; }
.cust-cell { display: flex; align-items: center; gap: 10px; }
.avatar.sm { width: 32px; height: 32px; font-size: 12px; border-radius: 10px; }
.avatar.lg { width: 56px; height: 56px; font-size: 18px; border-radius: 16px; }
.cust-hero-left { display: flex; align-items: center; gap: 14px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.account-panel {
  border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 14px; background: #f8fafc;
}
.admin-split-forms { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.inner-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 14px;
}
.tx-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.tx-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.tx-amount { margin-bottom: 10px; }
.tx-amount strong { font-size: 22px; letter-spacing: -0.03em; }
.tx-amount span { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.tx-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.tx-details { font-size: 12px; background: #f8fafc; border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; line-height: 1.5; }
.tx-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.tx-actions .form-control { flex: 1; min-width: 160px; }
.lang-editor-list { display: flex; flex-direction: column; gap: 10px; max-height: 70vh; overflow: auto; }
.lang-editor-row {
  display: grid; grid-template-columns: 220px 1fr 1.2fr; gap: 10px; align-items: start;
  padding-bottom: 10px; border-bottom: 1px solid var(--border);
}
.lang-key { font-size: 12px; color: #2563eb; word-break: break-all; padding-top: 10px; }
.lang-default { font-size: 12px; color: var(--muted); padding-top: 10px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}

.mail-tpl-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
}
.mail-tpl-editor {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.mail-tpl-textarea {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.45;
  min-height: 280px;
  resize: vertical;
}
.mail-tpl-hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.mail-tpl-preview-wrap {
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: #e8eaed;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  min-height: 420px;
}
.mail-tpl-preview-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.mail-tpl-preview-subject {
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mail-tpl-preview {
  flex: 1;
  width: 100%;
  min-height: 380px;
  border: 0;
  background: #f0f2f5;
}

.cust-fin-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
  max-width: 640px;
}
.cust-fin-strip > div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--bg-accent);
}
.cust-fin-strip span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 2px;
}
.cust-fin-strip strong {
  font-size: 14px;
  font-weight: 700;
}
.cust-fin-strip em {
  display: block;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}
.acct-fin-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 12.5px;
  color: var(--muted);
}
.acct-fin-strip b { font-weight: 700; }
.acct-fin-strip em { font-style: normal; opacity: .8; }
.up { color: var(--success) !important; }
.down { color: var(--danger) !important; }

.fin-range-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}
.fin-tab {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 550;
}
.fin-tab:hover { color: var(--text); border-color: #cbd5e1; }
.fin-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.fin-snap {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.fin-snap-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  background: var(--card);
}
.fin-snap-item.is-active {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 1px var(--primary);
}
.fin-snap-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--muted);
  margin-bottom: 6px;
}
.fin-snap-vals {
  display: flex;
  gap: 10px;
  font-weight: 700;
  font-size: 13px;
}
.fin-snap-meta {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}

.fin-filters {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--card);
  margin-bottom: 14px;
}
.fin-filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.fin-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
.fin-strip-cell {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--card);
}
.fin-strip-cell span {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
.fin-strip-cell strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
}
.fin-strip-cell em {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 11px;
  color: var(--muted);
}

.fin-grid {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
}
.fin-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  overflow: hidden;
}
.fin-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.fin-panel-head h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
}
.fin-panel-meta {
  font-size: 12px;
  color: var(--muted);
}
.fin-table { font-size: 13px; }
.fin-table th {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
}
.fin-email {
  font-size: 11px;
  color: var(--muted);
}
.mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

@media (max-width: 960px) {
  .stats-row { grid-template-columns: repeat(2, 1fr); }
  .account-row { flex-direction: column; align-items: flex-start; }
  .form-row { grid-template-columns: 1fr; }
  .deposit-meta { grid-template-columns: repeat(2, 1fr); }
  .deposit-grid { grid-template-columns: 1fr; }
  .pm-grid { grid-template-columns: repeat(2, 1fr); }
  .settings-layout { grid-template-columns: 1fr; }
  .kyc-docs-grid { grid-template-columns: 1fr 1fr; }
  .tx-grid { grid-template-columns: 1fr; }
  .admin-split-forms { grid-template-columns: 1fr; }
  .lang-editor-row { grid-template-columns: 1fr; }
  .mail-tpl-grid { grid-template-columns: 1fr; }
  .fin-snap, .fin-strip, .cust-fin-strip { grid-template-columns: repeat(2, 1fr); }
  .fin-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0; top: 0; z-index: 100;
    transform: translateX(-100%);
    transition: transform .22s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: grid; place-items: center; }
  .content { padding: 12px 16px 32px; }
  .topbar { padding: 12px 16px; flex-wrap: wrap; }
  .alert-2fa { font-size: 12px; }
  .deposit-meta { grid-template-columns: 1fr 1fr; }
  .address-row { flex-direction: column; }
  .pm-grid { grid-template-columns: 1fr; }
  .admin-page-head { flex-direction: column; }
  .brand-preview-row { grid-template-columns: 1fr; }
  .kyc-docs-grid { grid-template-columns: 1fr; }
  .settings-nav { position: static; flex-direction: row; flex-wrap: wrap; }
}
