:root {
  --ink: #142033;
  --muted: #607084;
  --line: #d9e2ec;
  --blue: #1769d4;
  --blue-dark: #0b3d91;
  --purple: #6a45e0;
  --teal: #0d9b88;
  --ok: #1b9a55;
  --danger: #c0392b;
  --card: #ffffff;
  --shadow: 0 14px 40px rgba(20, 40, 70, 0.1);
  --radius: 16px;
  --max: 1240px;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Inter, system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% 0%, #cfe4ff 0%, transparent 55%),
    radial-gradient(700px 380px at 100% 0%, #d7f2ea 0%, transparent 50%),
    linear-gradient(180deg, #eaf2f9, #f5f8fc 40%, #f7f9fc);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }
.container { width: min(var(--max), calc(100% - 32px)); margin: 0 auto; }

/* Logos — official PNGs from NPCI kit */
.logo-zepay { height: 34px; width: auto; }
.bc-logo { object-fit: contain; display: block; }
.bc-logo--connect { height: 52px; width: auto; max-width: 200px; }
.bc-logo--assured { height: 72px; width: auto; max-width: 88px; }
.bc-logo--sm.bc-logo--connect { height: 42px; max-width: 170px; }
.bc-logo--sm.bc-logo--assured { height: 56px; max-width: 68px; }
.bc-logo--lg.bc-logo--assured { height: 88px; max-width: 100px; }
.b-mnemonic-img {
  width: 110px; height: 110px; object-fit: contain;
  filter: drop-shadow(0 10px 22px rgba(26, 90, 180, .28));
}

/* Topbar — PDF style */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.topbar-inner {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  min-height: 68px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
}
.nav {
  display: flex; justify-content: center; align-items: center; gap: 4px; flex-wrap: wrap;
}
.nav a {
  color: var(--muted); font-weight: 600; font-size: 13px;
  padding: 8px 11px; border-radius: 999px; white-space: nowrap;
}
.nav a.active, .nav a:hover { color: var(--blue); background: #eef4ff; }
.top-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef4ff; color: var(--blue); border-radius: 999px;
  padding: 6px 10px; font-size: 11px; font-weight: 700; text-transform: uppercase;
}
.wallet-chip { background: #fff; border: 1px solid var(--line); color: var(--ink); text-transform: none; font-size: 13px; }
.avatar {
  width: 36px; height: 36px; border-radius: 50%; background: #e8eef8;
  display: grid; place-items: center; color: var(--blue-dark); font-weight: 700; font-size: 13px;
  border: 1px solid var(--line);
}
.btn, .btn-primary, .btn-ghost, .btn-purple, .btn-teal {
  border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 700; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-purple { background: var(--purple); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; width: 100%; }
.btn-ghost { background: #fff; border: 1px solid var(--line); color: var(--ink); }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-link { background: none; border: 0; color: var(--blue); font-weight: 700; padding: 0; cursor: pointer; }

/* Layout */
.page { padding: 22px 0 40px; }
.dash {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.side, .panel, .service-card {
  background: var(--card);
  border: 1px solid rgba(255,255,255,.8);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.side { padding: 16px; position: sticky; top: 88px; }
.crumb { color: var(--muted); font-size: 12px; margin-bottom: 12px; font-weight: 500; }
.kyc {
  background: #e8f8ee; color: #146c2e; border-radius: 12px;
  padding: 11px 12px; font-weight: 600; font-size: 12.5px; line-height: 1.4;
  display: flex; gap: 8px; align-items: flex-start;
}
.kyc::before { content: "✓"; font-weight: 800; }
.side-stat { margin: 14px 0; padding: 10px 0; border-top: 1px solid #eef2f6; }
.side-stat label { display: block; color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.side-stat strong { font-size: 1.35rem; }
.side-stat .deposit { color: var(--danger); }
.side-stat .earn { color: var(--ok); }
.most-used { margin-top: 8px; }
.most-used h4 { margin: 0 0 10px; font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.most-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.most-grid a, .most-grid span {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px 8px;
  text-align: center; font-size: 11px; font-weight: 700; color: var(--ink); background: #f7fafc;
  display: grid; gap: 6px; place-items: center;
}
.most-grid .cat-ico { color: var(--blue); }

.main-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}
.service-card {
  grid-column: span 4;
  padding: 18px;
  min-height: 190px;
  display: flex; flex-direction: column;
  color: inherit;
}
.service-card.hero { grid-column: span 8; background: linear-gradient(155deg, #fff 35%, #eaf2ff); }
.service-card h2 {
  margin: 0 0 6px;
  font-weight: 700;
  font-size: clamp(1.1rem, 1.8vw, 1.35rem);
  letter-spacing: -0.02em;
}
.service-card p { margin: 0 0 14px; color: var(--muted); line-height: 1.45; flex: 1; font-size: 13.5px; }
.service-card .ico-wrap {
  width: 48px; height: 48px; border-radius: 14px; background: #eef4ff; color: var(--blue);
  display: grid; place-items: center; margin-bottom: 12px;
}

/* Categories — dense PDF grid */
.center-stage { display: grid; place-items: start center; }
.panel { padding: 20px; width: 100%; }
.panel.narrow { width: min(720px, 100%); }
.panel.wide { width: min(1140px, 100%); }
.panel-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 16px; margin-bottom: 16px;
}
.panel-head h1 { margin: 0; font-size: clamp(1.15rem, 2vw, 1.4rem); letter-spacing: -.02em; }
.muted { color: var(--muted); margin: 4px 0 0; font-size: 13px; }
.panel-foot {
  display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 10px;
  margin-top: 18px; align-items: center;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.cat-card {
  border: 1px solid var(--line); background: #fbfcfe; border-radius: 12px;
  padding: 12px; min-height: 132px; display: flex; flex-direction: column; gap: 6px;
  color: inherit; transition: transform .15s ease, border-color .15s, box-shadow .15s;
}
.cat-card:hover { transform: translateY(-2px); border-color: #9ec0ef; box-shadow: 0 8px 20px rgba(23,105,212,.08); }
.cat-ico { color: #1f4f8f; display: inline-flex; }
.cat-card strong { font-size: 13px; line-height: 1.25; letter-spacing: -.01em; }
.cat-card .desc { color: var(--muted); font-size: 11.5px; line-height: 1.35; flex: 1; }
.cat-card em { margin-top: auto; font-style: normal; color: var(--blue); font-weight: 700; font-size: 12.5px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; color: var(--ink); background: #fff;
}
textarea { min-height: 96px; resize: vertical; }

.fetch-box, .pay-box { text-align: center; }
.check {
  width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%;
  background: #e7f8ee; color: var(--ok); display: grid; place-items: center;
  font-size: 1.4rem; font-weight: 800;
}
.kv {
  text-align: left; margin-top: 16px; background: #f3f5f8; border-radius: 14px; padding: 8px 16px;
}
.kv .row {
  display: grid; grid-template-columns: 1fr auto; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #e5ebf1; align-items: center;
}
.kv .row:last-child { border-bottom: 0; }
.kv span { color: var(--muted); font-size: 13px; }
.kv strong { font-size: 14px; text-align: right; word-break: break-word; }

.filters {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 10px;
  margin-bottom: 14px; padding: 12px; background: #f7fafc; border: 1px solid var(--line); border-radius: 12px;
}
.filters .full { grid-column: 1 / -1; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; min-width: 860px; font-size: 12.5px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-size: 11px; letter-spacing: .04em; }
.badge {
  display: inline-block; background: #e7f8ee; color: var(--ok);
  padding: 4px 10px; border-radius: 999px; font-weight: 800; font-size: 11px;
}

.receipt-grid {
  display: grid; grid-template-columns: 1.4fr .9fr; gap: 16px; align-items: start;
}
.receipt-side {
  background: #f7fafc; border: 1px solid var(--line); border-radius: 14px; padding: 14px;
}
.receipt-side h3 { margin: 0 0 10px; font-size: 13px; }

.alert { border-radius: 12px; padding: 12px 14px; margin: 12px 0; font-weight: 600; font-size: 13px; }
.alert-ok { background: #e8f8ee; color: #146c2e; }
.alert-err { background: #fdecea; color: #b42318; }

.login-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(420px, 100%); background: var(--card); border-radius: 20px;
  padding: 28px; box-shadow: var(--shadow); display: grid; gap: 12px;
}
.login-card h1 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
.hint { font-size: 12px; color: var(--muted); margin: 0; }

.admin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.stat-card { background: #f7fafc; border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat-card span { display: block; color: var(--muted); font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.stat-card strong { font-size: 1.35rem; }

.sms-wrap { display: grid; gap: 14px; max-width: 520px; }
.sms-bubble {
  background: #e9ecef; border-radius: 18px; padding: 16px 18px;
  color: #222; line-height: 1.45; font-size: 14px; box-shadow: inset 0 0 0 1px #d8dde3;
}
.ticket-hero {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0; min-height: 420px;
  border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); background: #fff;
}
.ticket-art {
  background: linear-gradient(160deg, #0d9b88, #0b6e62);
  display: grid; place-items: center; color: #fff; padding: 28px; text-align: center;
}
.ticket-form { padding: 32px; display: grid; gap: 12px; align-content: center; }

.site-footer {
  width: min(var(--max), calc(100% - 32px)); margin: 8px auto 0;
  display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px;
}

.menu-toggle {
  display: none; border: 1px solid var(--line); background: #fff;
  border-radius: 10px; width: 42px; height: 42px; font-size: 18px;
}

@media (max-width: 1100px) {
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .dash { grid-template-columns: 1fr; }
  .side { position: static; }
  .service-card, .service-card.hero { grid-column: span 6; }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .filters { grid-template-columns: 1fr 1fr; }
  .receipt-grid, .ticket-hero { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar-inner { grid-template-columns: auto auto 1fr; min-height: 58px; }
  .menu-toggle { display: inline-grid; place-items: center; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 58px;
    background: #fff; border-bottom: 1px solid var(--line);
    padding: 12px; flex-direction: column; align-items: stretch;
  }
  .nav.open { display: flex; }
  .top-actions .chip:not(.wallet-chip) { display: none; }
  .service-card, .service-card.hero { grid-column: span 12; min-height: 0; }
  .form-grid, .filters { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .panel-head { flex-wrap: wrap; }
  .panel-head .bc-logo { margin-left: auto; }
  .container, .topbar-inner, .site-footer { width: calc(100% - 20px); }
}
@media print {
  .topbar, .panel-foot, .side, .site-footer, .filters { display: none !important; }
  body { background: #fff; }
  .panel { box-shadow: none; border: 0; }
}
