/* =========================================================
   Wallet — Design System
   ========================================================= */

:root {
  /* Color palette */
  --bg:        #0a0e14;
  --bg-2:      #0f1520;
  --panel:     #12181f;
  --panel-2:   #1a222c;
  --panel-3:   #232d3a;
  --border:    #232d3a;
  --border-2:  #2f3b4a;
  --text:      #e6edf3;
  --text-2:    #b7c1ce;
  --muted:     #7a8695;
  --muted-2:   #4a5563;

  --accent:      #4f8dfd;
  --accent-hov:  #3b7ffa;
  --accent-dim:  rgba(79,141,253,0.12);
  --ok:          #22c55e;
  --ok-dim:      rgba(34,197,94,0.12);
  --warn:        #f59e0b;
  --warn-dim:    rgba(245,158,11,0.12);
  --err:         #ef4444;
  --err-dim:     rgba(239,68,68,0.10);
  --info:        #60a5fa;
  --info-dim:    rgba(96,165,250,0.10);

  /* Spacing scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;

  /* Radius */
  --r-sm: 4px; --r-md: 6px; --r-lg: 10px; --r-xl: 14px; --r-2xl: 20px;

  /* Typography */
  --t-xs: 11px; --t-sm: 12px; --t-md: 13px; --t-lg: 14px;
  --t-xl: 16px; --t-2xl: 20px; --t-3xl: 24px; --t-4xl: 32px;

  /* Shadows */
  --sh-sm: 0 1px 2px rgba(0,0,0,.35);
  --sh-md: 0 4px 12px rgba(0,0,0,.4);
  --sh-lg: 0 12px 28px -8px rgba(0,0,0,.55);
  --sh-xl: 0 20px 40px -12px rgba(0,0,0,.65);

  /* Focus ring */
  --ring: 0 0 0 3px rgba(79,141,253,0.25);

  /* Sidebar */
  --sidebar-w: 232px;

  /* Motion */
  --dur: 160ms;
  --ease: cubic-bezier(.4,0,.2,1);
}

/* =========================================================
   Reset & base
   ========================================================= */

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Helvetica, Arial, sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-dim); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
small { font-size: var(--t-sm); }

.mono { font-family: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, Consolas, monospace; font-size: var(--t-sm); }
.muted { color: var(--muted); }
.hidden { display: none !important; }
.ic { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* =========================================================
   Layout — sidebar + content
   ========================================================= */

.app-shell {
  display: flex;
  min-height: 100vh;
  align-items: stretch;
}
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--bg-2);
  border-right: 1px solid var(--border);
  padding: var(--s-5) var(--s-4);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-2) var(--s-3); margin-bottom: var(--s-6);
}
.sidebar .brand .logo {
  width: 32px; height: 32px; border-radius: 8px;
  background: linear-gradient(135deg, #4f8dfd, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: white; font-size: 15px;
  box-shadow: var(--sh-md);
}
.sidebar .brand .name { font-weight: 700; font-size: var(--t-lg); }
.sidebar .brand .name .tenant { display: block; font-size: 10px; color: var(--muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; margin-top: 1px; }

.nav-section { margin-bottom: var(--s-6); }
.nav-section .label {
  font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.8px;
  padding: 0 var(--s-3); margin-bottom: var(--s-2);
}
.nav-item {
  display: flex; align-items: center; gap: var(--s-3);
  padding: 9px var(--s-3); border-radius: var(--r-md); color: var(--text-2);
  cursor: pointer; transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
  font-size: var(--t-md); font-weight: 500;
}
.nav-item:hover { background: var(--panel); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-dim); color: var(--accent); }
.nav-item .ic { opacity: 0.9; }
.nav-item.disabled { opacity: 0.4; pointer-events: none; }
.nav-item .badge { margin-left: auto; font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 700; }
.nav-item .badge.ok { background: var(--ok-dim); color: var(--ok); }
.nav-item .badge.warn { background: var(--warn-dim); color: var(--warn); }

.sidebar-user {
  margin-top: auto; padding-top: var(--s-4); border-top: 1px solid var(--border);
}
.sidebar-user .row {
  display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
}
.sidebar-user .avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #6366f1, #ec4899);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 12px;
}
.sidebar-user .info { flex: 1; min-width: 0; }
.sidebar-user .email { font-size: var(--t-sm); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .role { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: 0.4px; }
.sidebar-user .logout {
  background: transparent; border: 0; color: var(--muted); padding: 6px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
}
.sidebar-user .logout:hover { color: var(--err); background: var(--err-dim); }

.content { flex: 1; min-width: 0; padding: var(--s-8) var(--s-8); max-width: 1160px; }
.content .page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-bottom: var(--s-6); gap: var(--s-4); flex-wrap: wrap;
}
.content .page-head h1 { font-size: var(--t-3xl); }
.content .page-head .sub { color: var(--muted); font-size: var(--t-md); margin-top: 4px; }

