:root {
  --brand: #7c3aed;
  --brand-600: #6d28d9;
  --brand-700: #5b21b6;
  --brand-ink: #2a1350;
  --brand-soft: #f4efff;
  --brand-softer: #faf8ff;
  --accent: #a855f7;
  --ink: #1e1633;
  --muted: #6b6580;
  --line: #e9e3f7;
  --bg: #f6f2ff;
  --card: #ffffff;
  --ok: #16a34a;
  --ok-soft: #e7f7ec;
  --warn: #d97706;
  --warn-soft: #fdf1e0;
  --err: #dc2626;
  --err-soft: #fdeaea;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 45px rgba(76, 29, 149, 0.10);
  --shadow-sm: 0 6px 18px rgba(76, 29, 149, 0.08);
  --font: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }

h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.15; color: var(--brand-ink); }
h1 { font-size: clamp(28px, 4vw, 40px); font-weight: 800; letter-spacing: -.02em; }
p { margin: 0 0 1em; color: var(--muted); }
small { color: var(--muted); }

.container { width: min(1140px, 92vw); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 999px; cursor: pointer;
  font: inherit; font-weight: 700; padding: 12px 22px; min-height: 46px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  background: var(--brand); color: #fff; box-shadow: var(--shadow-sm);
}
.btn:hover { transform: translateY(-1px); background: var(--brand-600); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: #fff; color: var(--brand-ink); border-color: var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--brand); background: var(--brand-softer); }
.btn.dark { background: var(--brand-ink); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: not-allowed; transform: none; }

/* ---------- Cards / panels ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 22px;
}
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 24px; }
.panel + .panel { margin-top: 20px; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 0 14px; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--brand-softer); outline: none;
}
.field textarea { padding: 12px 14px; min-height: 90px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--brand); background: #fff; box-shadow: 0 0 0 4px rgba(124, 58, 237, .14);
}
.field .err { color: var(--err); font-size: 12px; min-height: 14px; display: block; margin-top: 4px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 16px; }
.chips button { border: 1px solid var(--line); background: #fff; border-radius: var(--radius-sm); min-height: 42px; font: inherit; font-weight: 700; color: var(--brand-ink); cursor: pointer; }
.chips button:hover { border-color: var(--brand); }

/* ---------- Auth shell ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 28px 16px;
  background: radial-gradient(1200px 500px at 100% -10%, #efe6ff, transparent), var(--bg); }
.auth-card { width: min(440px, 100%); }
.auth-card .brand { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 800; color: var(--brand-ink); }

/* ---------- Marketing / landing ---------- */
.nav { display: flex; align-items: center; justify-content: space-between; padding: 20px 0; }
.nav .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--brand-ink); font-size: 20px; }
.nav .links { display: flex; align-items: center; gap: 22px; }
.nav .links a { color: var(--brand-ink); font-weight: 600; }
.nav-compact { display: none; align-items: center; gap: 14px; }
.nav-compact-link { color: var(--brand-ink); font-weight: 700; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--accent)); }
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center; padding: 40px 0 60px; }
.hero .eyebrow { display: inline-block; background: var(--brand-soft); color: var(--brand-700); font-weight: 700; font-size: 13px; padding: 8px 16px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(38px, 6vw, 66px); }
.hero .accent { color: var(--brand); }
.hero-card { background: var(--card); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); padding: 26px; }
.service-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 30px; }
.service-tiles .tile { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-sm); }
.service-tiles .tile b { color: var(--brand-ink); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; margin: 20px 0 60px; }

