/* ============================================================
   AZ Credit Book — "Midnight Luxury" UI · v2
   ============================================================ */
:root {
  /* ডার্ক (মূল) */
  --bg: #07080C;
  --bg-2: #0C0D13;
  --surface: #111219;
  --surface-2: #171923;
  --glass: rgba(22, 24, 34, .62);
  --ink: #F5F6F8;
  --ink-2: #C9CCD6;
  --muted: #858A99;
  --line: rgba(255, 255, 255, .075);
  --line-2: rgba(255, 255, 255, .13);
  --accent: #8B8CFF;
  --accent-2: #5EEAD4;
  --accent-ink: #0A0A14;
  /* পুরনো নামগুলো নতুন রঙে (JS-এর inline স্টাইলের জন্য) */
  --brand: #8B8CFF;
  --brand-2: #0A0A14;
  --brand-3: #A5A6FF;
  --gold: #A5A6FF;
  --gold-2: #E4E5FF;
  --gold-3: #6E70F5;
  --got: #34D399;
  --got-bg: rgba(52, 211, 153, .12);
  --gave: #FF6B6B;
  --gave-bg: rgba(255, 107, 107, .12);
  --btn-bg: #F5F6F8;
  --btn-ink: #07080C;
  --radius: 22px;
  --radius-s: 14px;
  --shadow-1: 0 1px 0 rgba(255,255,255,.04) inset, 0 1px 2px rgba(0,0,0,.5);
  --shadow-2: 0 1px 0 rgba(255,255,255,.06) inset, 0 24px 48px -18px rgba(0,0,0,.8);
  --shadow-3: 0 40px 80px -30px rgba(0,0,0,.9);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Inter", "Hind Siliguri", "IBM Plex Sans Arabic", system-ui, sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
:root[lang="bn"] { --font: "Inter", "Hind Siliguri", system-ui, sans-serif; }
:root[lang="ar"] { --font: "IBM Plex Sans Arabic", "Inter", system-ui, sans-serif; }

/* লাইট — Stripe-এর মতো পরিষ্কার */
:root[data-theme="light"] {
  --bg: #F6F7F9; --bg-2: #EEF0F4; --surface: #FFFFFF; --surface-2: #F3F4F7; --glass: rgba(255,255,255,.72);
  --ink: #0A0B10; --ink-2: #3B3F4C; --muted: #737887; --line: rgba(10, 11, 16, .07); --line-2: rgba(10, 11, 16, .12);
  --accent: #5B5BF6; --brand: #5B5BF6; --brand-3: #7474FF; --gold: #6D6DF8; --gold-2: #EEEEFF; --gold-3: #4747E0;
  --got: #0F9F6E; --got-bg: rgba(15, 159, 110, .09); --gave: #E5484D; --gave-bg: rgba(229, 72, 77, .08);
  --btn-bg: #0A0B10; --btn-ink: #FFFFFF;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .05), 0 0 0 1px rgba(16, 24, 40, .03);
  --shadow-2: 0 1px 2px rgba(16, 24, 40, .04), 0 18px 40px -16px rgba(16, 24, 40, .18);
  --shadow-3: 0 40px 80px -30px rgba(16, 24, 40, .3);
  color-scheme: light;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font); color: var(--ink); background: var(--bg);
  font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
svg.i { width: 21px; height: 21px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.num { font-feature-settings: "tnum", "cv11"; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
::selection { background: var(--accent); color: #fff; }

/* ---------- App frame ---------- */
#app { max-width: 520px; margin: 0 auto; min-height: 100%; position: relative; background: var(--bg); isolation: isolate; }
@media (min-width: 600px) {
  body { padding: 28px 0; background:
    radial-gradient(900px 500px at 15% 0%, rgba(139,140,255,.10), transparent 60%),
    radial-gradient(800px 500px at 90% 100%, rgba(94,234,212,.07), transparent 60%), var(--bg-2); background-attachment: fixed; }
  #app { min-height: calc(100vh - 56px); border-radius: 36px; box-shadow: var(--shadow-3), 0 0 0 1px var(--line-2); overflow: hidden; }
}
.screen { min-height: 100vh; padding-bottom: calc(120px + var(--safe-b)); animation: enter .5s var(--ease); }
@media (min-width: 600px) { .screen { min-height: calc(100vh - 56px); } }
@keyframes enter { from { opacity: 0; transform: translateY(10px) scale(.995); } to { opacity: 1; transform: none; } }

/* ---------- Aurora header ---------- */
.hero-wrap { position: relative; padding-bottom: 70px; overflow: hidden; color: var(--ink); }
.hero-wrap::before {
  content: ""; position: absolute; inset: -40% -20% 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(40% 50% at 82% 18%, rgba(139,140,255,.33), transparent 70%),
    radial-gradient(35% 45% at 12% 40%, rgba(94,234,212,.16), transparent 70%),
    radial-gradient(30% 40% at 55% 0%, rgba(255,140,200,.10), transparent 70%);
  filter: blur(10px); animation: aurora 18s ease-in-out infinite alternate;
}
.hero-wrap::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(to bottom, transparent 55%, var(--bg)); }
:root[data-theme="light"] .hero-wrap::before { opacity: .55; }
@keyframes aurora { to { transform: translate3d(-4%, 3%, 0) scale(1.08); } }
.hero-wrap > * { position: relative; z-index: 1; }
.greet { padding: 18px 22px 0; }
.greet small { display: block; color: var(--muted); font-size: 13px; font-weight: 500; }
.greet b { display: block; font-size: 27px; font-weight: 700; letter-spacing: -.025em; line-height: 1.2; margin-top: 2px; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px;
  padding: calc(12px + var(--safe-t)) 16px 12px; background: color-mix(in srgb, var(--bg) 70%, transparent);
  backdrop-filter: saturate(1.6) blur(20px); -webkit-backdrop-filter: saturate(1.6) blur(20px);
}
.topbar h1 { font-size: 17px; margin: 0; font-weight: 650; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.topbar.dark { background: transparent; position: relative; backdrop-filter: none; -webkit-backdrop-filter: none; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); display: grid; text-decoration: none; place-items: center; cursor: pointer; flex: none;
  background: var(--glass); color: var(--ink); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); transition: transform .2s var(--ease), background .2s;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.92); }
[dir="rtl"] .flip { transform: scaleX(-1); }

/* ---------- Book switcher ---------- */
.book-switch { display: flex; align-items: center; gap: 11px; flex: 1; min-width: 0; border: 0; background: transparent; cursor: pointer; padding: 0; text-align: start; color: var(--ink); }
.book-switch .logo {
  width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 16px; color: var(--ink);
  background: linear-gradient(145deg, var(--surface-2), var(--surface)); border: 1px solid var(--line-2); box-shadow: var(--shadow-1);
}
.book-switch b { display: block; font-size: 15.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.book-switch small { color: var(--muted); font-size: 12px; display: flex; align-items: center; gap: 3px; }
.book-switch small svg { width: 14px; height: 14px; }

/* ---------- Metal balance card ---------- */
.hero-card, .bal-card {
  position: relative; z-index: 5; overflow: hidden; color: #F5F6F8;
  background:
    radial-gradient(120% 90% at 100% 0%, rgba(139,140,255,.35), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgba(94,234,212,.16), transparent 60%),
    linear-gradient(155deg, #2A2C37 0%, #15161D 45%, #0B0C10 100%);
  border: 1px solid rgba(255,255,255,.1);
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 30px 60px -25px rgba(0,0,0,.85), 0 0 0 1px rgba(0,0,0,.4);
}
.hero-card::before, .bal-card::before { /* ধাতব ঝলক */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background: linear-gradient(115deg, transparent 30%, rgba(255,255,255,.08) 45%, transparent 55%);
  background-size: 250% 100%; animation: sheen 7s ease-in-out infinite;
}
.hero-card::after, .bal-card::after { /* সূক্ষ্ম grain */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .18; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}
@keyframes sheen { 0%, 60% { background-position: 120% 0; } 100% { background-position: -120% 0; } }
.hero-card > *, .bal-card > * { position: relative; z-index: 1; }
.hero-card {
  margin: -46px 16px 0; border-radius: 26px; display: grid; grid-template-columns: 1fr 1fr; padding: 22px 22px 0; gap: 0 14px;
}
.hero-card .cell { padding: 0 0 18px; min-width: 0; }
.hero-card .cell + .cell { padding-inline-start: 16px; border-inline-start: 1px solid rgba(255,255,255,.09); }
.hero-card label { font-size: 11.5px; color: rgba(245,246,248,.6); display: flex; align-items: center; gap: 7px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
:root[lang="bn"] .hero-card label, :root[lang="ar"] .hero-card label { text-transform: none; letter-spacing: 0; font-size: 13px; }
.hero-card label i { width: 6px; height: 6px; border-radius: 50%; display: inline-block; box-shadow: 0 0 10px currentColor; }
.hero-card .amt { font-size: 25px; font-weight: 700; margin-top: 6px; letter-spacing: -.03em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-card .amt + .amt { font-size: 14px; font-weight: 600; opacity: .75; margin-top: 3px; }
.hero-card .foot { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; padding: 13px 0 14px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12.5px; color: rgba(245,246,248,.6); }
.hero-card .foot svg { width: 15px; height: 15px; vertical-align: -3px; }
.hero-card .foot b { color: #fff; }
.hero-card .foot a { color: #fff; font-weight: 600; text-decoration: none; display: flex; align-items: center; gap: 2px; }
.hero-card .foot a svg { width: 16px; height: 16px; }
.hero-card .c-got, .bal-card .c-got { color: #5BF0B5; }
.hero-card .c-gave, .bal-card .c-gave { color: #FF8A8A; }
.c-got { color: var(--got); } .c-gave { color: var(--gave); }

/* ---------- Search / chips ---------- */
.toolbar { padding: 20px 16px 4px; display: flex; flex-direction: column; gap: 12px; }
.search {
  display: flex; align-items: center; gap: 10px; background: var(--surface); border-radius: 14px; padding: 0 14px; height: 46px;
  border: 1px solid var(--line); color: var(--muted); transition: border-color .2s, box-shadow .2s;
}
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.search svg { width: 18px; height: 18px; }
.search input { border: 0; outline: 0; background: transparent; flex: 1; height: 100%; color: var(--ink); min-width: 0; }
.search input::placeholder { color: var(--muted); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line); background: transparent; color: var(--ink-2); border-radius: 999px; padding: 6px 13px; white-space: nowrap;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all .25s var(--ease); display: flex; gap: 6px; align-items: center;
}
.chip .n { font-size: 11px; color: var(--muted); font-weight: 600; }
.chip.on { background: var(--btn-bg); color: var(--btn-ink); border-color: var(--btn-bg); }
.chip.on .n { color: inherit; opacity: .6; }

/* ---------- Lists ---------- */
.list { margin: 8px 16px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow-1); }
.row { display: flex; align-items: center; gap: 13px; padding: 14px 16px; cursor: pointer; transition: background .2s; text-decoration: none; position: relative; }
.row + .row::before { content: ""; position: absolute; top: 0; inset-inline: 70px 0; border-top: 1px solid var(--line); }
.row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.row:active { background: var(--surface-2); }
.row .meta { flex: 1; min-width: 0; }
.row .meta b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.005em; }
.row .meta small { color: var(--muted); font-size: 12.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { text-align: end; flex: none; }
.row .end b { display: block; font-weight: 650; }
.row .end small { font-size: 11.5px; color: var(--muted); }
.avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 650; font-size: 14.5px; letter-spacing: .02em;
  color: hsl(var(--h,240) 80% 88%);
  background: radial-gradient(120% 120% at 30% 20%, hsl(var(--h,240) 45% 34%), hsl(calc(var(--h,240) + 30) 40% 16%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 0 0 1px rgba(255,255,255,.06);
}
:root[data-theme="light"] .avatar { color: hsl(var(--h,240) 55% 32%); background: hsl(var(--h,240) 70% 93%); box-shadow: none; }
.section-title { padding: 20px 22px 6px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; display: flex; justify-content: space-between; align-items: center; }
:root[lang="bn"] .section-title, :root[lang="ar"] .section-title { text-transform: none; letter-spacing: 0; font-size: 13px; }
.empty { text-align: center; padding: 48px 32px; color: var(--muted); }
.empty .art { width: 84px; height: 84px; margin: 0 auto 16px; border-radius: 26px; display: grid; place-items: center; color: var(--accent);
  background: radial-gradient(100% 100% at 30% 0%, color-mix(in srgb, var(--accent) 22%, transparent), var(--surface)); border: 1px solid var(--line-2); }
.empty .art svg { width: 36px; height: 36px; }
.empty b { color: var(--ink); display: block; font-size: 17px; margin-bottom: 4px; letter-spacing: -.01em; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; bottom: calc(12px + var(--safe-b)); left: 50%; transform: translateX(-50%); z-index: 40;
  display: flex; gap: 4px; padding: 6px; border-radius: 26px; width: min(360px, calc(100% - 32px));
  background: var(--glass); border: 1px solid var(--line-2); backdrop-filter: saturate(1.8) blur(24px); -webkit-backdrop-filter: saturate(1.8) blur(24px);
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.6);
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px 7px; border-radius: 20px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600; transition: all .3s var(--ease); }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--ink); background: color-mix(in srgb, var(--ink) 9%, transparent); }
.tabbar a.add { flex: none; width: 58px; justify-content: center; color: var(--btn-ink); background: var(--btn-bg); border-radius: 20px; }
.tabbar a.add svg { width: 26px; height: 26px; stroke-width: 2.2; }
.fab { display: none; }

/* ---------- Bottom actions (party) ---------- */
.bottom-actions {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 30;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 14px 16px calc(16px + var(--safe-b));
  background: linear-gradient(to top, var(--bg) 62%, transparent);
}
.big-btn {
  height: 60px; border-radius: 20px; border: 1px solid transparent; cursor: pointer; font-weight: 700; font-size: 16.5px; letter-spacing: -.01em;
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; transition: transform .2s var(--ease), filter .2s;
}
.big-btn small { font-size: 11px; font-weight: 500; opacity: .75; }
.big-btn:active { transform: scale(.97); }
.big-btn.gave { color: #fff; background: linear-gradient(180deg, #FF7A7A, #E5484D); box-shadow: 0 1px 0 rgba(255,255,255,.25) inset, 0 14px 30px -14px rgba(229,72,77,.9); }
.big-btn.got { color: #04140D; background: linear-gradient(180deg, #5BF0B5, #2CC98A); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 14px 30px -14px rgba(52,211,153,.9); }

/* ---------- Party header ---------- */
.party-head { padding: 8px 22px 0; display: flex; gap: 14px; align-items: center; }
.party-head .avatar { width: 54px; height: 54px; font-size: 19px; }
.party-head h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.party-head small { color: var(--muted); }
.bal-card { margin: -46px 16px 0; border-radius: 26px; padding: 20px 20px 16px; }
.bal-card .top { display: flex; justify-content: space-between; align-items: flex-start; }
.bal-card label { font-size: 13px; color: rgba(245,246,248,.62); font-weight: 600; }
.bal-card .amt { font-size: 36px; font-weight: 700; letter-spacing: -.035em; line-height: 1.15; margin-top: 2px; }
.bal-card .badge.green { background: rgba(91,240,181,.12); color: #5BF0B5; border: 1px solid rgba(91,240,181,.2); }
.quick { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); }
.quick button { border: 0; background: transparent; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 10.5px; color: rgba(245,246,248,.72); font-weight: 600; padding: 0; white-space: nowrap; }
.quick button span { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.07); color: #fff; border: 1px solid rgba(255,255,255,.1); transition: background .2s, transform .2s var(--ease); }
.quick button:active span { transform: scale(.9); }
.quick button span svg { width: 19px; height: 19px; }
.quick button.wa span { color: #4ADE80; }
.quick button.ilm span { color: #fff; background: linear-gradient(145deg, #14B8A6, #0F766E); border-color: transparent; }

/* ---------- Transactions ---------- */
.tx-day { padding: 16px 18px 6px; font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 10px; }
.tx { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 13px 16px; cursor: pointer; position: relative; transition: background .2s; }
.tx:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.tx + .tx::before { content: ""; position: absolute; top: 0; inset-inline: 16px; border-top: 1px solid var(--line); }
.tx .info small { display: block; color: var(--muted); font-size: 11.5px; }
.tx .info p { margin: 2px 0 0; font-size: 13.5px; color: var(--ink-2); word-break: break-word; }
.tx .col { width: 88px; text-align: end; font-weight: 650; }
.tx .col.empty-col { color: transparent; }
.tx .bal { font-size: 11px; color: var(--muted); display: block; font-weight: 500; margin-top: 2px; }
.tx-head { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 11px 16px; font-size: 11px; font-weight: 600; color: var(--muted); border-bottom: 1px solid var(--line); text-transform: uppercase; letter-spacing: .06em; }
:root[lang="bn"] .tx-head, :root[lang="ar"] .tx-head { text-transform: none; letter-spacing: 0; font-size: 12px; }
.tx-head span { width: 88px; text-align: end; }
.clip { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); padding: 1px 8px; border-radius: 99px; margin-top: 4px; }
.clip svg { width: 12px; height: 12px; }

/* ---------- Buttons / forms ---------- */
.btn {
  height: 52px; border-radius: 16px; border: 1px solid transparent; cursor: pointer; font-weight: 650; font-size: 15px; padding: 0 20px; width: 100%; letter-spacing: -.005em;
  display: flex; align-items: center; justify-content: center; gap: 9px; transition: transform .2s var(--ease), opacity .2s, filter .2s;
  background: var(--btn-bg); color: var(--btn-ink); box-shadow: 0 1px 0 rgba(255,255,255,.2) inset, 0 10px 24px -12px rgba(0,0,0,.6); text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 19px; height: 19px; }
.btn.gold { color: #fff; background: linear-gradient(135deg, #9A9BFF 0%, #6E70F5 55%, #4F46E5 100%); box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 14px 30px -12px rgba(110,112,245,.75); }
.btn.ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); box-shadow: none; }
.btn.danger { background: var(--gave-bg); color: var(--gave); box-shadow: none; }
.btn.gave { color: #fff; background: linear-gradient(180deg, #FF7A7A, #E5484D); }
.btn.got { color: #04140D; background: linear-gradient(180deg, #5BF0B5, #2CC98A); }
.btn.ilm { color: #fff; background: linear-gradient(135deg, #14B8A6, #0F766E); box-shadow: 0 14px 30px -14px rgba(20,184,166,.8); }
.btn.sm { height: 40px; font-size: 13.5px; border-radius: 12px; width: auto; padding: 0 14px; }
.link-btn { background: none; border: 0; color: var(--accent); font-weight: 600; cursor: pointer; padding: 6px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; }
.input {
  width: 100%; height: 50px; border-radius: 14px; border: 1px solid var(--line-2); background: var(--surface-2); padding: 0 15px; outline: 0; color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background .2s;
}
select.input { appearance: none; -webkit-appearance: none; padding-inline-end: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23858A99' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; }
[dir="rtl"] select.input { background-position: left 14px center; }
.input::placeholder { color: var(--muted); opacity: .8; }
textarea.input { height: auto; min-height: 76px; padding: 12px 15px; resize: vertical; }
.input:focus { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.input.amount { height: 84px; font-size: 40px; font-weight: 700; text-align: center; letter-spacing: -.03em; background: transparent; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; box-shadow: none; }
.input.amount.gave { color: var(--gave); } .input.amount.got { color: var(--got); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 13px; padding: 3px; gap: 3px; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 10px; padding: 9px 6px; font-weight: 600; cursor: pointer; color: var(--muted); font-size: 13.5px; transition: all .25s var(--ease); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.25), 0 0 0 1px var(--line-2); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin-top: 2px; flex: none; }
.hint { font-size: 12.5px; color: var(--muted); }
.err { color: var(--gave); font-size: 13px; min-height: 18px; margin: -4px 0 8px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: flex; flex-direction: column; }
.auth .top { padding: calc(48px + var(--safe-t)) 28px 76px; text-align: center; }
.auth .brand-logo { width: 76px; height: 76px; border-radius: 22px; margin: 0 auto 22px; box-shadow: 0 24px 50px -16px rgba(139,140,255,.55), 0 0 0 1px rgba(255,255,255,.1); }
.auth h1 { margin: 0; font-size: 34px; letter-spacing: -.035em; font-weight: 700; line-height: 1.1; }
.auth h1 em { font-style: normal; background: linear-gradient(100deg, #C7C8FF, #8B8CFF 45%, #5EEAD4); -webkit-background-clip: text; background-clip: text; color: transparent; }
:root[data-theme="light"] .auth h1 em { background: linear-gradient(100deg, #6D6DF8, #4F46E5 50%, #0D9488); -webkit-background-clip: text; background-clip: text; }
.auth .top p { margin: 10px 0 0; color: var(--muted); font-size: 15px; }
.auth .card { margin: -40px 16px 20px; background: var(--glass); border-radius: 28px; padding: 22px 20px; border: 1px solid var(--line-2); position: relative; z-index: 3;
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px); box-shadow: var(--shadow-2); }
.g-btn { background: var(--surface) !important; color: var(--ink) !important; border: 1px solid var(--line-2) !important; box-shadow: none !important; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.lang-pills { display: inline-flex; gap: 2px; margin-top: 22px; padding: 3px; border-radius: 99px; background: var(--glass); border: 1px solid var(--line-2); }
.lang-pills button { background: transparent; border: 0; color: var(--muted); border-radius: 99px; padding: 5px 13px; font-size: 12.5px; cursor: pointer; font-weight: 600; }
.lang-pills button.on { background: var(--btn-bg); color: var(--btn-ink); }
.code-box {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace; font-size: 22px; font-weight: 700; letter-spacing: .08em; text-align: center; direction: ltr;
  padding: 24px 12px; border-radius: 18px; color: #fff; border: 1px solid rgba(255,255,255,.12);
  background: radial-gradient(100% 120% at 100% 0%, rgba(139,140,255,.35), transparent 60%), linear-gradient(155deg, #23252F, #0B0C10);
}
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--gave-bg); color: var(--gave); font-size: 13px; margin: 14px 0; border: 1px solid color-mix(in srgb, var(--gave) 20%, transparent); }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice.ok { background: var(--got-bg); color: var(--got); border-color: color-mix(in srgb, var(--got) 20%, transparent); }
.notice.info { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }

/* ---------- Sheet ---------- */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 90; animation: fade .3s var(--ease); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; z-index: 91;
  background: var(--surface); border-radius: 30px 30px 0 0; padding: 10px 20px calc(22px + var(--safe-b)); max-height: 92vh; overflow-y: auto;
  animation: up .45s var(--ease); border: 1px solid var(--line-2); border-bottom: 0; box-shadow: 0 -30px 60px -20px rgba(0,0,0,.6);
}
@keyframes up { from { transform: translate(-50%, 100%); } }
.sheet .grab { width: 38px; height: 5px; border-radius: 9px; background: var(--line-2); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 18px; font-size: 19px; display: flex; align-items: center; gap: 8px; letter-spacing: -.02em; font-weight: 650; }
.sheet h3 > span { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sheet h3 .x { margin-inline-start: auto; width: 36px; height: 36px; }
.sheet h3 .x svg { width: 18px; height: 18px; }
.sheet .actions { display: flex; gap: 10px; margin-top: 8px; }
.menu-item { display: flex; align-items: center; gap: 14px; padding: 13px 2px; border: 0; background: none; width: 100%; cursor: pointer; text-align: start; font-weight: 600; border-bottom: 1px solid var(--line); color: var(--ink); }
.menu-item:last-child { border-bottom: 0; }
.menu-item .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); flex: none; border: 1px solid var(--line); }
.menu-item .ic svg { width: 19px; height: 19px; }
.menu-item small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }
.menu-item.on .ic { background: var(--btn-bg); color: var(--btn-ink); }
.menu-item .tick { margin-inline-start: auto; color: var(--accent); }

/* ---------- Settings ---------- */
.set-group { margin: 6px 16px 12px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow-1); }
.set-row { display: flex; align-items: center; gap: 14px; padding: 13px 16px; cursor: pointer; border: 0; background: none; width: 100%; text-align: start; position: relative; color: var(--ink); transition: background .2s; }
.set-row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.set-row + .set-row::before { content: ""; position: absolute; top: 0; inset-inline: 64px 0; border-top: 1px solid var(--line); }
.set-row .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex: none; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.set-row .ic svg { width: 18px; height: 18px; }
.set-row .t { flex: 1; min-width: 0; font-weight: 600; }
.set-row .t small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.set-row .v { color: var(--muted); font-size: 13.5px; display: flex; align-items: center; gap: 2px; }
.set-row .v svg { width: 17px; height: 17px; opacity: .6; }
.profile-card { margin: -40px 16px 0; display: flex; gap: 14px; align-items: center; padding: 18px; border-radius: 26px; position: relative; z-index: 4; }
.profile-card { color: #F5F6F8; background: radial-gradient(120% 90% at 100% 0%, rgba(139,140,255,.3), transparent 55%), linear-gradient(155deg, #2A2C37, #0B0C10); border: 1px solid rgba(255,255,255,.1); box-shadow: var(--shadow-2); }
.profile-card .hint { color: rgba(245,246,248,.6); }
.profile-card .avatar { width: 54px; height: 54px; font-size: 19px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 99px; font-size: 11.5px; font-weight: 650; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.badge svg { width: 13px; height: 13px; }
.profile-card .badge { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.14); }
.badge.gold { background: linear-gradient(135deg, #E4E5FF, #9A9BFF); color: #0A0A14; border: 0; }
.badge.green { background: var(--got-bg); color: var(--got); border: 0; }

/* ---------- Reports ---------- */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 16px; }
.stat { background: var(--surface); border-radius: 18px; padding: 14px; border: 1px solid var(--line); box-shadow: var(--shadow-1); min-width: 0; }
.stat label { font-size: 11.5px; color: var(--muted); font-weight: 600; display: block; }
.stat b { font-size: 16px; display: block; margin-top: 4px; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 130px; padding: 18px 16px 0; }
.bars div { flex: 1; display: flex; flex-direction: row; align-items: flex-end; justify-content: center; gap: 1px; height: 100%; }
.bars i { display: block; width: 45%; max-width: 8px; border-radius: 4px 4px 1px 1px; min-height: 2px; }
.bars i.g { background: linear-gradient(to top, color-mix(in srgb, var(--got) 50%, transparent), var(--got)); }
.bars i.r { background: linear-gradient(to top, color-mix(in srgb, var(--gave) 50%, transparent), var(--gave)); }

/* ---------- Toast / misc ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); transform: translateX(-50%); z-index: 200;
  background: var(--btn-bg); color: var(--btn-ink); padding: 11px 18px; border-radius: 99px; font-size: 14px; font-weight: 600;
  box-shadow: 0 20px 40px -12px rgba(0,0,0,.6); animation: toast .45s var(--ease); max-width: 90vw; text-align: center;
}
@keyframes toast { from { opacity: 0; transform: translate(-50%, 14px) scale(.96); } }
.net { position: fixed; top: calc(10px + var(--safe-t)); left: 50%; transform: translateX(-50%); z-index: 150; background: #2A2208; color: #FCD34D; font-size: 12px; padding: 6px 13px; border-radius: 99px; display: flex; gap: 6px; align-items: center; border: 1px solid rgba(252,211,77,.25); }
.net svg { width: 15px; height: 15px; }
.spin { width: 22px; height: 22px; border: 2.5px solid color-mix(in srgb, var(--btn-ink) 30%, transparent); border-top-color: var(--btn-ink); border-radius: 50%; animation: spin .7s linear infinite; }
.spin.dark { border-color: var(--line-2); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.splash { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(60% 50% at 70% 20%, rgba(139,140,255,.25), transparent 70%), #07080C; z-index: 300; }
.splash img { width: 84px; height: 84px; border-radius: 24px; animation: pulse 1.6s ease-in-out infinite; box-shadow: 0 30px 60px -16px rgba(139,140,255,.5); }
@keyframes pulse { 50% { transform: scale(.94); opacity: .85; } }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.thumb { width: 72px; height: 72px; border-radius: 14px; overflow: hidden; position: relative; background: var(--surface-2); border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.thumb button { position: absolute; top: 4px; inset-inline-end: 4px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.65); color: #fff; font-size: 13px; cursor: pointer; line-height: 1; }
.add-thumb { border-style: dashed; background: transparent; cursor: pointer; }
.viewer { position: fixed; inset: 0; z-index: 250; background: rgba(0,0,0,.94); display: grid; place-items: center; animation: fade .25s; backdrop-filter: blur(10px); }
.viewer img { max-width: 96vw; max-height: 90vh; border-radius: 12px; }
.items .it { display: grid; grid-template-columns: 1fr 60px 84px 28px; gap: 6px; margin-bottom: 8px; }
.items .it .input { height: 44px; padding: 0 10px; font-size: 14px; border-radius: 12px; }
.items .it button { border: 0; background: none; color: var(--gave); cursor: pointer; font-size: 18px; }

/* ---------- Lock ---------- */
.lock { position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; color: #fff;
  background: radial-gradient(60% 50% at 70% 15%, rgba(139,140,255,.28), transparent 70%), radial-gradient(50% 40% at 20% 90%, rgba(94,234,212,.12), transparent 70%), #07080C; }
.lock .dots { display: flex; gap: 16px; }
.lock .dots i { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.5); transition: all .2s var(--ease); }
.lock .dots i.f { background: #fff; border-color: #fff; box-shadow: 0 0 14px rgba(139,140,255,.8); }
.lock .dots.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.pad { display: grid; grid-template-columns: repeat(3, 74px); gap: 16px; direction: ltr; }
.pad button { width: 74px; height: 74px; border-radius: 50%; border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.06); color: #fff; font-size: 27px; font-weight: 500; cursor: pointer; display: grid; place-items: center; backdrop-filter: blur(10px); transition: background .15s; }
.pad button:active { background: rgba(255,255,255,.2); }
.pad span { display: block; }

/* ---------- Print (PDF রিপোর্ট / ইনভয়েস) ---------- */
#print-root { display: none; }
@media print {
  body { background: #fff !important; padding: 0; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; color: #000; font-family: var(--font); }
  @page { margin: 14mm; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.doc { font-size: 12px; color: #0A0B10; }
.doc .dh { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 16px; margin-bottom: 18px; border-bottom: 1px solid #E4E6EB; }
.doc .dh h1 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.doc .dh .brand { display: flex; align-items: center; gap: 12px; }
.doc .dh img { width: 42px; height: 42px; border-radius: 11px; }
.doc .dh > div:last-child b { font-size: 18px !important; letter-spacing: -.02em; color: #4F46E5; }
.doc table { width: 100%; border-collapse: collapse; margin-top: 12px; }
.doc th { color: #737887; font-weight: 600; padding: 8px; text-align: start; font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1.5px solid #0A0B10; }
.doc td { padding: 9px 8px; border-bottom: 1px solid #EEF0F3; vertical-align: top; }
.doc tfoot td { border-bottom: 0; border-top: 1.5px solid #0A0B10; }
.doc .r { text-align: end; font-variant-numeric: tabular-nums; } .doc .g { color: #0F9F6E; } .doc .d { color: #E5484D; }
.doc .sum { display: flex; gap: 10px; margin: 12px 0; }
.doc .sum div { flex: 1; border-radius: 12px; padding: 12px 14px; background: #F6F7F9; color: #737887; font-size: 11px; }
.doc .sum b { display: block; font-size: 17px; letter-spacing: -.02em; margin-top: 2px; color: #0A0B10; }
.doc .sum b.g { color: #0F9F6E; } .doc .sum b.d { color: #E5484D; }
.doc .foot { margin-top: 28px; text-align: center; color: #9CA0AC; font-size: 10.5px; padding-top: 12px; border-top: 1px solid #EEF0F3; }