.mobile-topbar { display: none; }

/* =========================================================
   Buttons
   ========================================================= */

.btn, button.primary, main button:not(.btn):not(.secondary):not(.danger):not(.ghost):not(.copy-btn):not(.icon-btn):not(.logout):not(.mobile-menu-btn) {
  background: var(--accent); color: white; border: 0;
  padding: 9px 16px; border-radius: var(--r-md); font-weight: 600; font-size: var(--t-md);
  transition: background var(--dur) var(--ease), transform var(--dur) var(--ease);
  display: inline-flex; align-items: center; gap: var(--s-2);
}
.btn:hover, main button:not(.secondary):not(.danger):not(.ghost):not(.copy-btn):not(.icon-btn):hover { background: var(--accent-hov); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }

button.secondary {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border-2);
  padding: 9px 16px; border-radius: var(--r-md); font-weight: 600; font-size: var(--t-md);
}
button.secondary:hover { background: var(--panel-3); border-color: var(--muted-2); }

button.ghost {
  background: transparent; color: var(--text-2); border: 0;
  padding: 6px 10px; border-radius: var(--r-sm); font-size: var(--t-sm);
}
button.ghost:hover { background: var(--panel-2); color: var(--text); }

button.danger { background: var(--err); color: white; border: 0; padding: 9px 16px; border-radius: var(--r-md); font-weight: 600; }
button.danger:hover { background: #dc2626; }

.icon-btn {
  width: 32px; height: 32px; border-radius: var(--r-md); background: transparent; border: 1px solid var(--border);
  color: var(--muted); display: inline-flex; align-items: center; justify-content: center;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-dim); }

/* =========================================================
   Cards & panels
   ========================================================= */

.card, .panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--s-5);
}
.card { margin-bottom: var(--s-4); }
.card h2 { font-size: var(--t-xl); margin-bottom: 4px; }
.card > .sub { color: var(--muted); font-size: var(--t-sm); margin-bottom: var(--s-4); }
.card .row { display: flex; gap: var(--s-3); align-items: center; margin-top: var(--s-3); flex-wrap: wrap; }

.grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

/* =========================================================
   Form controls
   ========================================================= */

