/* ============================================================
   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; }

/* ---------- পরিশোধের তারিখ (v4) ---------- */
.due-strip { display: flex; gap: 10px; overflow-x: auto; padding: 2px 16px 6px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.due-strip::-webkit-scrollbar { display: none; }
.due-card { flex: none; width: 150px; scroll-snap-align: start; text-decoration: none; padding: 14px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-1); display: flex; flex-direction: column; gap: 4px; transition: transform .2s var(--ease); }
.due-card:active { transform: scale(.97); }
.due-card .dc-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.due-card .avatar { width: 36px; height: 36px; font-size: 13px; }
.due-card b { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.due-card .num { font-weight: 700; font-size: 16px; letter-spacing: -.02em; color: var(--got); }
.due-card.over { border-color: color-mix(in srgb, var(--gave) 35%, transparent); background: linear-gradient(160deg, color-mix(in srgb, var(--gave) 10%, var(--surface)), var(--surface) 60%); }
.due-card.today { border-color: color-mix(in srgb, #F59E0B 35%, transparent); }
.due-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; margin-inline-end: 6px; vertical-align: 1px; }
.due-chip svg { width: 13px; height: 13px; }
.due-chip.over, .due-card.over .due-chip { background: var(--gave-bg); color: var(--gave); border-color: transparent; }
.due-chip.today, .due-card.today .due-chip { background: rgba(245,158,11,.14); color: #F59E0B; border-color: transparent; }
.due-chip.lg { font-size: 11.5px; padding: 4px 10px; cursor: pointer; background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.14); }
.bal-card .due-chip.lg.over { background: rgba(255,107,107,.18); color: #FF9B9B; }
.bal-card .due-chip.lg.today { background: rgba(245,158,11,.18); color: #FCD34D; }
.chip input[type=date]::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }

/* ---------- প্রিমিয়াম (v4) ---------- */
.prem-badge { width: 64px; height: 64px; margin: 6px auto 0; border-radius: 20px; display: grid; place-items: center; font-size: 28px; color: #0A0A14;
  background: linear-gradient(135deg, #F4F4FF 0%, #A5A6FF 45%, #5EEAD4 100%); box-shadow: 0 18px 40px -14px rgba(139,140,255,.8), inset 0 1px 0 rgba(255,255,255,.7); }
.prem-badge.sm { width: 38px; height: 38px; border-radius: 12px; font-size: 17px; margin: 0; flex: none; box-shadow: none; }
.prem-hero { text-align: center; padding: 4px 0 2px; }
.prem-row { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 14px 16px 0; padding: 14px 16px; border-radius: 20px; cursor: pointer; text-align: start; color: var(--ink);
  background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 70%); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.prem-row > span:nth-child(2) { flex: 1; min-width: 0; }
.prem-row b { display: block; font-weight: 650; }
.prem-row small { display: block; color: var(--muted); font-size: 12.5px; }
.prem-row svg { color: var(--muted); }
.otp { font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .5em; text-align: center; font-size: 24px !important; font-weight: 700; direction: ltr; }

/* ============ দোকান মডিউল (v5) ============ */
.tabbar { width: min(420px, calc(100% - 24px)); }
.tabbar a { font-size: 10.5px; padding: 8px 2px 7px; }
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a.add { width: 54px; }
.sh-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 16px 0; }
.sh-act { border: 1px solid var(--line); background: var(--surface); border-radius: 20px; padding: 14px 4px 12px; display: flex; flex-direction: column; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 650; color: var(--ink); cursor: pointer; box-shadow: var(--shadow-1); transition: transform .2s var(--ease); }
.sh-act:active { transform: scale(.95); }
.sh-act span { width: 44px; height: 44px; border-radius: 15px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.sh-act.primary { background: linear-gradient(160deg, color-mix(in srgb, var(--got) 18%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--got) 35%, transparent); }
.sh-act.primary span { background: linear-gradient(180deg, #5BF0B5, #2CC98A); color: #04140D; border: 0; }
.kind-ic { width: 40px; height: 40px; border-radius: 13px; display: grid; place-items: center; flex: none; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.kind-ic svg { width: 19px; height: 19px; }
.k-sale, .k-cashin, .k-collect { color: var(--got) !important; background: var(--got-bg) !important; border-color: transparent !important; }
.k-purchase, .k-pay { color: #60A5FA !important; background: rgba(96,165,250,.12) !important; border-color: transparent !important; }
.k-expense, .k-cashout, .k-salary { color: var(--gave) !important; background: var(--gave-bg) !important; border-color: transparent !important; }
.calc-out { display: block; color: var(--accent); font-weight: 700; font-size: 13px; min-height: 0; margin-top: 4px; text-align: end; }
.calc-out:empty { display: none; }
/* POS */
.pgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 4px 16px 0; max-height: 46vh; overflow-y: auto; }
.pcard { border: 1px solid var(--line); background: var(--surface); border-radius: 16px; padding: 10px 8px; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; text-align: center; color: var(--ink); min-width: 0; transition: transform .15s var(--ease); }
.pcard:active { transform: scale(.94); background: var(--surface-2); }
.pcard img, .pc-ic { width: 44px; height: 44px; border-radius: 13px; object-fit: cover; display: grid; place-items: center; font-weight: 700; font-size: 14px;
  color: hsl(var(--h,240) 80% 85%); background: radial-gradient(120% 120% at 30% 20%, hsl(var(--h,240) 45% 32%), hsl(calc(var(--h,240) + 30) 40% 15%)); }
:root[data-theme="light"] .pc-ic { color: hsl(var(--h,240) 55% 32%); background: hsl(var(--h,240) 70% 93%); }
.pcard b { font-size: 12.5px; font-weight: 600; line-height: 1.25; width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pcard .num { font-size: 12.5px; font-weight: 700; }
.pcard small { font-size: 10.5px; color: var(--muted); }
.pcard.add { border-style: dashed; justify-content: center; }
.pcard.add .pc-ic { background: var(--surface-2); color: var(--muted); }
.cart-empty { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 22px; border: 1px dashed var(--line-2); border-radius: 18px; color: var(--muted); font-size: 13.5px; }
.cart-row { padding: 12px 14px; position: relative; }
.cart-row + .cart-row { border-top: 1px solid var(--line); }
.cr-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cr-top b { font-weight: 600; }
.cr-top .x, .party-pick .x { border: 0; background: var(--surface-2); color: var(--muted); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; display: grid; place-items: center; flex: none; }
.cr-bot { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.stepper { display: flex; align-items: center; border: 1px solid var(--line-2); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.stepper button { width: 32px; height: 34px; border: 0; background: transparent; color: var(--ink); font-size: 18px; cursor: pointer; }
.qty-in { width: 44px; height: 34px; border: 0; background: transparent; text-align: center; font-weight: 700; outline: 0; }
.price-in { width: 84px; height: 36px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface-2); text-align: center; outline: 0; }
.price-in:focus, .qty-in:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
.cr-total { margin-inline-start: auto; }
.party-pick { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; border: 1px solid var(--line-2); background: var(--surface); cursor: pointer; color: var(--ink); }
.party-pick .avatar, .party-pick .kind-ic { width: 38px; height: 38px; }
.sum-card { border-radius: 20px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 10px; margin-top: 6px; border-top: 1px dashed var(--line-2); }
.sum-total b { font-size: 26px; letter-spacing: -.03em; }
.kv { border-radius: 18px; background: var(--surface-2); border: 1px solid var(--line); padding: 4px 14px; }
.kv-row { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; font-size: 14px; }
.kv-row + .kv-row { border-top: 1px solid var(--line); }
.sum-card .kv-row { padding: 5px 0; border: 0; }
.kv-row span { color: var(--muted); }
.kv-row b { font-weight: 600; text-align: end; }
.done-ic { width: 72px; height: 72px; border-radius: 50%; margin: 6px auto 0; display: grid; place-items: center; color: #04140D; background: linear-gradient(180deg, #5BF0B5, #2CC98A); box-shadow: 0 18px 40px -14px rgba(52,211,153,.8); animation: pop .5s var(--ease); }
.done-ic svg { width: 34px; height: 34px; stroke-width: 2.6; }
@keyframes pop { from { transform: scale(.5); opacity: 0; } }
.p-thumb { width: 42px; height: 42px; border-radius: 13px; object-fit: cover; flex: none; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.scan-wrap { position: relative; border-radius: 18px; overflow: hidden; }
.scan-line { position: absolute; left: 8%; right: 8%; height: 2px; background: #5BF0B5; box-shadow: 0 0 14px #5BF0B5; top: 20%; animation: scan 2s ease-in-out infinite alternate; }
@keyframes scan { to { top: 80%; } }
/* ক্যাশবুক */
.cb-day { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 18px 20px 0; font-size: 13px; }
.cb-day > span { color: var(--muted); font-size: 12px; }
.cb-sum { display: flex; justify-content: flex-end; gap: 14px; padding: 0 22px; font-size: 12px; font-weight: 600; }
/* লাভ-ক্ষতি */
.pl-row { display: flex; justify-content: space-between; padding: 10px 16px; font-size: 14px; }
.pl-row span { color: var(--ink-2); }
.pl-row.strong { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.pl-row.strong span, .pl-row.strong b { font-weight: 750; color: var(--ink); }
.pl-row.strong b.c-got { color: var(--got); } .pl-row.strong b.c-gave { color: var(--gave); }
.rank { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; font-size: 13px; flex: none; border: 1px solid var(--line); }
/* কর্মচারী */
.att { display: flex; gap: 4px; }
.att button { width: 34px; height: 34px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--muted); font-weight: 700; cursor: pointer; }
.att .att-p.on, .cal-d.att-p { background: var(--got); color: #04140D; border-color: transparent; }
.att .att-h.on, .cal-d.att-h { background: #F59E0B; color: #1A1203; border-color: transparent; }
.att .att-a.on, .cal-d.att-a { background: var(--gave); color: #fff; border-color: transparent; }
.month-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-h { text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; padding-bottom: 2px; }
.cal-d { aspect-ratio: 1; border-radius: 11px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font-weight: 600; font-size: 13px; cursor: pointer; }
/* অনলাইন দোকান */
.store-hero { text-align: center; padding: 18px 10px 4px; }

.demo-pill { position: fixed; bottom: calc(84px + var(--safe-b)); inset-inline-start: max(12px, calc(50vw - 250px)); z-index: 35; pointer-events: none;
  background: rgba(30,27,75,.85); color: #C7D2FE; border: 1px solid rgba(165,166,255,.3); font-size: 10.5px; font-weight: 600; padding: 4px 10px; border-radius: 99px; backdrop-filter: blur(10px); }

/* =====================================================================
   v9 · ট্যাবলেট ও ডেস্কটপ লেআউট — মোবাইলের (৭৬৭px পর্যন্ত) কিছুই বদলায় না
   ===================================================================== */
.side, .desk-welcome { display: none; }

/* ---------- ট্যাবলেট: চওড়া এক কলাম ---------- */
@media (min-width: 768px) and (max-width: 1023px) {
  #app { max-width: 760px; }
  .bottom-actions, .sheet { max-width: 760px; }
  .pgrid { grid-template-columns: repeat(4, 1fr); max-height: 52vh; }
  .demo-pill { inset-inline-start: max(12px, calc(50vw - 370px)); }
}

/* ---------- ডেস্কটপ: সাইডবার + পুরো স্ক্রিন ---------- */
@media (min-width: 1024px) {
  :root { --side-w: 268px; }
  body.desk { padding: 0; background: var(--bg); }
  body.desk #app { max-width: none; margin: 0; margin-inline-start: var(--side-w); min-height: 100vh; border-radius: 0; box-shadow: none; overflow: visible; }
  body.desk .tabbar { display: none; }
  body.desk .screen { min-height: 100vh; padding-bottom: 48px; max-width: 1040px; margin: 0 auto; }
  body.desk .screen:has(.set-group) { max-width: 780px; }

  /* সাইডবার */
  body.desk .side {
    display: flex; flex-direction: column; gap: 6px; position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: var(--side-w); z-index: 50;
    padding: 22px 16px 16px; background: var(--bg-2); border-inline-end: 1px solid var(--line); overflow-y: auto;
  }
  .side-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 2px 6px 16px; }
  .side-brand img { width: 42px; height: 42px; border-radius: 12px; box-shadow: 0 10px 24px -10px rgba(139,140,255,.6); }
  .side-brand b { display: block; font-size: 17px; letter-spacing: -.02em; line-height: 1.15; }
  .side-brand small { display: block; font-size: 11.5px; color: var(--muted); font-weight: 500; }
  .side-book { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px; border-radius: 16px; cursor: pointer; text-align: start;
    background: var(--surface); border: 1px solid var(--line); color: var(--ink); transition: background .2s; }
  .side-book:hover { background: var(--surface-2); }
  .side-book .logo { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-weight: 700; background: var(--btn-bg); color: var(--btn-ink); flex: none; }
  .side-book b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-book small { display: block; font-size: 11.5px; color: var(--muted); }
  .side-book > svg { width: 16px; height: 16px; color: var(--muted); }
  .side-new { margin: 10px 0 8px; height: 46px; border-radius: 14px; font-size: 14.5px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
  .side-item { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 13px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14.5px; transition: background .2s, color .2s; }
  .side-item:hover { background: var(--surface); color: var(--ink); }
  .side-item.on { color: var(--ink); background: color-mix(in srgb, var(--accent) 14%, transparent); box-shadow: inset 3px 0 0 var(--accent); }
  [dir="rtl"] .side-item.on { box-shadow: inset -3px 0 0 var(--accent); }
  .side-item svg { width: 20px; height: 20px; }
  .side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 4px; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); }
  .side-foot .avatar { width: 36px; height: 36px; font-size: 13px; flex: none; }
  .side-foot b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .side-foot small { display: block; font-size: 11.5px; color: var(--muted); }
  .side-foot .ver { font-size: 10.5px; padding: 2px 7px; border-radius: 99px; border: 1px solid var(--line-2); flex: none; }

  /* দুই কলাম: বাঁয়ে তালিকা, ডানে খাতা */
  .split { display: grid; grid-template-columns: minmax(360px, 410px) minmax(0, 1fr); height: 100vh; }
  .split-l, .split-r { overflow-y: auto; overscroll-behavior: contain; min-width: 0; }
  .split-l { border-inline-end: 1px solid var(--line); background: var(--bg); }
  .split-r { background: var(--bg-2); }
  body.desk .split .screen { min-height: 100%; max-width: none; margin: 0; }
  body.desk .split-r .screen { max-width: 880px; margin: 0 auto; background: var(--bg-2); }
  .split-r .hero-wrap::after { background: linear-gradient(to bottom, transparent 55%, var(--bg-2)); }
  .split-l .list a.row.on { background: color-mix(in srgb, var(--accent) 13%, var(--surface)); box-shadow: inset 3px 0 0 var(--accent); }
  [dir="rtl"] .split-l .list a.row.on { box-shadow: inset -3px 0 0 var(--accent); }
  .split-l .list a.row:hover { background: var(--surface-2); }
  .split-r .topbar .icon-btn:first-child { visibility: hidden; }

  /* খাতার নিচের বোতাম — পাতার সাথে লেগে থাকবে */
  body.desk .bottom-actions { position: sticky; left: auto; transform: none; max-width: none; width: auto; margin-top: 18px; background: linear-gradient(to top, var(--bg-2) 62%, transparent); }
  body.desk .bottom-actions .big-btn { height: 56px; cursor: pointer; }
  body.desk .bottom-actions .big-btn:hover { filter: brightness(1.06); }

  /* কোনো খাতা বাছা না থাকলে */
  body.desk .desk-welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; min-height: 100%; padding: 40px; gap: 6px;
    background: radial-gradient(50% 40% at 50% 38%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
  .dw-art { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; margin-bottom: 12px; color: var(--accent);
    background: var(--surface); border: 1px solid var(--line-2); box-shadow: 0 24px 50px -20px rgba(139,140,255,.45); }
  .dw-art svg { width: 38px; height: 38px; }
  .desk-welcome h2 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
  .desk-welcome p { margin: 0 0 14px; color: var(--muted); max-width: 360px; }
  .dw-actions { display: flex; gap: 10px; }
  .dw-actions .btn { width: auto; padding: 0 20px; text-decoration: none; }

  /* ফর্ম: নিচের শিটের বদলে মাঝখানে ডায়ালগ */
  body.desk .sheet { top: 50%; bottom: auto; left: calc(50% + var(--side-w) / 2); transform: translate(-50%, -50%); max-width: 560px;
    border-radius: 26px; border-bottom: 1px solid var(--line-2); max-height: 86vh; padding: 18px 26px 24px; animation: pop .3s var(--ease); box-shadow: 0 40px 90px -30px rgba(0,0,0,.75); }
  [dir="rtl"] body.desk .sheet { left: calc(50% - var(--side-w) / 2); }
  @keyframes pop { from { opacity: 0; transform: translate(-50%, -47%) scale(.98); } }
  body.desk .sheet .grab { display: none; }

  /* টোস্ট, ইন্টারনেট নেই, ডেমো চিহ্ন — কন্টেন্টের মাঝখানে */
  body.desk .toast { left: calc(50% + var(--side-w) / 2); bottom: 32px; }
  body.desk .net { left: calc(50% + var(--side-w) / 2); }
  [dir="rtl"] body.desk .toast, [dir="rtl"] body.desk .net { left: calc(50% - var(--side-w) / 2); }
  body.desk .demo-pill { bottom: 16px; inset-inline-start: calc(var(--side-w) + 16px); }

  /* ওপরের আলোর আভা যেন কেটে না যায়; বাঁয়ের তালিকায় খাতা বদলানো সাইডবারেই আছে */
  body.desk .screen > .hero-wrap { overflow: visible; }
  body.desk .split-l .hero-wrap > .topbar.dark { display: none; }
  body.desk .split-l .greet { padding-top: 26px; }
  body.desk .split .hero-wrap { overflow: hidden; }

  /* হোম কার্ড আর আদায়ের তালিকা */
  body.desk .due-strip { flex-wrap: wrap; overflow: visible; }

  /* POS: বাঁয়ে পণ্য, ডানে সবসময় খোলা কার্ট */
  body.desk .screen.pos { max-width: 1280px; display: grid; grid-template-columns: minmax(0, 1fr) 420px; grid-template-rows: auto auto 1fr; column-gap: 8px; align-items: start; }
  body.desk .screen.pos > .topbar { grid-column: 1 / -1; }
  body.desk .screen.pos > .toolbar { grid-column: 1; grid-row: 2; }
  body.desk .screen.pos > .pgrid { grid-column: 1; grid-row: 3; max-height: none; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding-bottom: 20px; }
  body.desk .screen.pos > .section-title { grid-column: 2; grid-row: 2; }
  body.desk .screen.pos > div:last-child { grid-column: 2; grid-row: 3; position: sticky; top: 76px; padding: 16px !important; margin-inline-end: 16px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 22px; max-height: calc(100vh - 100px); overflow-y: auto; }
  .pcard { transition: transform .15s var(--ease), border-color .2s; }
  .pcard:hover { border-color: var(--line-2); transform: translateY(-1px); }

  /* সাধারণ: হোভার */
  .list a.row, .set-row, .menu-item, .chip, .btn, .icon-btn { cursor: pointer; }
  .set-row:hover { background: var(--surface-2); }
}
