/* Nijiy Pay — futuristic neon/glass design system */
:root {
  --bg0: #05060f;
  --bg1: #0a0c1d;
  --glass: rgba(19, 22, 46, 0.62);
  --glass-strong: rgba(24, 27, 58, 0.86);
  --line: rgba(139, 92, 246, 0.22);
  --line-soft: rgba(148, 163, 208, 0.14);
  --text: #e8ecff;
  --muted: #97a0c7;
  --berry: #6d5cff;
  --berry2: #8b5cf6;
  --cyan: #22d3ee;
  --pink: #f472b6;
  --green: #34d399;
  --amber: #fbbf24;
  --red: #fb7185;
  --radius: 16px;
  --shadow: 0 18px 50px rgba(3, 5, 20, 0.55);
  --font: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Code", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg0);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Animated aurora background */
body::before {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(42% 46% at 18% 22%, rgba(109, 92, 255, 0.30), transparent 62%),
    radial-gradient(38% 40% at 82% 16%, rgba(34, 211, 238, 0.18), transparent 64%),
    radial-gradient(46% 50% at 68% 86%, rgba(244, 114, 182, 0.14), transparent 66%),
    radial-gradient(50% 55% at 8% 90%, rgba(139, 92, 246, 0.20), transparent 68%);
  animation: aurora 24s ease-in-out infinite alternate;
  filter: saturate(1.15);
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.05) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(75% 75% at 50% 40%, #000 30%, transparent 100%);
}
@keyframes aurora {
  0% { transform: translate3d(-3%, -2%, 0) rotate(0deg) scale(1); }
  50% { transform: translate3d(3%, 2%, 0) rotate(4deg) scale(1.06); }
  100% { transform: translate3d(-2%, 3%, 0) rotate(-3deg) scale(1.02); }
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

::selection { background: rgba(139, 92, 246, 0.5); }

/* ---------- Layout ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px;
  background: rgba(7, 8, 20, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 800; letter-spacing: 0.4px; font-size: 17px; color: var(--text); }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 32px; height: 32px; border-radius: 10px;
  background: conic-gradient(from 210deg, var(--berry), var(--cyan), var(--pink), var(--berry));
  box-shadow: 0 0 18px rgba(109, 92, 255, 0.65);
  display: grid; place-items: center;
  font-size: 15px; font-weight: 900; color: #060713;
}
.brand .beta { font-size: 10px; font-weight: 700; color: var(--cyan); border: 1px solid rgba(34,211,238,.4); border-radius: 999px; padding: 2px 7px; letter-spacing: 1px; }
.topnav { display: flex; gap: 8px; align-items: center; }
.main { width: min(1180px, 100% - 40px); margin: 0 auto; padding: 34px 0 64px; flex: 1; }

/* ---------- Glass cards ---------- */
.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  padding: 22px;
}
.card + .card { margin-top: 18px; }
.card-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1.6px; color: var(--muted); margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 980px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid-2 { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* ---------- Typography ---------- */
h1 { font-size: clamp(34px, 5.4vw, 60px); line-height: 1.05; letter-spacing: -1.6px; font-weight: 850; }
h2 { font-size: clamp(22px, 3vw, 30px); letter-spacing: -0.6px; font-weight: 800; }
h3 { font-size: 17px; font-weight: 750; }
.lead { color: var(--muted); font-size: 17px; line-height: 1.65; }
.grad-text {
  background: linear-gradient(94deg, var(--cyan) 0%, var(--berry2) 45%, var(--pink) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.kbd { font-family: var(--mono); font-size: 12.5px; background: rgba(10, 12, 30, 0.9); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; color: #cdd6ff; display: block; overflow-x: auto; white-space: pre; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 12px;
  padding: 11px 18px; font-size: 14.5px; font-weight: 700; font-family: var(--font);
  cursor: pointer; color: #fff; background: linear-gradient(135deg, var(--berry), var(--berry2));
  box-shadow: 0 8px 26px rgba(109, 92, 255, 0.36);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); text-decoration: none; }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: rgba(139, 92, 246, 0.10); border-color: var(--line); box-shadow: none; color: var(--text); }
.btn.ghost:hover { background: rgba(139, 92, 246, 0.18); }
.btn.cyan { background: linear-gradient(135deg, #0891b2, #22d3ee); box-shadow: 0 8px 26px rgba(34, 211, 238, 0.28); color: #04121a; }
.btn.danger { background: linear-gradient(135deg, #e11d48, #fb7185); box-shadow: 0 8px 26px rgba(251, 113, 133, 0.25); }
.btn.success { background: linear-gradient(135deg, #059669, #34d399); box-shadow: 0 8px 26px rgba(52, 211, 153, 0.25); color: #03281c; }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 10px; }
.btn.block { width: 100%; }

/* ---------- Forms ---------- */
.field { margin-bottom: 15px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.input, select.input, textarea.input {
  width: 100%; background: rgba(8, 10, 26, 0.85); color: var(--text);
  border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; font-family: var(--font);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--berry2); box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.18); }
.input::placeholder { color: #5d668f; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; letter-spacing: .8px; text-transform: uppercase; border-radius: 999px; padding: 5px 11px; border: 1px solid transparent; }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 8px currentColor; }
.badge.ok { color: var(--green); background: rgba(52, 211, 153, 0.12); border-color: rgba(52, 211, 153, 0.35); }
.badge.warn { color: var(--amber); background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.35); }
.badge.bad { color: var(--red); background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.35); }
.badge.info { color: var(--cyan); background: rgba(34, 211, 238, 0.10); border-color: rgba(34, 211, 238, 0.32); }
.badge.neutral { color: var(--muted); background: rgba(151, 160, 199, 0.10); border-color: rgba(151, 160, 199, 0.3); }
.badge.violet { color: var(--berry2); background: rgba(139, 92, 246, 0.14); border-color: rgba(139, 92, 246, 0.4); }

/* ---------- Stat tiles ---------- */
.stat { border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(160deg, rgba(24, 27, 58, 0.9), rgba(12, 14, 34, 0.9)); padding: 18px; position: relative; overflow: hidden; }
.stat::after { content: ""; position: absolute; top: -40%; right: -30%; width: 140px; height: 140px; background: radial-gradient(circle, rgba(139, 92, 246, 0.30), transparent 70%); }
.stat .v { font-size: 26px; font-weight: 850; letter-spacing: -0.8px; }
.stat .l { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--muted); margin-top: 5px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border-radius: 12px; border: 1px solid var(--line-soft); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--muted); padding: 11px 13px; background: rgba(9, 11, 28, 0.8); border-bottom: 1px solid var(--line-soft); }
td { padding: 11px 13px; border-bottom: 1px solid rgba(148, 163, 208, 0.08); vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(139, 92, 246, 0.05); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 12.5px; }

/* ---------- Alerts ---------- */
.alert { border-radius: 12px; padding: 12px 15px; font-size: 14px; line-height: 1.55; border: 1px solid; display: none; }
.alert.show { display: block; }
.alert.error { color: #ffd9e0; background: rgba(251, 113, 133, 0.12); border-color: rgba(251, 113, 133, 0.4); }
.alert.ok { color: #d6fff1; background: rgba(52, 211, 153, 0.10); border-color: rgba(52, 211, 153, 0.38); }
.alert.info { color: #d8fbff; background: rgba(34, 211, 238, 0.09); border-color: rgba(34, 211, 238, 0.35); }
.alert.warn { color: #fff3d4; background: rgba(251, 191, 36, 0.10); border-color: rgba(251, 191, 36, 0.38); }

/* ---------- Tabs / panel nav ---------- */
.panel-layout { display: grid; grid-template-columns: 232px 1fr; gap: 22px; align-items: start; }
@media (max-width: 900px) { .panel-layout { grid-template-columns: 1fr; } }
.side { position: sticky; top: 86px; display: flex; flex-direction: column; gap: 6px; }
.side a {
  display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 12px;
  color: var(--muted); font-weight: 650; font-size: 14.5px; border: 1px solid transparent;
}
.side a:hover { color: var(--text); background: rgba(139, 92, 246, 0.08); text-decoration: none; }
.side a.active { color: #fff; background: linear-gradient(135deg, rgba(109, 92, 255, 0.35), rgba(139, 92, 246, 0.18)); border-color: var(--line); box-shadow: 0 6px 22px rgba(109, 92, 255, 0.22); }
.section { display: none; }
.section.active { display: block; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- Hero ---------- */
.hero { padding: 74px 0 40px; text-align: center; }
.hero .lead { max-width: 720px; margin: 20px auto 0; }
.hero-cta { display: flex; gap: 14px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.float-chip {
  display: inline-flex; gap: 8px; align-items: center;
  background: rgba(139, 92, 246, 0.12); border: 1px solid var(--line);
  border-radius: 999px; padding: 7px 15px; font-size: 12.5px; font-weight: 700; color: #cfd6ff;
  letter-spacing: .4px;
}
.step { text-align: left; padding: 22px; }
.step .n { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 850; background: linear-gradient(135deg, var(--berry), var(--cyan)); color: #07081a; margin-bottom: 14px; }
.feat { padding: 22px; }
.feat .ico { font-size: 22px; margin-bottom: 10px; }
.marquee { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }

/* ---------- Auth ---------- */
.auth-wrap { display: grid; place-items: center; padding: 46px 0; }
.auth-card { width: min(880px, 100%); display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
@media (max-width: 860px) { .auth-card { grid-template-columns: 1fr; } }
.auth-side { padding: 30px; background: linear-gradient(160deg, rgba(109, 92, 255, 0.28), rgba(34, 211, 238, 0.08)); border-right: 1px solid var(--line); }
.auth-form { padding: 30px; }
.seg { display: flex; background: rgba(8, 10, 26, 0.8); border: 1px solid var(--line-soft); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.seg button { flex: 1; padding: 10px; border: 0; background: transparent; color: var(--muted); font-weight: 750; font-size: 14px; border-radius: 9px; cursor: pointer; font-family: var(--font); }
.seg button.on { background: linear-gradient(135deg, var(--berry), var(--berry2)); color: #fff; box-shadow: 0 6px 18px rgba(109, 92, 255, 0.4); }
.pane { display: none; }
.pane.on { display: block; animation: fadeIn .2s ease; }
.checklist { list-style: none; display: grid; gap: 12px; margin-top: 18px; }
.checklist li { display: flex; gap: 10px; font-size: 14.5px; color: #d6dcff; line-height: 1.5; }
.checklist li::before { content: "◆"; color: var(--cyan); }

/* ---------- Misc ---------- */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.sep { height: 1px; background: var(--line-soft); margin: 16px 0; }
.copy-wrap { position: relative; }
.copy-btn { position: absolute; right: 8px; top: 8px; }
.pill { font-size: 12px; font-weight: 750; padding: 4px 10px; border-radius: 999px; background: rgba(34, 211, 238, 0.10); border: 1px solid rgba(34, 211, 238, 0.3); color: var(--cyan); }
.token-gate { min-height: 70vh; display: grid; place-items: center; }
.token-box { width: min(460px, 100%); }
.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 26px 0 34px; border-top: 1px solid var(--line-soft); margin-top: 40px; }
.empty { text-align: center; color: var(--muted); padding: 26px 10px; font-size: 14px; }
.spin { display: inline-block; width: 15px; height: 15px; border: 2px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: sp .7s linear infinite; }
@keyframes sp { to { transform: rotate(360deg); } }

/* ---------- Merchant detail drawer (super admin) ---------- */
.detail-overlay { position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px 32px; overflow-y: auto; }
.detail-backdrop { position: fixed; inset: 0; background: rgba(4, 6, 18, 0.72); backdrop-filter: blur(6px); }
.detail-card { position: relative; width: min(920px, 100%); background: linear-gradient(160deg, rgba(22, 25, 56, 0.98), rgba(11, 13, 32, 0.98)); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55); padding: 20px; animation: fadeIn .18s ease; }
.detail-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.dtabs { display: flex; gap: 6px; background: rgba(8, 10, 26, 0.8); border: 1px solid var(--line-soft); border-radius: 12px; padding: 4px; margin-bottom: 16px; flex-wrap: wrap; }
.dtab { flex: 1; min-width: 110px; padding: 9px 10px; border: 0; background: transparent; color: var(--muted); font-weight: 750; font-size: 13.5px; border-radius: 9px; cursor: pointer; font-family: var(--font); }
.dtab.active { background: linear-gradient(135deg, var(--berry), var(--berry2)); color: #fff; box-shadow: 0 6px 18px rgba(109, 92, 255, 0.35); }
.detail-body { max-height: 64vh; overflow-y: auto; }
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
@media (max-width: 720px) { .kv { grid-template-columns: 1fr; } }
.kv .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); margin-bottom: 4px; }
.kv .v { font-size: 14.5px; word-break: break-word; }
.kv .cell { border: 1px solid var(--line-soft); background: rgba(10, 12, 30, 0.6); border-radius: 12px; padding: 11px 13px; }
.kv .cell.full { grid-column: 1 / -1; }
.link-btn { background: none; border: 0; padding: 0; color: var(--cyan); font: inherit; font-weight: 800; cursor: pointer; text-align: left; }
.link-btn:hover { text-decoration: underline; }