input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=tel],
textarea, select {
  background: var(--bg-2); border: 1px solid var(--border-2); color: var(--text);
  padding: 9px 12px; border-radius: var(--r-md); font-size: var(--t-md);
  width: 100%; transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: var(--muted-2); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { font-family: ui-monospace, monospace; font-size: var(--t-sm); min-height: 90px; resize: vertical; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 20 20' fill='none' stroke='%237a8695' stroke-width='2'%3E%3Cpath d='M5 8l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px;
}
select option { background: var(--bg-2); color: var(--text); }

/* Chrome / Safari autofill — force dark background & light text */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
select:-webkit-autofill,
textarea:-webkit-autofill {
  -webkit-text-fill-color: var(--text) !important;
  -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset !important;
  caret-color: var(--text) !important;
  transition: background-color 999999s ease-in-out 0s;
}

/* Native date/time picker calendar in dark */
input[type=date], input[type=datetime-local], input[type=month], input[type=time] {
  color-scheme: dark;
}
input[type=date]::-webkit-calendar-picker-indicator,
input[type=time]::-webkit-calendar-picker-indicator {
  filter: invert(0.6);
  cursor: pointer;
}

label { display: block; font-size: var(--t-sm); color: var(--muted); margin-bottom: 4px; font-weight: 500; }

/* =========================================================
   Pills / chips / status
   ========================================================= */

.pill { display: inline-block; padding: 3px 8px; border-radius: 4px; font-size: 11px; font-family: ui-monospace, monospace; font-weight: 700; }
.pill.ok    { background: var(--ok-dim);    color: var(--ok); }
.pill.warn  { background: var(--warn-dim);  color: var(--warn); }
.pill.err   { background: var(--err-dim);   color: var(--err); }
.pill.info  { background: var(--info-dim);  color: var(--info); }
.pill.muted { background: var(--panel-2);   color: var(--muted); border: 1px solid var(--border); }

.status-chip { display: inline-block; padding: 2px 8px; font-size: 10px; font-weight: 700;
  border-radius: 4px; text-transform: uppercase; letter-spacing: 0.5px; }
.status-chip.ACTIVE, .status-chip.COMPLETED { background: var(--ok-dim); color: var(--ok); }
.status-chip.IN_REVIEW, .status-chip.PENDING, .status-chip.IN_PROGRESS { background: var(--warn-dim); color: var(--warn); }
.status-chip.SUSPENDED, .status-chip.BLOCKED, .status-chip.CANCELLED { background: var(--err-dim); color: var(--err); }

/* =========================================================
   Tables (admin)
   ========================================================= */

table { width: 100%; border-collapse: collapse; margin-top: var(--s-3); }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: var(--t-md); }
th { color: var(--muted); font-weight: 600; font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.5px; }
tr:hover td { background: var(--panel-2); }

/* =========================================================
   Auth screen
   ========================================================= */

.auth-view {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: var(--s-6); background: radial-gradient(ellipse at top, var(--bg-2), var(--bg));
}
.auth-box {
  max-width: 400px; width: 100%; padding: var(--s-8);
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: var(--sh-xl);
}
.auth-box .brand-lg { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-6); }
.auth-box .brand-lg .logo {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, #4f8dfd, #7c3aed);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: white; font-size: 18px; box-shadow: var(--sh-lg);
}
.auth-box h1 { font-size: var(--t-2xl); margin-bottom: 4px; }
.auth-box .sub { color: var(--muted); margin-bottom: var(--s-6); font-size: var(--t-md); }
.auth-box .field { margin-bottom: var(--s-4); }
.auth-box .switch { margin-top: var(--s-5); text-align: center; color: var(--muted); font-size: var(--t-sm); }
.auth-box a { cursor: pointer; }

/* =========================================================
   Wizard (Phase 1)
   ========================================================= */

.wizard { max-width: 720px; margin: 0 auto; }
.wizard .steps { display: flex; gap: 6px; margin-bottom: var(--s-8); }
.wizard .steps .s { flex: 1; height: 4px; border-radius: 2px; background: var(--border); position: relative; transition: background var(--dur) var(--ease); }
.wizard .steps .s.done { background: var(--ok); }
.wizard .steps .s.current { background: var(--accent); }
.wizard .steps .s .label {
  position: absolute; top: 12px; left: 0; right: 0; text-align: center;
  font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.wizard .steps .s.current .label { color: var(--accent); font-weight: 600; }
.wizard .steps .s.done .label { color: var(--ok); }

.wizard .step-head { margin-bottom: var(--s-5); padding-top: var(--s-5); }
.wizard .step-head h2 { font-size: var(--t-2xl); margin-bottom: 6px; }
.wizard .step-head p { color: var(--muted); font-size: var(--t-md); }

.wizard .step-body {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--r-xl); padding: var(--s-6);
  margin-bottom: var(--s-5); box-shadow: var(--sh-md);
}
.wizard .nav { display: flex; justify-content: space-between; align-items: center; margin-top: var(--s-5); }
.wizard .nav .spacer { flex: 1; }

.form-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(2, 1fr); }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid > .full { grid-column: 1 / -1; }
.field-group { display: flex; flex-direction: column; gap: 5px; }
.field-group label .req { color: var(--err); margin-left: 2px; }
.field-group .hint { font-size: var(--t-xs); color: var(--muted); margin-top: 2px; }
.field-group .err-msg { font-size: var(--t-sm); color: var(--err); margin-top: 4px; display: none; }
.field-group.has-error input, .field-group.has-error select { border-color: var(--err); }
.field-group.has-error .err-msg { display: block; }