/* ---------- App shell (dashboard/admin) ---------- */
.shell { display: grid; grid-template-columns: 260px 1fr; min-height: 100vh; }
.sidebar { background: #fff; border-right: 1px solid var(--line); padding: 22px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.sidebar .brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--brand-ink); padding: 4px 8px 18px; }
.sidebar nav { display: flex; flex-direction: column; gap: 4px; }
.sidebar .nav-label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 16px 8px 6px; }
.sidebar nav a, .sidebar nav button {
  display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 12px; color: var(--ink);
  font-weight: 600; border: 0; background: transparent; cursor: pointer; font: inherit; text-align: left; width: 100%;
}
.sidebar nav a:hover, .sidebar nav button:hover { background: var(--brand-softer); color: var(--brand-700); }
.sidebar nav a.active { background: var(--brand); color: #fff; }
.main { min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 28px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar .search { flex: 1; max-width: 420px; }
.topbar .search input { width: 100%; min-height: 42px; border: 1px solid var(--line); border-radius: 999px; padding: 0 16px; background: var(--brand-softer); }
.profile { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--brand-ink); }
.avatar { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff; font-weight: 800; background: linear-gradient(135deg, var(--brand), var(--accent)); }
.content { padding: 28px; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }

/* ---------- Wallet card ---------- */
.wallet-card { color: #fff; border-radius: 22px; padding: 26px; position: relative; overflow: hidden;
  background: radial-gradient(600px 300px at 90% -20%, rgba(255,255,255,.22), transparent), linear-gradient(135deg, var(--brand-700), var(--brand)); box-shadow: var(--shadow); }
.wallet-card small { color: rgba(255,255,255,.75); text-transform: uppercase; letter-spacing: .08em; font-size: 12px; font-weight: 700; }
.wallet-card .balance { font-size: clamp(34px, 6vw, 52px); font-weight: 800; margin: 8px 0; }
.wallet-card .actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.wallet-card .actions .btn.ghost { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.28); }

/* ---------- Stat tiles ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.stat .label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat .value { font-size: 28px; font-weight: 800; color: var(--brand-ink); }

/* ---------- Service grid ---------- */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.service { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow-sm); color: var(--brand-ink); font-weight: 700; }
.service:hover { border-color: var(--brand); transform: translateY(-2px); transition: .12s; }
.service .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 20px; background: var(--brand-soft); color: var(--brand-700); }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table.data { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data th, table.data td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
table.data th { background: var(--brand-softer); color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
table.data tr:last-child td { border-bottom: 0; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover td { background: var(--brand-softer); }
.badge { display: inline-block; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge.successful, .badge.active, .badge.credit { background: var(--ok-soft); color: var(--ok); }
.badge.pending { background: var(--warn-soft); color: var(--warn); }
.badge.failed, .badge.reversed, .badge.suspended, .badge.debit { background: var(--err-soft); color: var(--err); }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--brand-ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 600; box-shadow: var(--shadow); z-index: 60; transition: .2s; max-width: 92vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--err); }
.toast.success { background: var(--ok); }

/* ---------- Misc ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; }
.alert.warn { background: var(--warn-soft); color: var(--warn); }
.alert.info { background: var(--brand-soft); color: var(--brand-700); }
.muted { color: var(--muted); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.right { margin-left: auto; }
.mt { margin-top: 18px; }
.hide { display: none !important; }
code, pre { font-family: "SFMono-Regular", ui-monospace, Menlo, monospace; }
pre.code { background: var(--brand-ink); color: #eadeff; padding: 16px 18px; border-radius: var(--radius-sm); overflow-x: auto; font-size: 13px; line-height: 1.55; }

/* ---------- Icons ---------- */
.icon { flex: none; vertical-align: middle; display: inline-block; }
.sidebar nav a .icon, .sidebar nav button .icon { color: var(--muted); }
.sidebar nav a:hover .icon, .sidebar nav button:hover .icon { color: var(--brand-700); }
.sidebar nav a.active .icon { color: #fff; }
.icon-pill { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-700); flex: none; }
.tile-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand-700); margin-bottom: 10px; }

/* ---------- Responsive ---------- */
.menu-btn { display: none; border: 1px solid var(--line); background: #fff; border-radius: 12px; width: 44px; height: 44px; font-size: 20px; cursor: pointer; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .feature-grid, .service-tiles { grid-template-columns: 1fr 1fr; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 264px; z-index: 40; transform: translateX(-100%); transition: .2s; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(30,22,51,.4); z-index: 30; }
  .menu-btn { display: grid; place-items: center; }
  .grid-2 { grid-template-columns: 1fr; }
  .nav .links { display: none; }
  .nav-compact { display: flex; }
}
@media (max-width: 560px) {
  .feature-grid, .service-tiles { grid-template-columns: 1fr; }
  .content, .topbar { padding-inline: 16px; }
}
