:root {
  --teal-900: #0d2d4a;
  --teal-700: #16426b;
  --teal-500: #2f6ea3;
  --teal-100: #dbe7f3;
  --teal-50: #f1f5fa;
  --coral: #c9962e;
  --gold: #c9962e;
  --gold-dark: #9c7118;
  --ink: #0f1f2e;
  --ink-2: #3f5064;
  --ink-3: #74859a;
  --line: #dfe5ee;
  --bg: #f4f6f9;
  --card: #ffffff;
  --danger: #d6453d;
  --ok: #1d9a6c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(13, 45, 74, 0.06), 0 8px 24px -12px rgba(13, 45, 74, 0.25);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--teal-700); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -0.01em; }
h1 { font-size: 2rem; } h2 { font-size: 1.4rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.mono { font-family: var(--mono); letter-spacing: .04em; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; }
.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* brand */
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.25rem; letter-spacing: .06em; color: var(--teal-900); }
.brand img, .brand svg { width: 34px; height: 34px; }
.brand .dot { color: var(--coral); }

/* layout */
.container { max-width: 1140px; margin: 0 auto; padding: 0 20px; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; }
.topbar nav a:hover, .topbar nav a.active { background: var(--teal-50); color: var(--teal-700); text-decoration: none; }
main.page { padding: 28px 0 60px; }

/* cards */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h2, .card h3 { margin-bottom: 14px; }
.stat { padding: 18px 20px; }
.stat .label { color: var(--ink-3); font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.stat .value { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 4px; }
.stat .sub { color: var(--ink-3); font-size: .85rem; }

.balance-card { background: linear-gradient(135deg, var(--teal-900), var(--teal-700) 55%, #1f5a8c); color: #fff; border: none; position: relative; overflow: hidden; }
.balance-card::after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.07); }
.balance-card .label { color: rgba(255,255,255,.75); text-transform: uppercase; font-size: .75rem; letter-spacing: .1em; font-weight: 600; }
.balance-card .amount { font-size: 2.8rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin: 6px 0 2px; }
.balance-card .amount .sym { color: var(--gold); font-size: 1.6rem; vertical-align: 10px; margin-right: 4px; }
.balance-card .acct { font-family: var(--mono); letter-spacing: .12em; color: rgba(255,255,255,.9); font-size: 1.05rem; }
.balance-card .holder { color: rgba(255,255,255,.75); font-size: .9rem; }

/* coupon chip */
.coupon { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; white-space: nowrap; }
.coupon .sym { color: var(--gold-dark); }
.coupon.in { color: var(--ok); }
.coupon.out { color: var(--ink); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent; font: inherit; font-weight: 600; cursor: pointer; background: var(--teal-700); color: #fff; transition: transform .05s, background .15s, box-shadow .15s; white-space: nowrap; }
.btn:hover { background: var(--teal-900); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--card); color: var(--teal-700); border-color: var(--line); }
.btn.secondary:hover { background: var(--teal-50); }
.btn.ghost { background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--teal-50); color: var(--teal-700); }
.btn.coral { background: var(--coral); }
.btn.coral:hover { background: #e2563f; }
.btn.gold { background: var(--gold); color: #fff; }
.btn.gold:hover { background: #e0a62e; }
.btn.danger { background: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: .85rem; border-radius: 8px; }
.btn.lg { padding: 14px 26px; font-size: 1.05rem; border-radius: 12px; }
.btn.block { width: 100%; }

/* forms */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field { margin-bottom: 14px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); outline: none; transition: border .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(47,110,163,.18); }
input[type="number"] { font-variant-numeric: tabular-nums; }
.input-lg { font-size: 1.5rem; font-weight: 700; padding: 14px 16px; text-align: center; letter-spacing: .04em; }
.hint { font-size: .8rem; color: var(--ink-3); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); font-weight: 600; background: var(--teal-50); }
tbody tr:hover { background: #fafcfb; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* badges */
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; background: var(--teal-100); color: var(--teal-900); }
.badge.gray { background: #eceff0; color: var(--ink-2); }
.badge.red { background: #fde4e1; color: #a52f28; }
.badge.gold { background: #fdf0cc; color: #7d5a08; }
.badge.green { background: #dcf5e9; color: #146c4b; }
.badge.coral { background: #ffe3de; color: #b43a28; }

/* alerts/toasts */
.alert { padding: 12px 14px; border-radius: 10px; font-size: .92rem; margin-bottom: 14px; border: 1px solid transparent; }
.alert.error { background: #fde4e1; color: #8e261f; border-color: #f7c6c1; }
.alert.ok { background: #dcf5e9; color: #0f5c3f; border-color: #b6e6cf; }
.alert.info { background: var(--teal-50); color: var(--teal-900); border-color: var(--teal-100); }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.25); opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; max-width: 92vw; font-weight: 500; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.error { background: var(--danger); }
#toast.ok { background: var(--ok); }

/* activity list */
.tx-list { list-style: none; margin: 0; padding: 0; }
.tx-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tx-list li:last-child { border-bottom: none; }
.tx-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; background: var(--teal-50); color: var(--teal-700); }
.tx-icon.in { background: #dcf5e9; color: var(--ok); }
.tx-icon.out { background: #fdf0cc; color: var(--gold-dark); }
.tx-icon.reversed { background: #fde4e1; color: var(--danger); }
.tx-main { flex: 1; min-width: 0; }
.tx-main .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tx-main .meta { font-size: .8rem; color: var(--ink-3); }
.tx-amt { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tx-amt.in { color: var(--ok); }

/* modal */
.modal-bg { position: fixed; inset: 0; background: rgba(13,45,74,.45); display: none; align-items: center; justify-content: center; z-index: 50; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { background: var(--card); border-radius: 18px; width: 100%; max-width: 460px; padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.35); max-height: 92vh; overflow: auto; }
.modal h3 { margin-bottom: 14px; }
.modal .actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* tabs */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: none; font: inherit; font-weight: 600; color: var(--ink-3); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.active { color: var(--teal-700); border-bottom-color: var(--teal-700); }

/* landing */
.hero { background: radial-gradient(1200px 500px at 80% -10%, rgba(201,150,46,.28), transparent 60%), linear-gradient(160deg, var(--teal-900), var(--teal-700) 70%, #1f5a8c); color: #fff; padding: 72px 0 80px; }
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; }
.hero h1 { font-size: 3rem; letter-spacing: -0.03em; margin-bottom: 14px; }
.hero h1 span { color: var(--gold); }
.hero p.lead { font-size: 1.15rem; color: rgba(255,255,255,.85); max-width: 520px; }
.hero .login-card { background: #fff; color: var(--ink); border-radius: 18px; padding: 26px; box-shadow: 0 30px 80px rgba(0,0,0,.3); }
@media (max-width: 860px) { .hero .container { grid-template-columns: 1fr; } .hero h1 { font-size: 2.2rem; } .hero { padding: 44px 0 56px; } }
.features { padding: 60px 0; }
.feature { padding: 22px; }
.feature .icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--teal-50); color: var(--teal-700); font-size: 1.4rem; margin-bottom: 12px; }
.steps { counter-reset: step; }
.step { position: relative; padding-left: 56px; margin-bottom: 20px; }
.step::before { counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--gold); color: #fff; font-weight: 800; display: grid; place-items: center; }
footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--ink-3); font-size: .85rem; }

/* wallet (mobile-first) */
body.wallet { background: #0a2238; }
.wallet-shell { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); display: flex; flex-direction: column; position: relative; }
.wallet-head { background: linear-gradient(160deg, var(--teal-900), var(--teal-700)); color: #fff; padding: 18px 20px 26px; border-radius: 0 0 28px 28px; }
.wallet-body { flex: 1; padding: 18px 16px 90px; }
.wallet-nav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; background: #fff; border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 8px 0 max(10px, env(safe-area-inset-bottom)); z-index: 30; }
.wallet-nav button { background: none; border: none; font: inherit; font-size: .7rem; font-weight: 600; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; padding: 4px 10px; }
.wallet-nav button .ic { font-size: 1.35rem; }
.wallet-nav button.active { color: var(--teal-700); }
.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: -30px; }
.quick-actions button { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 6px; font: inherit; font-weight: 600; font-size: .85rem; cursor: pointer; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--ink); }
.quick-actions button .ic { font-size: 1.4rem; }
.qr-box { background: #fff; padding: 18px; border-radius: 18px; display: inline-block; box-shadow: var(--shadow); }
.qr-box canvas, .qr-box img { display: block; }
.code-display { font-family: var(--mono); font-size: 2rem; font-weight: 700; letter-spacing: .18em; color: var(--teal-900); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.keypad button { font: inherit; font-size: 1.4rem; font-weight: 600; padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin: 14px 0; }
.pin-dots span { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--teal-700); }
.pin-dots span.on { background: var(--teal-700); }
#reader { width: 100%; border-radius: 16px; overflow: hidden; background: #000; min-height: 240px; }

/* admin sidebar layout */
.admin-layout { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: var(--teal-900); color: #fff; padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow: auto; }
.sidebar .brand { color: #fff; margin: 4px 8px 22px; }
.sidebar a { display: flex; align-items: center; gap: 10px; color: rgba(255,255,255,.8); padding: 10px 12px; border-radius: 10px; font-weight: 500; }
.sidebar a:hover, .sidebar a.active { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.sidebar .sect { font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: rgba(255,255,255,.45); margin: 18px 12px 6px; }
.admin-main { padding: 26px 30px 60px; min-width: 0; }
@media (max-width: 860px) { .admin-layout { grid-template-columns: 1fr; } .sidebar { position: static; height: auto; } .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; } .admin-main { padding: 18px; } }
.page-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 160px; }
.chart { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 10px; }
.chart .bar { flex: 1; background: var(--teal-500); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.chart .bar.pay { background: var(--gold); }
.chart .bar span { position: absolute; bottom: -18px; left: 0; right: 0; text-align: center; font-size: .6rem; color: var(--ink-3); }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: .92rem; }
.kv dt { color: var(--ink-3); } .kv dd { margin: 0; font-weight: 500; }
.clickable { cursor: pointer; }
.empty { padding: 30px; text-align: center; color: var(--ink-3); }

/* lookup dropdown */
.lookup { position: relative; }
.lookup-results { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 10; max-height: 260px; overflow: auto; }
.lookup-results div { padding: 10px 12px; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.lookup-results div:hover { background: var(--teal-50); }
.lookup-results .meta { color: var(--ink-3); font-size: .8rem; }
.recipient-chip { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--teal-50); border: 1px solid var(--teal-100); border-radius: 10px; }
.recipient-chip .av { width: 36px; height: 36px; border-radius: 50%; background: var(--teal-700); color: #fff; display: grid; place-items: center; font-weight: 700; }
.otp-input { font-family: var(--mono); font-size: 2rem; letter-spacing: .5em; text-align: center; padding: 12px; }
.summary { background: var(--teal-50); border-radius: 12px; padding: 12px 14px; font-size: .95rem; }
.summary .line { display: flex; justify-content: space-between; padding: 4px 0; }
.summary .line.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 700; }
.dev-code { background: #fff7e0; border: 1px dashed var(--gold); color: #6a4d05; padding: 8px 10px; border-radius: 8px; font-size: .85rem; margin-top: 10px; }
.phone-big { font-size: 1.35rem; font-weight: 700; letter-spacing: .04em; }
.logo-img { height: 40px; width: auto; }
.hero .logo-img { height: 120px; filter: drop-shadow(0 10px 30px rgba(0,0,0,.3)); }