.checkbox-group { display: grid; gap: 6px; grid-template-columns: repeat(2, 1fr); }
.checkbox-group label {
  display: flex; align-items: center; gap: var(--s-2); padding: 8px 12px;
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer; font-size: var(--t-md); color: var(--text); font-weight: 400;
  transition: background var(--dur), border-color var(--dur);
}
.checkbox-group label:hover { background: var(--panel-3); }
.checkbox-group label:has(input:checked) { background: var(--accent-dim); border-color: var(--accent); color: var(--text); }
.checkbox-group input[type=checkbox] { margin: 0; accent-color: var(--accent); }

.toggle-row {
  display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-4);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-md);
  cursor: pointer;
}
.toggle-row:hover { background: var(--panel-3); }
.toggle-row input { margin-top: 3px; accent-color: var(--accent); }
.toggle-row .label-text { flex: 1; }
.toggle-row .primary { font-weight: 600; font-size: var(--t-md); color: var(--text); }
.toggle-row .secondary { color: var(--muted); font-size: var(--t-sm); margin-top: 4px; font-weight: 400; }

.radio-cards { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.radio-cards label {
  display: block; padding: var(--s-4); border: 1px solid var(--border);
  border-radius: var(--r-lg); cursor: pointer; background: var(--panel-2);
  transition: border-color var(--dur), background var(--dur); color: var(--text);
}
.radio-cards label:hover { border-color: var(--muted-2); }
.radio-cards label:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }
.radio-cards input { margin-right: var(--s-2); accent-color: var(--accent); }
.radio-cards .title { font-weight: 600; font-size: var(--t-md); }
.radio-cards .desc { color: var(--muted); font-size: var(--t-sm); margin-top: 4px; margin-left: 24px; }

.sig-wrap { display: flex; flex-direction: column; gap: var(--s-2); }
.sig-canvas {
  width: 100%; height: 180px; background: white; border: 2px dashed var(--border-2);
  border-radius: var(--r-md); touch-action: none; cursor: crosshair;
  transition: border-color var(--dur);
}
.sig-canvas:hover { border-color: var(--accent); }
.sig-actions { display: flex; justify-content: space-between; align-items: center; }
.sig-actions .hint { color: var(--muted); font-size: var(--t-sm); }

.autocomplete { position: relative; }
.autocomplete .options {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
  background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--r-md);
  max-height: 240px; overflow-y: auto; margin-top: 4px; box-shadow: var(--sh-lg);
}
.autocomplete .options .opt {
  padding: 8px 12px; cursor: pointer; font-size: var(--t-md); border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: var(--s-2);
}
.autocomplete .options .opt:last-child { border-bottom: 0; }
.autocomplete .options .opt:hover { background: var(--panel-2); color: var(--accent); }
.autocomplete .options .opt .code { color: var(--muted); font-family: ui-monospace, monospace; font-size: var(--t-xs); }

.review-section {
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: var(--s-4); margin-bottom: var(--s-3);
}
.review-section h3 { font-size: var(--t-sm); text-transform: uppercase; letter-spacing: 0.5px; color: var(--muted); margin-bottom: var(--s-2); }
.review-section .kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px var(--s-3); font-size: var(--t-md); }
.review-section .kv .k { color: var(--muted); }
.review-section .edit-btn { float: right; font-size: var(--t-xs); color: var(--accent); cursor: pointer; text-decoration: none; text-transform: none; letter-spacing: 0; }

.wizard-alert {
  padding: 12px 16px; border-radius: var(--r-md); margin-bottom: var(--s-4);
  border: 1px solid; font-size: var(--t-md); display: flex; align-items: flex-start; gap: var(--s-2);
}
.wizard-alert.info { background: var(--info-dim); border-color: rgba(96,165,250,0.3); color: var(--info); }
.wizard-alert.warn { background: var(--warn-dim); border-color: rgba(245,158,11,0.3); color: var(--warn); }
.wizard-alert.err  { background: var(--err-dim);  border-color: rgba(239,68,68,0.3);  color: var(--err); }
.wizard-alert.ok   { background: var(--ok-dim);   border-color: rgba(34,197,94,0.3);  color: var(--ok); }

