:root {
  --green: #0a9d2b;
  --green-d: #07831f;
  --green-l: #e8f8ec;
  --ink: #10141f;
  --bg: #f4f6f8;
  --card: #ffffff;
  --line: #e7ebef;
  --muted: #7a8694;
  --red: #ef4444;
  --purple: #8b5cf6;
  --radius: 16px;
  --shadow: 0 8px 30px rgba(16, 20, 31, 0.08);
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, "Hind Siliguri", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  padding-bottom: 78px;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 14px; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  background: #fff; padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 12px rgba(16,20,31,.06);
}
.iconbtn {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--green); color: #fff; border: none;
  display: grid; place-items: center; font-size: 20px; cursor: pointer;
  box-shadow: 0 4px 14px rgba(10,157,43,.4); transition: transform .15s;
}
.iconbtn:active { transform: scale(.92); }
.brand-pill {
  background: var(--green); color: #fff; font-weight: 800; letter-spacing: 1px;
  padding: 11px 26px; border-radius: 30px; font-size: 18px;
  box-shadow: 0 4px 14px rgba(10,157,43,.4);
}

.hero {
  margin: 14px 0; border-radius: var(--radius); overflow: hidden;
  position: relative; box-shadow: var(--shadow);
  background: linear-gradient(120deg, #0b3d16, #0a9d2b);
  min-height: 150px; display: grid; place-items: center; color: #fff; text-align: center;
}
.hero h2 { font-size: 30px; text-shadow: 0 2px 0 rgba(0,0,0,.3); padding: 18px; }
.trust { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 11px; padding: 0 0 16px; opacity: .92; }
.trust span { display: flex; align-items: center; gap: 5px; }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 6px 0 12px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.chip {
  white-space: nowrap; padding: 9px 18px; border-radius: 30px; border: 1px solid var(--line);
  background: #fff; font-weight: 600; font-size: 13px; cursor: pointer; transition: .15s;
}
.chip.active { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 4px 12px rgba(10,157,43,.35); }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.product {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; cursor: pointer;
  display: flex; flex-direction: column; animation: pop .35s ease both;
}
.product:active { transform: scale(.97); }
.product:hover { transform: translateY(-4px); box-shadow: 0 14px 36px rgba(16,20,31,.16); }
.product .thumb { aspect-ratio: 1/1; background: #0b0f17 center/cover; position: relative; }
.product .thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent, rgba(0,0,0,.25)); }
.product .body { padding: 10px; text-align: center; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product h3 { font-size: 13px; line-height: 1.3; min-height: 34px; display: flex; align-items: center; justify-content: center; }
.product .price { color: var(--green); font-weight: 800; font-size: 18px; }
.btn {
  border: none; border-radius: 10px; padding: 11px 12px; font-weight: 700; font-size: 13px;
  cursor: pointer; transition: .15s; display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
}
.btn:active { transform: scale(.96); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover { background: var(--green-d); }
.btn-red { background: var(--red); color: #fff; }
.btn-purple { background: var(--purple); color: #fff; }
.btn-ghost { background: #fff; color: var(--green); border: 1.5px solid var(--green); }
.btn-dark { background: var(--ink); color: #fff; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn-sm { padding: 8px 10px; font-size: 12px; }
.btn-block { width: 100%; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 14px 0; }
.card h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.muted { color: var(--muted); font-size: 13px; }
.divider { height: 1px; background: var(--line); margin: 14px 0; }

.balance-card { background: linear-gradient(120deg, #0b3d16, #0a9d2b); color: #fff; }
.balance-card .amt { font-size: 34px; font-weight: 800; }
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; text-align: center; }
.stat .n { font-size: 26px; font-weight: 800; color: var(--green); }
.stat .l { font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; margin-top: 4px; }

.field { margin: 10px 0; }
.field label { font-size: 12px; font-weight: 600; color: var(--muted); display: block; margin-bottom: 6px; }
.input, select, textarea {
  width: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px;
  font-size: 15px; background: #fff; font-family: inherit; transition: border .15s;
}
.input:focus, select:focus, textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-l); }
.copybox { display: flex; gap: 8px; }
.copybox .input { background: #f7f9fb; font-size: 13px; }

.pkg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pkg-item {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 13px;
  display: flex; justify-content: space-between; cursor: pointer; transition: .15s; background: #fff; font-size: 14px;
}
.pkg-item.sel { border-color: var(--green); background: var(--green-l); box-shadow: 0 4px 12px rgba(10,157,43,.2); }
.pkg-item .p { color: var(--green); font-weight: 800; }

.pay-methods { display: grid; gap: 10px; }
.pay-opt { border: 1.5px solid var(--line); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; font-weight: 600; transition: .15s; }
.pay-opt.sel { border-color: var(--green); background: var(--green-l); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.qty button { width: 38px; height: 38px; border: none; background: #f4f6f8; font-size: 18px; cursor: pointer; }
.qty span { width: 46px; text-align: center; font-weight: 700; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: #fff;
  display: flex; justify-content: space-around; padding: 9px 4px 11px;
  box-shadow: 0 -2px 16px rgba(16,20,31,.08); max-width: 720px; margin: 0 auto;
}
.bottomnav a { display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 11px; color: var(--muted); font-weight: 600; }
.bottomnav a.active { color: var(--green); }
.bottomnav svg { width: 22px; height: 22px; }

.footer { background: var(--green); color: #fff; text-align: center; padding: 22px 14px; font-size: 13px; margin-top: 20px; }

.empty { text-align: center; padding: 30px 14px; }
.empty h3 { font-size: 20px; margin-bottom: 12px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 700; }
.b-pending { background: #fef3c7; color: #92400e; }
.b-completed { background: #d1fae5; color: #065f46; }
.b-processing { background: #dbeafe; color: #1e40af; }
.b-cancelled { background: #fee2e2; color: #991b1b; }
.b-bonus { background: #ffedd5; color: #9a3412; }

.toast { position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 30px; font-size: 14px; z-index: 200; box-shadow: var(--shadow); opacity: 0; transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; bottom: 100px; }
.toast.err { background: var(--red); }

.spinner { width: 36px; height: 36px; border: 3px solid var(--green-l); border-top-color: var(--green); border-radius: 50%; animation: spin .7s linear infinite; margin: 30px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.modal-bg { position: fixed; inset: 0; background: rgba(16,20,31,.6); display: none; align-items: center; justify-content: center; z-index: 100; padding: 16px; }
.modal-bg.open { display: flex; }
.modal { background: #fff; border-radius: 18px; width: 100%; max-width: 440px; max-height: 88vh; overflow-y: auto; padding: 20px; }
.modal h2 { margin-bottom: 14px; }

.admin-shell { display: flex; min-height: 100vh; }
.admin-side { width: 220px; background: var(--ink); color: #fff; padding: 18px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.admin-side .logo { padding: 0 18px 18px; font-weight: 800; font-size: 16px; color: var(--green); border-bottom: 1px solid #222a3a; margin-bottom: 10px; }
.admin-side a { display: block; padding: 12px 18px; font-size: 14px; color: #aeb7c4; cursor: pointer; border-left: 3px solid transparent; }
.admin-side a.active, .admin-side a:hover { background: #1a2230; color: #fff; border-left-color: var(--green); }
.admin-main { flex: 1; padding: 22px; max-width: 100%; overflow-x: hidden; }
.admin-main h1 { font-size: 22px; margin-bottom: 16px; }
.table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); font-size: 13px; }
.table th, .table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { background: #f4f6f8; font-size: 11px; text-transform: uppercase; color: var(--muted); }
.table tr:last-child td { border-bottom: none; }
.adstat { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
@media (max-width: 640px) {
  .admin-side { position: fixed; left: -220px; transition: left .25s; z-index: 80; }
  .admin-side.open { left: 0; }
  .admin-main { padding: 14px; }
  .table { font-size: 11px; }
  .table th, .table td { padding: 8px 6px; }
}
