:root {
  --ink: #12201c;
  --ink-2: #3d4b47;
  --muted: #6b7a75;
  --line: #e3e8e6;
  --bg: #f4f6f5;
  --card: #ffffff;
  --brand: #0e7c66;
  --brand-dark: #0a5e4d;
  --brand-soft: #e3f3ef;
  --side: #10241f;
  --side-2: #183530;
  --side-text: #b9cbc5;
  --ok: #1f8a4c;  --ok-bg: #e5f5ec;
  --warn: #a86400; --warn-bg: #fdf1dd;
  --bad: #c0352b; --bad-bg: #fbe7e5;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 36, 31, .06), 0 4px 16px rgba(16, 36, 31, .05);
  --font: "Hind Siliguri", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15.5px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.3; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: 1.55rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
small, .small { font-size: .85rem; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* ---------- App shell ---------- */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.side { background: var(--side); color: var(--side-text); padding: 20px 14px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 1.12rem; padding: 4px 10px 18px; letter-spacing: .2px; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; background: var(--brand); display: grid; place-items: center; font-size: .8rem; font-weight: 700; color: #fff; font-family: var(--mono); }
.nav-label { text-transform: uppercase; font-size: .7rem; letter-spacing: 1px; color: #6f8b84; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; color: var(--side-text); padding: 8px 10px; border-radius: 8px; margin-bottom: 2px; font-size: .95rem; }
.nav a:hover { background: var(--side-2); color: #fff; text-decoration: none; }
.nav a.active { background: var(--brand); color: #fff; }
.nav .count { margin-left: auto; background: #f0b429; color: #3a2a00; font-size: .72rem; border-radius: 999px; padding: 0 7px; font-weight: 700; }
.nav svg { width: 18px; height: 18px; flex: none; opacity: .9; }
.side-foot { margin-top: auto; padding: 12px 10px 0; border-top: 1px solid var(--side-2); font-size: .85rem; }
.side-foot .who { color: #fff; font-weight: 600; }
.side-foot form { margin: 8px 0 0; }
.side-foot button { background: none; border: 1px solid #2e4c45; color: var(--side-text); border-radius: 8px; padding: 5px 12px; cursor: pointer; font: inherit; font-size: .85rem; }
.side-foot button:hover { color: #fff; border-color: #5a7a72; }

.main { padding: 26px 32px 60px; min-width: 0; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.topbar h1 { margin: 0; }
.mobile-bar { display: none; }

/* ---------- Cards / grid ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.grid { display: grid; gap: 16px; }
.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)); }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.stat .label { color: var(--muted); font-size: .88rem; }
.stat .value { font-size: 1.7rem; font-weight: 700; line-height: 1.25; margin-top: 2px; }
.stat .sub { color: var(--muted); font-size: .82rem; }
.stat.accent { background: linear-gradient(135deg, #0e7c66, #0b5f4f); color: #fff; border: 0; }
.stat.accent .label, .stat.accent .sub { color: #c8eee4; }

.balance { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; background: linear-gradient(135deg, #0e7c66, #0a4f42); color: #fff; border-radius: 16px; padding: 24px 26px; margin-bottom: 18px; box-shadow: var(--shadow); }
.balance .label { color: #c8eee4; font-size: .95rem; }
.balance .big { font-size: 2.6rem; font-weight: 700; line-height: 1.1; }
.balance .hint { color: #c8eee4; font-size: .88rem; margin-top: 4px; }
.balance .btn { background: #fff; color: var(--brand-dark); }
.balance .btn:hover { background: #eafaf5; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; font-size: .94rem; background: var(--brand); color: #fff; border: 1px solid transparent; border-radius: 9px; padding: 8px 16px; cursor: pointer; text-decoration: none; line-height: 1.4; white-space: nowrap; }
.btn:hover { background: var(--brand-dark); text-decoration: none; }
.btn-sm { padding: 4px 11px; font-size: .85rem; border-radius: 7px; }
.btn-lg { padding: 11px 22px; font-size: 1.02rem; }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--bg); }
.btn-danger { background: var(--bad); }
.btn-danger:hover { background: #a02a21; }
.btn-ok { background: var(--ok); }
.btn-ok:hover { background: #18703d; }
.btn-warn { background: #d18a12; }
.btn-warn:hover { background: #b07208; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline { display: inline; margin: 0; }

/* ---------- Forms ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 5px; color: var(--ink-2); }
.field .help { color: var(--muted); font-size: .82rem; margin-top: 4px; }
.field .err { color: var(--bad); font-size: .85rem; margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=url], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink); background: #fff; border: 1px solid #cfd8d5; border-radius: 9px; padding: 8px 12px; outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14, 124, 102, .15); }
textarea { resize: vertical; }
textarea.code { font-family: var(--mono); font-size: .85rem; line-height: 1.5; min-height: 460px; white-space: pre; tab-size: 2; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 17px; height: 17px; accent-color: var(--brand); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar input, .toolbar select { width: auto; min-width: 180px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; color: var(--muted); font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcfb; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.plus { color: var(--ok); font-weight: 600; }
.minus { color: var(--bad); font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 34px 10px; }

/* ---------- Badges / alerts ---------- */
.badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-bad { background: var(--bad-bg); color: var(--bad); }
.badge-muted { background: #eef1f0; color: var(--muted); }
.badge-brand { background: var(--brand-soft); color: var(--brand-dark); }

.alert { border-radius: 10px; padding: 11px 15px; margin-bottom: 14px; font-size: .94rem; border: 1px solid; }
.alert-success { background: var(--ok-bg); border-color: #bfe5cf; color: #175f36; }
.alert-error { background: var(--bad-bg); border-color: #f2c2bd; color: #8f2219; }
.alert-warn { background: var(--warn-bg); border-color: #f1d6a6; color: #7a4a00; }
.alert-info { background: var(--brand-soft); border-color: #bfe3da; color: var(--brand-dark); }

.kill-banner { background: var(--bad); color: #fff; padding: 10px 16px; border-radius: 10px; margin-bottom: 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-weight: 600; }

/* ---------- Packages ---------- */
.packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.pack { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px 20px; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.pack h3 { font-size: 1.1rem; margin-bottom: 4px; }
.pack .pts { font-size: 2rem; font-weight: 700; color: var(--brand-dark); line-height: 1.2; }
.pack .pts span { font-size: .9rem; font-weight: 500; color: var(--muted); }
.pack .price { font-size: 1.25rem; font-weight: 600; margin: 6px 0 4px; }
.pack .desc { color: var(--muted); font-size: .88rem; flex: 1; margin-bottom: 14px; }

.pay-box { border: 2px dashed #b9d9d1; background: #f6fbfa; border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.pay-box .number { font-family: var(--mono); font-size: 1.35rem; font-weight: 700; letter-spacing: 1px; }
.method-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.method-pick label { border: 2px solid var(--line); border-radius: 10px; padding: 10px 14px; cursor: pointer; display: flex; align-items: center; gap: 9px; font-weight: 600; background: #fff; }
.method-pick input { accent-color: var(--brand); }
.method-pick label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.steps { margin: 0; padding-left: 1.3em; }
.steps li { margin-bottom: 4px; }

/* ---------- Auth pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 30px 16px; background: radial-gradient(circle at 20% 10%, #dff1ec 0, transparent 45%), radial-gradient(circle at 90% 90%, #e7efe9 0, transparent 40%), var(--bg); }
.auth-card { width: 100%; max-width: 440px; }
.auth-card.wide { max-width: 640px; }
.auth-brand { display: flex; align-items: center; gap: 10px; justify-content: center; font-weight: 700; font-size: 1.3rem; margin-bottom: 18px; color: var(--ink); }
.auth-foot { text-align: center; margin-top: 14px; color: var(--muted); font-size: .92rem; }

.hero { max-width: 980px; margin: 0 auto; padding: 50px 20px 30px; text-align: center; }
.hero h1 { font-size: 2.1rem; margin-bottom: 10px; }
.hero p.lead { font-size: 1.08rem; color: var(--ink-2); max-width: 620px; margin: 0 auto 22px; }
.features { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; max-width: 980px; margin: 18px auto 30px; padding: 0 20px; text-align: left; }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.feature b { display: block; margin-bottom: 4px; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 4px 11px; border: 1px solid var(--line); border-radius: 7px; background: #fff; font-size: .9rem; }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }

details.inline-form summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: .88rem; list-style: none; }
details.inline-form summary::-webkit-details-marker { display: none; }
details.inline-form[open] summary { margin-bottom: 8px; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 14px; font-size: .93rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 500; word-break: break-word; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3, .features { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 50; transform: translateX(-100%); transition: transform .2s; }
  body.nav-open .side { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.35); }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; background: var(--side); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 40; }
  .mobile-bar button { background: none; border: 1px solid #2e4c45; color: #fff; border-radius: 8px; padding: 4px 10px; font: inherit; }
  .main { padding: 18px 16px 50px; }
  .grid-2, .grid-3, .features, .form-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .balance .big { font-size: 2.1rem; }
  .kv { grid-template-columns: 1fr; gap: 0 0; }
  .kv dd { margin-bottom: 8px; }
  .hero h1 { font-size: 1.6rem; }
}