.sumsub-wrap {
  background: white; border-radius: var(--r-md); padding: 4px;
  min-height: 500px; border: 1px solid var(--border);
}

/* =========================================================
   Dashboard
   ========================================================= */

.balance-strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); margin-bottom: var(--s-6); }
.balance-tile {
  padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--r-lg);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  transition: border-color var(--dur), transform var(--dur);
}
.balance-tile:hover { border-color: var(--border-2); }
.balance-tile .label { font-size: var(--t-xs); color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; display: flex; align-items: center; gap: var(--s-2); }
.balance-tile .value { font-size: var(--t-3xl); font-weight: 600; margin: 8px 0 4px 0; letter-spacing: -0.02em; }
.balance-tile .value .cur { font-size: var(--t-md); color: var(--muted); margin-left: 4px; font-weight: 500; }
.balance-tile .sub { font-size: var(--t-sm); color: var(--muted); }

.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--s-3); }
.action-tile {
  padding: var(--s-5); border-radius: var(--r-lg); background: var(--panel); border: 1px solid var(--border);
  cursor: pointer; transition: border-color var(--dur), background var(--dur), transform var(--dur);
  display: flex; flex-direction: column; gap: 6px;
}
.action-tile:hover { border-color: var(--accent); transform: translateY(-1px); box-shadow: var(--sh-md); }
.action-tile.disabled { opacity: 0.5; pointer-events: none; }
.action-tile .icon-wrap {
  width: 36px; height: 36px; border-radius: var(--r-md); background: var(--accent-dim);
  color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 4px;
}
.action-tile .title { font-weight: 600; font-size: var(--t-lg); }
.action-tile .desc { color: var(--muted); font-size: var(--t-sm); }

