/* ── Bhajanlal Circle — brand tokens (shared with the Bhajanlal sister app) ── */
:root {
  --navy: #0B2775;
  --navy-deep: #071A52;
  --navy-soft: #1B3A94;
  --blue: #2156E8;
  --blue-deep: #1A44BD;
  --blue-soft: #E9EFFE;
  --green: #0E9F6E;
  --green-deep: #047857;
  --green-soft: #E3F7EE;
  --whatsapp: #1FAF55;
  --canvas: #F4F6FB;
  --canvas-warm: #EDF0F7;
  --line: #DFE4EE;
  --ink: #0F172A;
  --ink-soft: #4B5568;
  --ink-faint: #8A93A6;
  --danger: #C8323C;
  --danger-soft: #FDECEE;
  --amber: #B45309;
  --amber-soft: #FEF3C7;
  --card: #FFFFFF;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(11, 39, 117, .06), 0 8px 24px rgba(11, 39, 117, .08);
  --shadow-lg: 0 18px 40px rgba(7, 26, 82, .28);
  --font-head: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --tabbar-h: 64px;
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body); font-size: 15px; line-height: 1.45;
  background: var(--canvas); color: var(--ink); min-height: 100dvh;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 12px);
  -webkit-font-smoothing: antialiased;
}
body.no-tabs { padding-bottom: 24px; }
h1, h2, h3, .head { font-family: var(--font-head); letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 600; margin: 22px 0 10px; }
h3 { font-size: 15px; font-weight: 600; margin: 18px 0 8px; }
a { color: var(--blue); }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.hidden { display: none !important; }
.boot { padding: 40vh 24px 0; text-align: center; color: var(--ink-faint); font-family: var(--font-head); }
svg.i { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.sm { width: 18px; height: 18px; }

/* ── demo banner ── */
.demo-banner {
  position: sticky; top: 0; z-index: 40; background: #FACC15; color: #422006;
  font: 600 12px/1.3 var(--font-body); text-align: center; padding: 8px 16px;
  letter-spacing: .02em;
}

/* ── app bar ── */
.appbar {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy) 70%);
  color: #fff; padding: max(14px, env(safe-area-inset-top)) 16px 14px;
  display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 20;
}
.demo-on .appbar { top: 32px; }
.appbar img { width: 36px; height: 36px; border-radius: 50%; background: #fff1; }
.appbar .title { font-family: var(--font-head); font-weight: 600; font-size: 17px; }
.appbar .sub { font-size: 12px; opacity: .75; }
.appbar .spacer { flex: 1; }
.appbar .iconbtn { background: rgba(255,255,255,.12); color: #fff; border: 0; border-radius: 12px;
  height: 40px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
  font: 500 13px var(--font-body); cursor: pointer; }
.appbar .iconbtn:hover { background: rgba(255,255,255,.2); }

main { padding: 16px; max-width: 960px; margin: 0 auto; }

/* ── cards ── */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 12px; border: 1px solid rgba(223, 228, 238, .6);
}
.card.flat { box-shadow: none; }
.card-title { display: flex; align-items: center; gap: 8px; font: 600 15px var(--font-head); margin-bottom: 6px; }
.muted { color: var(--ink-soft); font-size: 13px; }
.faint { color: var(--ink-faint); font-size: 12px; }
.grid2 { display: grid; gap: 12px; }
@media (min-width: 760px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* ── premium member card ── */
.member-card {
  position: relative; overflow: hidden; color: #fff; border-radius: 22px;
  padding: 20px 20px 18px; margin-bottom: 14px; min-height: 200px;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(33, 86, 232, .55), transparent 60%),
    linear-gradient(140deg, var(--navy-deep) 0%, var(--navy) 55%, var(--navy-soft) 100%);
  box-shadow: var(--shadow-lg);
}
.member-card::before, .member-card::after {
  content: ""; position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,.10);
}
.member-card::before { width: 260px; height: 260px; right: -90px; bottom: -120px; }
.member-card::after { width: 180px; height: 180px; right: -40px; bottom: -70px; }
.mc-top { display: flex; align-items: center; justify-content: space-between; position: relative; z-index: 1; }
.mc-brand { display: flex; align-items: center; gap: 10px; font: 600 14px var(--font-head); letter-spacing: .06em; }
.mc-brand img { width: 30px; height: 30px; }
.tierchip { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 12px;
  font: 600 12px var(--font-head); letter-spacing: .04em; text-transform: uppercase;
  background: rgba(255,255,255,.16); color: #fff; border: 1px solid rgba(255,255,255,.28); }
.tierchip.t-plus { background: linear-gradient(135deg, #CBD5E1, #F8FAFC); color: var(--navy-deep); border: 0; }
.tierchip.t-pro { background: linear-gradient(135deg, #F5C451, #FDE68A); color: #4A3200; border: 0; }
.mc-points { position: relative; z-index: 1; margin-top: 22px; }
.mc-points .v { font: 700 44px/1 var(--font-head); letter-spacing: -.02em; }
.mc-points .l { font-size: 13px; opacity: .8; margin-top: 4px; }
.mc-foot { position: relative; z-index: 1; margin-top: 18px; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.mc-name { font: 600 16px var(--font-head); }
.mc-code { font-family: ui-monospace, monospace; font-size: 13px; letter-spacing: .14em; opacity: .85; }
.mc-since { font-size: 11px; opacity: .7; text-align: right; }

/* ── progress ── */
.progress { background: var(--canvas-warm); border-radius: 999px; height: 10px; overflow: hidden; margin-top: 10px; }
.progress > div { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--blue), var(--green)); }

/* ── stats ── */
.statgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 760px) { .statgrid { grid-template-columns: repeat(4, 1fr); } }
.stat { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.stat .v { font: 600 22px var(--font-head); color: var(--navy); }
.stat .l { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ── quick actions ── */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 0;
  padding: 16px 8px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font: 500 13px var(--font-body); color: var(--ink); cursor: pointer; }
.tile .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--blue-soft); color: var(--blue);
  display: grid; place-items: center; }

/* ── forms ── */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; font: 400 16px var(--font-body); padding: 0 14px; height: 48px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 120px; padding: 12px 14px; font-family: ui-monospace, monospace; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px rgba(33, 86, 232, .14); }
button:focus-visible, .tab:focus-visible { outline: 3px solid rgba(33, 86, 232, .4); outline-offset: 2px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0 4px; font-size: 14px; color: var(--ink); }
.check input { width: 22px; height: 22px; min-height: 22px; margin-top: 1px; flex: none; accent-color: var(--blue); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.hint { font-size: 12px; color: var(--ink-faint); margin-top: 4px; }

button { font-family: var(--font-body); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: 600 15px var(--font-body); border-radius: var(--radius-sm); padding: 0 18px; height: 48px;
  border: 0; cursor: pointer; transition: background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--blue); color: #fff; width: 100%; margin-top: 18px; }
.btn.primary:hover { background: var(--blue-deep); }
.btn.secondary { background: var(--blue-soft); color: var(--blue-deep); }
.btn.success { background: var(--green); color: #fff; }
.btn.danger { background: var(--danger-soft); color: var(--danger); }
.btn.link { background: none; color: var(--blue); height: auto; padding: 10px 0; font-weight: 500; }
.btn.sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ── lists ── */
.list .row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list .row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; }
.row .t { font-weight: 600; font-size: 14px; }
.row .s { font-size: 12px; color: var(--ink-soft); overflow-wrap: anywhere; }
.pts-pos { color: var(--green-deep); font: 600 15px var(--font-head); }
.pts-neg { color: var(--danger); font: 600 15px var(--font-head); }
.chip { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--green-soft); color: var(--green-deep); }
.chip.bad { background: var(--danger-soft); color: var(--danger); }
.chip.mid { background: var(--blue-soft); color: var(--blue-deep); }
.chip.off { background: var(--canvas-warm); color: var(--ink-soft); }
.chip.warn { background: var(--amber-soft); color: var(--amber); }

.empty { text-align: center; color: var(--ink-faint); padding: 24px 12px; font-size: 14px; }
.error-box { background: var(--danger-soft); color: var(--danger); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 12px; font-size: 14px; }
.notice { background: var(--blue-soft); color: var(--navy); border-radius: var(--radius-sm); padding: 12px 14px; margin-top: 12px; font-size: 14px; }
.notice.ok { background: var(--green-soft); color: var(--green-deep); }
.notice.warn { background: var(--amber-soft); color: var(--amber); }
.secret { font: 600 22px ui-monospace, monospace; letter-spacing: .08em; background: var(--canvas); border: 1px dashed var(--navy-soft);
  border-radius: var(--radius-sm); padding: 14px; text-align: center; margin: 12px 0; color: var(--navy-deep); user-select: all; }

/* ── segmented control ── */
.seg { display: flex; background: var(--canvas-warm); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 14px; overflow-x: auto; }
.seg button { flex: 1; border: 0; background: none; border-radius: 10px; height: 40px; padding: 0 12px;
  font: 500 14px var(--font-body); color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.seg button.active { background: #fff; color: var(--navy); box-shadow: 0 1px 3px rgba(11,39,117,.12); font-weight: 600; }
.seg.scroll button { flex: none; }

/* ── tab bar ── */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; display: flex; z-index: 30;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabbar .tab {
  flex: 1; background: none; border: 0; height: var(--tabbar-h); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px; font: 500 11px var(--font-body);
  color: var(--ink-faint); cursor: pointer;
}
.tabbar .tab.active { color: var(--blue); }
.tabbar .tab.active svg { stroke-width: 2.2; }
@media (min-width: 760px) {
  .tabbar { left: 50%; right: auto; transform: translateX(-50%); width: 560px; bottom: 16px;
    border-radius: 20px; border: 1px solid var(--line); box-shadow: var(--shadow); padding-bottom: 0; }
  body { padding-bottom: calc(var(--tabbar-h) + 40px); }
}

/* ── sheet (modal) ── */
.sheet-wrap { position: fixed; inset: 0; background: rgba(7, 26, 82, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: #fff; width: 100%; max-width: 560px; max-height: 90dvh; overflow: auto; border-radius: 22px 22px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-lg); }
@media (min-width: 760px) { .sheet-wrap { align-items: center; } .sheet { border-radius: 22px; } }
.sheet h3 { margin-top: 0; font-size: 18px; }

/* ── toast ── */
.toast { position: fixed; bottom: calc(var(--tabbar-h) + 24px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 18px; font-size: 14px; z-index: 60;
  max-width: calc(100vw - 32px); box-shadow: var(--shadow-lg); }

/* ── login ── */
.login-hero { background: linear-gradient(160deg, var(--navy-deep), var(--navy) 60%, var(--navy-soft));
  color: #fff; padding: calc(36px + env(safe-area-inset-top)) 20px 64px; text-align: center; }
.login-hero img { width: 68px; height: 68px; }
.login-hero h1 { font-size: 26px; font-weight: 700; margin-top: 12px; }
.login-hero p { font-size: 13px; opacity: .78; margin-top: 4px; }
.login-body { max-width: 440px; margin: -44px auto 0; padding: 0 16px 24px; position: relative; }
.login-body .card { padding: 20px; }
.closed { display: flex; gap: 12px; align-items: flex-start; }
.closed .ic { width: 44px; height: 44px; border-radius: 14px; background: var(--blue-soft); color: var(--blue); display: grid; place-items: center; flex: none; }

table.mini { width: 100%; border-collapse: collapse; font-size: 13px; }
table.mini th, table.mini td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
table.mini th { color: var(--ink-faint); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.scroll-x { overflow-x: auto; }
.tier-row { display: grid; grid-template-columns: 1fr 1fr 40px; gap: 8px; align-items: end; }
.tier-row label { margin-top: 8px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--font-body); border-radius: 999px; padding: 6px 12px; }
.status-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-pill.off { background: var(--canvas-warm); color: var(--ink-soft); }
.status-pill.on { background: var(--green-soft); color: var(--green-deep); }