/* Visual Mastercard */
.card-stack { display: grid; grid-template-columns: 340px 1fr; gap: var(--s-6); align-items: start; }
.mc-visual {
  width: 340px; height: 210px; border-radius: 16px; padding: var(--s-5);
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 45%, #7c3aed 100%);
  color: white; position: relative; overflow: hidden;
  box-shadow: var(--sh-xl); display: flex; flex-direction: column; justify-content: space-between;
}
.mc-visual::before {
  content: ''; position: absolute; right: -70px; top: -70px;
  width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,0.08);
}
.mc-visual::after {
  content: ''; position: absolute; right: -30px; bottom: -60px;
  width: 160px; height: 160px; border-radius: 50%; background: rgba(255,255,255,0.05);
}
.mc-visual .top { display: flex; justify-content: space-between; align-items: center; z-index: 1; }
.mc-visual .brand { font-weight: 700; font-size: var(--t-md); letter-spacing: 0.5px; opacity: 0.95; }
.mc-visual .mc-logo { width: 44px; height: 28px; position: relative; z-index: 1; }
.mc-visual .mc-logo::before, .mc-visual .mc-logo::after {
  content: ''; position: absolute; top: 0; width: 28px; height: 28px; border-radius: 50%;
}
.mc-visual .mc-logo::before { left: 0; background: #eb001b; }
.mc-visual .mc-logo::after { left: 16px; background: #f79e1b; mix-blend-mode: multiply; }
.mc-visual .chip {
  width: 36px; height: 26px; z-index: 1;
  background: linear-gradient(135deg, #ffd700 0%, #b8860b 100%);
  border-radius: 4px;
}
.mc-visual .num { font-family: ui-monospace, monospace; font-size: 20px; letter-spacing: 3px; z-index: 1; margin-top: -10px; }
.mc-visual .bottom { display: flex; justify-content: space-between; align-items: flex-end; z-index: 1; }
.mc-visual .exp { font-size: var(--t-xs); opacity: 0.7; }
.mc-visual .exp-val { font-size: var(--t-md); letter-spacing: 1px; margin-top: 2px; }
.mc-visual .balance { text-align: right; }
.mc-visual .balance .l { font-size: 10px; opacity: 0.7; text-transform: uppercase; }
.mc-visual .balance .v { font-size: var(--t-xl); font-weight: 600; margin-top: 2px; }

.mc-details h3 { font-size: var(--t-lg); margin-bottom: var(--s-3); }
.mc-details .row { margin-bottom: 8px; display: flex; justify-content: space-between; font-size: var(--t-md); }
.mc-details .row .k { color: var(--muted); }
.mc-details .actions { margin-top: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.mc-details .actions button { justify-content: flex-start; text-align: left; }

/* Sensitive modal */
.sensitive-modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,0.75); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: var(--s-5);
  backdrop-filter: blur(4px);
}
.sensitive-modal {
  background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--r-xl);
  padding: var(--s-6); max-width: 440px; width: 100%; box-shadow: var(--sh-xl);
}
.sensitive-modal h3 { margin-bottom: var(--s-3); font-size: var(--t-xl); }
.sensitive-modal .sens-row { display: flex; justify-content: space-between; padding: var(--s-3) 0; border-bottom: 1px solid var(--border); }
.sensitive-modal .sens-row:last-child { border-bottom: 0; }
.sensitive-modal .sens-row .k { color: var(--muted); font-size: var(--t-sm); }
.sensitive-modal .sens-row .v { font-family: ui-monospace, monospace; font-weight: 600; letter-spacing: 1px; }
.sensitive-modal .timer { text-align: center; margin-top: var(--s-3); color: var(--warn); font-size: var(--t-sm); }

/* Wallets */
.wallet-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s-5); margin-bottom: var(--s-3);
}
.wallet-card .head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--s-3); }
.wallet-card .net { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; font-size: var(--t-lg); }
.wallet-card .net .dot { width: 10px; height: 10px; border-radius: 50%; }
.wallet-card .net .dot.ETH { background: #627eea; }
.wallet-card .net .dot.TRON { background: #eb0029; }
.wallet-card .net .dot.BNB { background: #f3ba2f; }
.wallet-card .net .dot.SOL { background: #9945ff; }
.wallet-card .addr-row {
  display: flex; align-items: center; gap: var(--s-2); padding: 10px 12px;
  background: var(--panel-2); border-radius: var(--r-md); margin-bottom: var(--s-3);
}
.wallet-card .addr-row .addr { flex: 1; font-family: ui-monospace, monospace; font-size: var(--t-sm); word-break: break-all; }
.wallet-card .metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.wallet-card .metrics .m { font-size: var(--t-sm); color: var(--muted); }
.wallet-card .metrics .m .v { display: block; font-size: var(--t-md); color: var(--text); font-weight: 600; margin-top: 2px; }
.wallet-card .qr-panel { margin-top: var(--s-3); padding: var(--s-3); background: white; border-radius: var(--r-md); text-align: center; }
.wallet-card .qr-panel img { display: block; margin: 0 auto; }
.wallet-card .qr-panel .hint { color: #333; margin-top: 6px; font-size: var(--t-xs); }

.copy-btn {
  background: transparent; border: 1px solid var(--border-2); color: var(--muted);
  padding: 4px 10px; font-size: var(--t-xs); border-radius: var(--r-sm);
  display: inline-flex; align-items: center; gap: 4px;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.copied { color: var(--ok); border-color: var(--ok); }

/* US Account */
.usa-panel .fields { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-top: var(--s-4); }
.usa-panel .field-tile {
  padding: var(--s-4); background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-md);
}
.usa-panel .field-tile .l { font-size: var(--t-xs); color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; }
.usa-panel .field-tile .v { font-family: ui-monospace, monospace; font-size: var(--t-md); margin-top: 4px; word-break: break-all; display: flex; justify-content: space-between; align-items: center; gap: var(--s-2); }

/* Top-up wizard */
.topup-channels { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); margin-bottom: var(--s-5); }
.topup-channel {
  padding: var(--s-5); border: 1px solid var(--border); border-radius: var(--r-lg);
  cursor: pointer; background: var(--panel); transition: border-color var(--dur), background var(--dur);
}
.topup-channel:hover { border-color: var(--border-2); }
.topup-channel.active { border-color: var(--accent); background: var(--accent-dim); }
.topup-channel .title { font-weight: 600; margin-bottom: 4px; font-size: var(--t-lg); }
.topup-channel .desc { color: var(--muted); font-size: var(--t-sm); }

.quote-summary {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--s-5); margin: var(--s-4) 0;
}
.quote-summary .qrow { display: flex; justify-content: space-between; padding: 6px 0; font-size: var(--t-md); }
.quote-summary .qrow.total { font-weight: 700; font-size: var(--t-lg); border-top: 1px solid var(--border); padding-top: 10px; margin-top: 6px; }

/* Empty state */
.empty-state {
  padding: 48px var(--s-5); text-align: center; background: var(--panel);
  border: 1px dashed var(--border-2); border-radius: var(--r-xl);
}
.empty-state .icon-wrap {
  width: 60px; height: 60px; border-radius: 50%; margin: 0 auto var(--s-3);
  background: var(--panel-2); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
}
.empty-state h3 { font-size: var(--t-lg); margin-bottom: 6px; }
.empty-state p { color: var(--muted); font-size: var(--t-md); margin-bottom: var(--s-4); }

/* =========================================================
   Skeleton loaders
   ========================================================= */

@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--panel-2) 0%, var(--panel-3) 40%, var(--panel-2) 80%);
  background-size: 200px 100%; background-repeat: no-repeat;
  animation: shimmer 1.4s ease-in-out infinite;
  border-radius: var(--r-sm); color: transparent !important; user-select: none;
}
.sk-line { height: 12px; margin-bottom: 8px; border-radius: var(--r-sm); }
.sk-line.short { width: 40%; } .sk-line.med { width: 65%; } .sk-line.long { width: 90%; }
.sk-box  { border-radius: var(--r-lg); }
.sk-tile { height: 96px; border-radius: var(--r-lg); }
.sk-card { height: 210px; border-radius: 16px; }

/* =========================================================
   Toast
   ========================================================= */

.toast-stack {
  position: fixed; bottom: var(--s-6); right: var(--s-6); z-index: 200;
  display: flex; flex-direction: column; gap: var(--s-2);
}
.toast {
  background: var(--panel); border: 1px solid var(--border-2); border-radius: var(--r-md);
  padding: 10px 14px; font-size: var(--t-md); box-shadow: var(--sh-lg);
  display: flex; align-items: center; gap: var(--s-2); min-width: 220px;
  animation: toast-in 220ms var(--ease);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.toast.ok  { border-color: var(--ok);  }
.toast.err { border-color: var(--err); }
.toast .dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.toast.ok  .dot { background: var(--ok); }
.toast.err .dot { background: var(--err); }

/* =========================================================
   Tabs (admin still uses horizontal — user side now sidebar)
   ========================================================= */

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: var(--s-5); overflow-x: auto; }
.tab { padding: 10px 16px; cursor: pointer; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 600; font-size: var(--t-md); white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 900px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; top: 0; left: 0; width: 280px; z-index: 60;
    transform: translateX(-100%); transition: transform var(--dur) var(--ease);
    box-shadow: var(--sh-xl);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50;
    opacity: 0; pointer-events: none; transition: opacity var(--dur);
  }
  .sidebar-backdrop.open { opacity: 1; pointer-events: auto; }
  .content { padding: 72px var(--s-4) var(--s-5); }
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--s-3) var(--s-4); background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    position: fixed; top: 0; left: 0; right: 0; z-index: 40;
  }
  .mobile-topbar .brand-mini { display: flex; align-items: center; gap: var(--s-2); font-weight: 700; }
  .mobile-topbar .mobile-menu-btn {
    background: transparent; border: 0; color: var(--text); padding: 6px;
  }
  .card-stack { grid-template-columns: 1fr; }
  .mc-visual { width: 100%; max-width: 380px; }
  .balance-strip { grid-template-columns: 1fr; }
  .topup-channels, .usa-panel .fields, .form-grid, .checkbox-group, .radio-cards { grid-template-columns: 1fr; }
  .review-section .kv { grid-template-columns: 1fr; }
  .review-section .kv .k { margin-top: 6px; }
  .wizard .steps .s .label { display: none; }
}
