/* Jameel Noori Nastaleeq for Urdu/Arabic script only (unicode-range): Latin text keeps the UI font,
   and the font file is only downloaded when Urdu text is shown or printed. */
@font-face {
  font-family: 'Jameel Noori Nastaleeq';
  src: url('../fonts/jameel-noori-nastaleeq.woff') format('woff');
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F;
}

/* ================= Design tokens ================= */
:root {
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-3: #06b6d4;
  --brand-grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #db2777 120%);
  --hero-grad: linear-gradient(135deg, #312e81 0%, #4f46e5 45%, #7c3aed 100%);
  --brand-soft: rgba(79, 70, 229, .10);
  --radius: 16px;
  --radius-sm: 11px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow: 0 6px 20px -8px rgba(16, 24, 40, .14), 0 2px 6px -2px rgba(16, 24, 40, .06);
  --shadow-lg: 0 24px 48px -16px rgba(30, 27, 75, .35);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  --app-bg: #f4f5fb;
  --surface: #ffffff;
  --chart-1: #4f46e5;
  --chart-2: #059669;
  --bs-primary: #4f46e5;
  --bs-primary-rgb: 79, 70, 229;
  --bs-primary-text-emphasis: #3730a3;
  --bs-primary-bg-subtle: #eef0ff;
  --bs-primary-border-subtle: #c7cbfb;
  --bs-link-color: #4f46e5;
  --bs-link-color-rgb: 79, 70, 229;
  --bs-link-hover-color: #3730a3;
  --bs-link-hover-color-rgb: 55, 48, 163;
  --bs-font-sans-serif: 'Jameel Noori Nastaleeq', 'Inter Variable', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif;
  --bs-body-font-family: var(--bs-font-sans-serif);
  --bs-border-radius: .65rem;
  --bs-border-radius-lg: .9rem;
  --topbar-h: 56px;
  --bottomnav-h: 68px;
  --sidebar-w: 248px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* service colours */
  --c-green: #059669; --c-red: #e11d48; --c-indigo: #4f46e5; --c-amber: #d97706; --c-violet: #7c3aed;
  --c-cyan: #0891b2; --c-pink: #db2777; --c-slate: #64748b;
}
[data-bs-theme="dark"] {
  --app-bg: #0f1117;
  --surface: #171a22;
  --chart-1: #8b8dfa;
  --chart-2: #34d399;
  --brand-soft: rgba(116, 119, 242, .16);
  --bs-body-bg: #171a22;
  --bs-tertiary-bg: #12141b;
  --bs-secondary-bg: #222634;
  --bs-border-color: #2a2f3d;
  --bs-border-color-translucent: rgba(255, 255, 255, .08);
  --bs-primary: #7477f2;
  --bs-primary-rgb: 116, 119, 242;
  --bs-primary-text-emphasis: #b4b6fb;
  --bs-primary-bg-subtle: #23244a;
  --bs-primary-border-subtle: #3b3d7a;
  --bs-link-color: #9a9cf7;
  --bs-link-color-rgb: 154, 156, 247;
  --bs-link-hover-color: #b4b6fb;
  --bs-link-hover-color-rgb: 180, 182, 251;
  --shadow: 0 6px 20px -8px rgba(0, 0, 0, .55);
  --c-green: #34d399; --c-red: #fb7185; --c-indigo: #8b8dfa; --c-amber: #fbbf24; --c-violet: #c4b5fd;
  --c-cyan: #22d3ee; --c-pink: #f472b6; --c-slate: #94a3b8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme="light"]) {
    --app-bg: #0f1117; --surface: #171a22; --chart-1: #8b8dfa; --chart-2: #34d399;
  }
}

body { background: var(--app-bg); min-height: 100vh; font-feature-settings: "cv11", "ss01"; -webkit-tap-highlight-color: transparent; }
body.dark-ish {}
.min-w-0 { min-width: 0; }
.opacity-75 { opacity: .8; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ================= Splash ================= */
#splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--hero-grad); color: #fff; z-index: 2000; }
#splash.d-none { display: none !important; }
.splash-logo img { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 16px 40px rgba(0,0,0,.3); animation: pop .6s var(--spring) both; }
.splash-name { font-weight: 700; letter-spacing: .02em; animation: rise .6s .15s var(--ease) both; }
.splash-bar { width: 140px; height: 4px; border-radius: 4px; background: rgba(255,255,255,.25); margin-top: 22px; overflow: hidden; position: relative; }
.splash-bar::after { content: ''; position: absolute; inset: 0; width: 40%; background: #fff; border-radius: 4px; animation: slide 1.2s ease-in-out infinite; }
#splash-error { color: #fecaca !important; }

/* ================= Login ================= */
.auth { min-height: 100vh; position: relative; overflow: hidden; background: var(--hero-grad); color: #fff; display: flex; align-items: center; }
.auth-bg { position: absolute; inset: 0; pointer-events: none; }
.auth-bg .blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: drift 14s ease-in-out infinite alternate; }
.auth-bg .b1 { width: 380px; height: 380px; background: #a855f7; top: -120px; left: -80px; }
.auth-bg .b2 { width: 320px; height: 320px; background: #22d3ee; bottom: -110px; right: -60px; animation-delay: -4s; }
.auth-bg .b3 { width: 240px; height: 240px; background: #fb7185; top: 40%; left: 45%; animation-delay: -8s; opacity: .35; }
.auth-bg .grid-lines { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px); background-size: 42px 42px; mask-image: radial-gradient(circle at 50% 40%, #000, transparent 75%); }
.auth-inner { position: relative; width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 20px; display: grid; grid-template-columns: 1fr; gap: 28px; align-items: center; }
@media (min-width: 900px) { .auth-inner { grid-template-columns: 1.1fr .9fr; padding: 48px; } }
.auth-hero .brand-row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; animation: rise .5s var(--ease) both; }
.brand-mark img { width: 52px; height: 52px; border-radius: 16px; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.brand-row .name { font-weight: 800; font-size: 1.25rem; }
.brand-row .tag { font-size: .8rem; opacity: .8; }
.auth-hero h1 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 800; line-height: 1.12; letter-spacing: -.02em; animation: rise .6s .08s var(--ease) both; }
.auth-hero h1 .grad { background: linear-gradient(90deg, #fde68a, #6ee7b7, #7dd3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead-sm { opacity: .85; max-width: 520px; margin-top: 12px; animation: rise .6s .16s var(--ease) both; }
.feature-chips { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; animation: rise .6s .24s var(--ease) both; }
.feature-chips li { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22); border-radius: 999px; padding: 6px 12px; font-size: .82rem; backdrop-filter: blur(6px); }
.feature-chips li i { margin-right: 6px; }
.hero-art { margin-top: 18px; max-width: 480px; }
.hero-art svg { width: 100%; height: auto; overflow: visible; }
.hero-art .float-a { animation: bob 6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.hero-art .float-b { animation: bob 7s -2s ease-in-out infinite; }
.hero-art .bar { transform-box: fill-box; transform-origin: bottom; animation: grow 1.2s var(--ease) both; }
.hero-art .flow-path { stroke-dashoffset: 0; animation: dash 1.4s linear infinite; }
.hero-art .flow-path.p2 { animation-direction: reverse; }
.hero-art .coin { animation: coin 4.8s linear infinite; }
.hero-art .coin.c2 { animation-delay: -2.4s; }
.hero-art .coin { offset-path: path("M40 90 C 110 90, 130 150, 186 160"); }
.hero-art .coin.c2 { offset-path: path("M336 170 C 390 180, 410 230, 470 240"); }
.auth-card { background: rgba(255,255,255,.96); color: #1f2340; border-radius: 24px; padding: 30px 26px; box-shadow: var(--shadow-lg); animation: rise .6s .2s var(--ease) both; }
.auth-card h2 { font-weight: 800; font-size: 1.45rem; margin-bottom: 2px; }
.auth-card .sub { color: #6b7280; margin-bottom: 18px; font-size: .92rem; }
.auth-card .small { color: #6b7280; }
.field { position: relative; margin-bottom: 14px; }
.field input { width: 100%; height: 54px; border: 1.5px solid #e5e7eb; border-radius: 14px; padding: 22px 44px 6px 42px; font-size: 1rem; background: #fafafe; transition: border-color .2s, box-shadow .2s, background .2s; color: #111827; }
.field input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 4px rgba(99,102,241,.15); background: #fff; }
.field label { position: absolute; left: 42px; top: 16px; color: #8a8fa3; pointer-events: none; transition: all .18s var(--ease); }
.field input:focus + .lead-icon, .field input:not(:placeholder-shown) + .lead-icon { color: #6366f1; }
.field input:focus ~ label, .field input:not(:placeholder-shown) ~ label { top: 6px; font-size: .72rem; color: #6366f1; }
.field .lead-icon { position: absolute; left: 15px; top: 19px; color: #9ca3af; transition: color .2s; }
.field .field-action { position: absolute; right: 6px; top: 8px; color: #6b7280; }
.btn-grad { background: var(--brand-grad); color: #fff; border: 0; font-weight: 700; border-radius: 14px; height: 52px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; box-shadow: 0 12px 26px -10px rgba(124,58,237,.6); transition: transform .15s var(--ease), box-shadow .2s; }
.btn-grad:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 16px 30px -10px rgba(124,58,237,.7); }
.btn-grad:active { transform: translateY(1px) scale(.99); }
.btn-login:disabled { opacity: .8; }
.auth-foot { margin-top: 12px; font-size: .85rem; color: #6b7280; text-align: center; }
.shake { animation: shake .45s; }

/* ================= App shell ================= */
#view-app { min-height: 100vh; }
#sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w); background: var(--surface); border-right: 1px solid var(--bs-border-color); padding: 16px 12px; z-index: 1020; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; padding: 6px 8px 16px; }
.sidebar-brand .logo img { width: 36px; height: 36px; border-radius: 11px; }
.nav-menu .nav-section { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: var(--bs-secondary-color); padding: 14px 12px 6px; }
.nav-menu .nav-link { display: flex; align-items: center; gap: 12px; color: var(--bs-body-color); padding: 9px 12px; border-radius: 12px; font-weight: 500; transition: background .2s, color .2s, transform .15s var(--ease); }
.nav-menu .nav-link i { font-size: 1.1rem; color: var(--bs-secondary-color); transition: transform .25s var(--spring); }
.nav-menu .nav-link:hover { background: var(--brand-soft); transform: translateX(3px); }
.nav-menu .nav-link:hover i { transform: scale(1.12); color: var(--brand); }
.nav-menu .nav-link.active { background: var(--brand-grad); color: #fff; box-shadow: 0 8px 18px -8px rgba(124,58,237,.7); }
.nav-menu .nav-link.active i { color: #fff; }
.app-main { min-height: 100vh; }
@media (min-width: 992px) { .app-main { margin-left: var(--sidebar-w); } .app-topbar { padding-left: 24px !important; } main#content { padding-bottom: 32px; } }
.app-topbar { position: sticky; top: 0; z-index: 1010; height: var(--topbar-h); display: flex; align-items: center; gap: 10px; padding: 0 14px; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--bs-border-color); }
.avatar-btn { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--brand-grad); color: #fff; display: grid; place-items: center; font-weight: 700; box-shadow: 0 6px 14px -6px rgba(124,58,237,.8); transition: transform .2s var(--spring); }
.avatar-btn:hover { transform: scale(1.08); }
.conn-online { background: #dcfce7 !important; color: #166534 !important; transition: all .3s; }
.conn-offline { background: #fee2e2 !important; color: #991b1b !important; animation: blink 1.6s ease-in-out infinite; }
[data-bs-theme="dark"] .conn-online { background: rgba(52,211,153,.18) !important; color: #6ee7b7 !important; }
[data-bs-theme="dark"] .conn-offline { background: rgba(251,113,133,.18) !important; color: #fda4af !important; }
main#content { padding: 16px 14px calc(var(--bottomnav-h) + 24px); max-width: 1200px; }
main#content:focus { outline: none; }
.page-enter > * { animation: rise .45s var(--ease) both; }
.page-enter > *:nth-child(2) { animation-delay: .04s; } .page-enter > *:nth-child(3) { animation-delay: .08s; } .page-enter > *:nth-child(4) { animation-delay: .12s; }

#bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; height: calc(var(--bottomnav-h) + var(--safe-b)); padding-bottom: var(--safe-b); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--bs-border-color); display: flex; justify-content: space-around; align-items: center; z-index: 1030; }
#bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--bs-secondary-color); text-decoration: none; font-size: .72rem; min-width: 56px; padding: 6px 4px; border-radius: 12px; transition: color .2s, transform .2s var(--spring); }
#bottom-nav a i { font-size: 1.25rem; }
#bottom-nav a.active { color: var(--brand); }
#bottom-nav a.active i { transform: translateY(-2px) scale(1.08); }
#bottom-nav .nav-sell { position: relative; top: -18px; width: 62px; height: 62px; border-radius: 22px; background: var(--brand-grad); color: #fff !important; justify-content: center; box-shadow: 0 14px 28px -8px rgba(124,58,237,.75); }
#bottom-nav .nav-sell i { font-size: 1.6rem; }
#bottom-nav .nav-sell span { font-size: .68rem; margin-top: -3px; }
#bottom-nav .nav-sell.active { color: #fff !important; }
#bottom-nav .nav-sell::after { content: ''; position: absolute; inset: -6px; border-radius: 26px; border: 2px solid rgba(124,58,237,.35); animation: ping 2.4s var(--ease) infinite; }
@media (max-width: 991.98px) { main#content { padding-bottom: calc(var(--bottomnav-h) + 36px); } }

.page-header { position: relative; }
.page-header h1 { font-weight: 800; letter-spacing: -.01em; }

/* ================= Cards & generic ================= */
.card { border: 1px solid var(--bs-border-color); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.card.hoverable:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.btn { border-radius: 12px; font-weight: 600; transition: transform .15s var(--ease), box-shadow .2s, background .2s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--brand-grad); border: 0; box-shadow: 0 8px 18px -10px rgba(124,58,237,.8); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-success { background: linear-gradient(135deg, #059669, #10b981); border: 0; }
.btn-warning { background: linear-gradient(135deg, #f59e0b, #fbbf24); border: 0; color: #422006; }
.btn-lg { padding: .75rem 1.25rem; font-size: 1.02rem; }
.form-control, .form-select { border-radius: 12px; border-color: var(--bs-border-color); padding: .55rem .8rem; }
.form-control:focus, .form-select:focus { box-shadow: 0 0 0 4px rgba(var(--bs-primary-rgb), .15); border-color: var(--brand); }
.list-group-item { background: var(--surface); }
.badge-soft-success { background: rgba(5,150,105,.14); color: var(--c-green); }
.text-body-secondary { color: var(--bs-secondary-color) !important; }
.modal-content { border-radius: 20px; border: 0; box-shadow: var(--shadow-lg); }
.modal.fade .modal-dialog { transition: transform .35s var(--spring), opacity .2s; }
.modal.show .modal-dialog { transform: none; }
.toast { border-radius: 14px; box-shadow: var(--shadow-lg); }
.toast.show { animation: toastIn .4s var(--spring); }

.page-header .btn { white-space: nowrap; }

/* Chips */
.chip { border: 1px solid var(--bs-border-color); background: var(--surface); color: var(--bs-body-color); border-radius: 999px; padding: 7px 14px; font-weight: 600; font-size: .9rem; transition: all .2s var(--ease); }
.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }
.chip.active, .chip:active { background: var(--brand-grad); border-color: transparent; color: #fff; }
.chip-pop { animation: pop .3s var(--spring); }
.chip-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 8px; scrollbar-width: none; }
.chip-tabs::-webkit-scrollbar { display: none; }

/* Icons */
.kind-ico { width: 40px; height: 40px; border-radius: 13px; display: inline-grid; place-items: center; flex-shrink: 0; font-size: 1.15rem; transition: transform .3s var(--spring); }
.kind-ico.sm { width: 30px; height: 30px; border-radius: 10px; font-size: .95rem; }
.kind-ico.lg { width: 52px; height: 52px; border-radius: 17px; font-size: 1.45rem; }
.kind-ico.big { width: 58px; height: 58px; border-radius: 18px; font-size: 1.6rem; }
.kind-ico.tint-green { background: rgba(5,150,105,.14); color: var(--c-green); }
.kind-ico.tint-red { background: rgba(225,29,72,.13); color: var(--c-red); }
.kind-ico.tint-indigo { background: rgba(79,70,229,.14); color: var(--c-indigo); }
.kind-ico.tint-amber { background: rgba(217,119,6,.15); color: var(--c-amber); }
.kind-ico.tint-violet { background: rgba(124,58,237,.14); color: var(--c-violet); }
.kind-ico.tint-cyan { background: rgba(8,145,178,.14); color: var(--c-cyan); }
.kind-ico.tint-pink { background: rgba(219,39,119,.13); color: var(--c-pink); }
.kind-ico.tint-slate { background: rgba(100,116,139,.15); color: var(--c-slate); }
.txn-row:hover .kind-ico { transform: rotate(-6deg) scale(1.06); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; }
.avatar.tint-indigo { background: #6366f1; } .avatar.tint-violet { background: #8b5cf6; } .avatar.tint-green { background: #10b981; }
.avatar.tint-amber { background: #f59e0b; } .avatar.tint-cyan { background: #06b6d4; } .avatar.tint-pink { background: #ec4899; }
.avatar.tint-red { background: #ef4444; } .avatar.tint-slate { background: #64748b; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }

/* ================= Home ================= */
.hero-card { position: relative; overflow: hidden; border-radius: 24px; padding: 22px 22px 20px; background: var(--hero-grad); color: #fff; box-shadow: var(--shadow-lg); animation: rise .5s var(--ease) both; }
.hero-bg span { position: absolute; border-radius: 50%; background: rgba(255,255,255,.12); animation: drift 9s ease-in-out infinite alternate; }
.hero-bg span:nth-child(1) { width: 220px; height: 220px; right: -60px; top: -80px; }
.hero-bg span:nth-child(2) { width: 140px; height: 140px; right: 80px; bottom: -70px; animation-delay: -3s; }
.hero-bg span:nth-child(3) { width: 90px; height: 90px; left: -30px; bottom: 30px; animation-delay: -6s; }
.hero-title { font-size: .95rem; opacity: .85; margin-top: 4px; }
.hero-amount { font-size: clamp(2.2rem, 7vw, 3rem); font-weight: 800; letter-spacing: -.02em; line-height: 1.1; display: flex; align-items: baseline; gap: 8px; }
.hero-cur { font-size: 1.1rem; opacity: .8; font-weight: 600; }
.hero-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.2); }
.hero-row > div { min-width: 0; }
.hero-row .fw-semibold { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .hero-row .fw-semibold { font-size: .86rem; } .hero-row { gap: 6px; } }

.alerts-row { display: flex; flex-direction: column; gap: 8px; }
.alert-pill { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; text-decoration: none; font-weight: 600; font-size: .9rem; animation: rise .4s var(--ease) both; transition: transform .2s var(--ease); }
.alert-pill:hover { transform: translateX(3px); }
.alert-pill.warn { background: rgba(245,158,11,.14); color: #92400e; }
.alert-pill.bad { background: rgba(225,29,72,.12); color: #9f1239; animation: rise .4s var(--ease) both, pulse 2.2s 0.4s infinite; }
.alert-pill.info { background: rgba(79,70,229,.12); color: #3730a3; }
[data-bs-theme="dark"] .alert-pill.warn { color: #fcd34d; }
[data-bs-theme="dark"] .alert-pill.bad { color: #fda4af; }
[data-bs-theme="dark"] .alert-pill.info { color: #c7d2fe; }

.quick-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 575.98px) { .quick-row { grid-template-columns: repeat(3, 1fr); } }
.quick-action { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px; border-radius: 16px; background: var(--surface); border: 1px solid var(--bs-border-color); color: var(--bs-body-color); text-decoration: none; text-align: center; animation: rise .45s var(--ease) both; animation-delay: calc(var(--i) * 60ms); transition: transform .25s var(--spring), box-shadow .25s; }
.quick-action:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: var(--bs-body-color); }
.quick-action:hover .kind-ico { transform: scale(1.12) rotate(-6deg); }

.float-strip { display: flex; gap: 12px; overflow-x: auto; padding: 4px 2px 10px; scroll-snap-type: x mandatory; scrollbar-width: thin; }
.float-card { flex: 0 0 200px; scroll-snap-align: start; border-radius: 18px; padding: 14px; color: #fff; background: var(--tile-grad); box-shadow: var(--shadow); animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 70ms); }
.float-card.is-low { animation: rise .5s var(--ease) both, pulse 2.4s 1s infinite; }

/* Float tints: gradients for float tiles and cards */
.float-card.tint-green, .float-tile.tint-green { --tile-grad: linear-gradient(135deg, #059669, #34d399); }
.float-card.tint-red, .float-tile.tint-red { --tile-grad: linear-gradient(135deg, #e11d48, #fb7185); }
.float-card.tint-indigo, .float-tile.tint-indigo { --tile-grad: linear-gradient(135deg, #4338ca, #818cf8); }
.float-card.tint-violet, .float-tile.tint-violet { --tile-grad: linear-gradient(135deg, #7c3aed, #c084fc); }
.float-card.tint-cyan, .float-tile.tint-cyan { --tile-grad: linear-gradient(135deg, #0e7490, #22d3ee); }
.float-card.tint-amber, .float-tile.tint-amber { --tile-grad: linear-gradient(135deg, #b45309, #fbbf24); }
.float-card.tint-slate, .float-tile.tint-slate { --tile-grad: linear-gradient(135deg, #334155, #94a3b8); }

.meter { height: 6px; border-radius: 6px; background: rgba(127,127,127,.22); overflow: hidden; margin-top: 10px; }
.meter-fill { display: block; height: 100%; width: var(--w); border-radius: 6px; background: var(--chart-1); animation: fill 1.1s .2s var(--ease) both; }
.float-card .meter, .float-tile .meter { background: rgba(255,255,255,.28); }
.float-card .meter-fill, .float-tile .meter-fill { background: #fff; }

/* Txn rows */
.txn-list .txn-row { animation: rise .4s var(--ease) both; animation-delay: calc(var(--i, 0) * 45ms); }
.txn-row { border-left: 0; border-right: 0; transition: background .2s, transform .2s var(--ease); }
.txn-row:hover { transform: translateX(2px); }
.txn-row.is-void { opacity: .6; }

/* Charts */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart-line { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw 1.4s .15s var(--ease) forwards; }
.chart-fill { opacity: 0; animation: fade .6s .9s forwards; }
.chart-dot { transform-box: fill-box; transform-origin: center; transform: scale(0); animation: pop .4s var(--spring) forwards; }
.chart-label { font-size: 10px; fill: var(--bs-secondary-color); font-family: inherit; }
.bar-rect { transform-box: fill-box; transform-origin: bottom; transform: scaleY(0); animation: grow .8s calc(var(--d, 0s) + .1s) var(--ease) forwards; }
.bar-col:hover .bar-rect { filter: brightness(1.15); }
.donut-seg { stroke-dasharray: 0 var(--c); animation: seg .9s var(--ease) forwards; }
@keyframes seg { to { stroke-dasharray: var(--len) var(--c); } }
.donut-center-big { font-size: 15px; font-weight: 800; fill: var(--bs-body-color); }
.donut-center-small { font-size: 9px; fill: var(--bs-secondary-color); }
.donut-legend li { border-bottom: 1px dashed var(--bs-border-color); }
.donut-legend li:last-child { border: 0; }

/* Ticket (transaction detail) */
.ticket { position: relative; background: var(--surface); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); border: 1px solid var(--bs-border-color); animation: rise .5s var(--ease) both; overflow: hidden; }
.ticket::before, .ticket::after { content: ''; position: absolute; top: 52%; width: 22px; height: 22px; border-radius: 50%; background: var(--app-bg); }
.ticket::before { left: -11px; } .ticket::after { right: -11px; }
.ticket.is-void { filter: grayscale(.6); }
.ticket.is-void::before { background: var(--app-bg); }
.ticket-head { display: flex; align-items: center; gap: 12px; }
.ticket-amount { margin: 16px 0 12px; border-top: 1px dashed var(--bs-border-color); padding-top: 14px; }
.ticket-amount .amt { font-size: 2.3rem; font-weight: 800; display: flex; gap: 8px; align-items: baseline; letter-spacing: -.02em; }
.ticket-amount .amt span { font-size: 1rem; opacity: .6; }
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 8px; }
.ticket-grid b { display: block; }
.detail-list { margin: 10px 0 0; display: grid; gap: 0; }
.detail-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px dashed var(--bs-border-color); }
.detail-list dt { font-weight: 500; color: var(--bs-secondary-color); font-size: .9rem; }
.detail-list dd { margin: 0; text-align: end; font-weight: 600; word-break: break-word; }

/* Reports */
.kpi-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 768px) { .kpi-grid { grid-template-columns: repeat(4, 1fr); } }
.kpi { background: var(--surface); border: 1px solid var(--bs-border-color); border-radius: 16px; padding: 14px; box-shadow: var(--shadow-sm); animation: rise .45s var(--ease) both; animation-delay: calc(var(--i) * 70ms); display: flex; flex-direction: column; gap: 4px; }
.kpi i { font-size: 1.3rem; color: var(--brand); }
.kpi b { font-size: 1.1rem; }
.report-table tbody tr { animation: rise .35s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.report-table td, .report-table th { white-space: nowrap; }

/* Floats page */
.float-hero { background: var(--hero-grad); color: #fff; border-radius: 22px; padding: 20px; box-shadow: var(--shadow-lg); animation: rise .5s var(--ease) both; }
.float-hero-amt { font-size: 2.2rem; font-weight: 800; display: flex; gap: 8px; align-items: baseline; }
.float-hero-amt span { font-size: 1rem; opacity: .75; }
.float-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.float-tile { background: var(--tile-grad); color: #fff; border-radius: 20px; padding: 16px; box-shadow: var(--shadow); position: relative; overflow: hidden; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 60ms); transition: transform .25s var(--ease), box-shadow .25s; }
.float-tile::after { content: ''; position: absolute; width: 160px; height: 160px; border-radius: 50%; right: -60px; top: -70px; background: rgba(255,255,255,.14); }
.float-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.float-tile .kind-ico { background: rgba(255,255,255,.2); color: #fff; }
.float-tile .text-truncate { color: #fff; }
.float-tile .small { color: rgba(255,255,255,.85) !important; }
.float-tile .tile-bal { font-size: 1.7rem; font-weight: 800; display: flex; gap: 8px; align-items: baseline; }
.float-tile .tile-bal span { font-size: .95rem; font-weight: 600; opacity: .85; }
.float-tile.is-low { animation: rise .5s var(--ease) both, pulse 2.4s 1s infinite; }
.btn-glass { background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.3); backdrop-filter: blur(4px); }
.btn-glass:hover { background: rgba(255,255,255,.3); color: #fff; }
.due-rows li { border-bottom: 1px dashed var(--bs-border-color); }
.due-rows li:last-child { border: 0; }
.due-card { background: rgba(245,158,11,.1); border-radius: 14px; padding: 12px 14px; }
.due-list li { display: flex; justify-content: space-between; padding: 2px 0; }

/* Services hub */
.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 768px) { .service-grid { grid-template-columns: repeat(3, 1fr); } }
.service-tile { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 20px; background: var(--surface); border: 1px solid var(--bs-border-color); color: var(--bs-body-color); text-decoration: none; box-shadow: var(--shadow-sm); animation: rise .5s var(--ease) both; animation-delay: calc(var(--i) * 55ms); transition: transform .25s var(--spring), box-shadow .25s, border-color .25s; position: relative; overflow: hidden; }
.service-tile::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 100% 0%, var(--tile-glow, rgba(79,70,229,.12)), transparent 60%); opacity: 0; transition: opacity .3s; }
.service-tile:hover { transform: translateY(-4px); box-shadow: var(--shadow); color: var(--bs-body-color); border-color: transparent; }
.service-tile:hover::before { opacity: 1; }
.service-tile:hover .kind-ico { transform: scale(1.1) rotate(-6deg); }
.service-tile small { line-height: 1.35; }
.service-tile.tint-green { --tile-glow: rgba(5,150,105,.22); } .service-tile.tint-red { --tile-glow: rgba(225,29,72,.2); }
.service-tile.tint-amber { --tile-glow: rgba(217,119,6,.22); } .service-tile.tint-violet { --tile-glow: rgba(124,58,237,.2); }
.service-tile.tint-indigo { --tile-glow: rgba(79,70,229,.2); } .service-tile.tint-cyan { --tile-glow: rgba(8,145,178,.2); }
.service-tile.tint-pink { --tile-glow: rgba(219,39,119,.2); } .service-tile.tint-slate { --tile-glow: rgba(100,116,139,.2); }

/* Transaction forms */
.tx-card { border-radius: 22px; animation: rise .5s var(--ease) both; }
.tx-form .form-label { font-weight: 600; font-size: .88rem; color: var(--bs-secondary-color); margin-bottom: 4px; }
.amount-wrap { position: relative; }
.amount-cur { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-weight: 700; color: var(--bs-secondary-color); pointer-events: none; }
.amount-input { font-size: 2rem; font-weight: 800; text-align: right; padding: .6rem .9rem .6rem 3.4rem; letter-spacing: -.01em; height: 70px; }
.amount-input:focus { animation: pulseBorder 1.2s; }
.quick-amounts .chip, .denoms .chip { padding: 6px 12px; }
.network-tabs .net-chip { position: relative; cursor: pointer; }
.net-chip input { position: absolute; opacity: 0; pointer-events: none; }
.net-chip span { display: inline-block; padding: 9px 16px; border-radius: 14px; border: 1.5px solid var(--bs-border-color); font-weight: 700; transition: all .2s var(--ease); background: var(--surface); }
.net-chip small { margin-left: 6px; font-size: .72rem; color: var(--bs-secondary-color); }
.net-chip input:checked + span { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 8px 18px -10px rgba(124,58,237,.8); transform: scale(1.03); }
.net-chip input:checked + span + small { color: var(--brand); }
.net-chip input:focus-visible + span { outline: 3px solid rgba(79,70,229,.4); }
.avail { min-height: 1.2em; }
.avail-pop { animation: rise .3s var(--ease) both; }
.count-box { background: var(--brand-soft); border-radius: 14px; padding: 12px 14px; }
.diff-box { display: flex; justify-content: space-between; align-items: center; border-radius: 14px; padding: 12px 16px; font-weight: 700; animation: pop .35s var(--spring); }
.diff-box.even { background: rgba(5,150,105,.12); color: var(--c-green); }
.diff-box.short { background: rgba(225,29,72,.12); color: var(--c-red); }
.diff-box.over { background: rgba(5,150,105,.12); color: var(--c-green); }
.diff-val { font-size: 1.2rem; }

.calc-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 10px; background: linear-gradient(135deg, rgba(79,70,229,.08), rgba(124,58,237,.08)); border-radius: 18px; padding: 14px; border: 1px solid rgba(124,58,237,.18); transition: opacity .2s; }
.calc-grid.muted { opacity: .5; }
.calc-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.calc-val { font-size: 1.12rem; animation: pop .4s var(--spring); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.calc-empty { padding: 10px 2px; }
@media (max-width: 480px) { .calc-grid { grid-template-columns: 1fr; } }

.flow { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; padding: 12px; border-radius: 18px; background: var(--brand-soft); }
.flow-node { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 70px; text-align: center; }
.flow-node small { font-size: .72rem; font-weight: 600; color: var(--bs-secondary-color); line-height: 1.15; }
.flow-track { flex: 1; height: 4px; border-radius: 4px; background: repeating-linear-gradient(90deg, rgba(124,58,237,.35) 0 8px, transparent 8px 14px); position: relative; overflow: hidden; }
.flow-dot { position: absolute; top: -4px; left: -10%; width: 12px; height: 12px; border-radius: 50%; background: var(--brand-grad); box-shadow: 0 0 10px rgba(124,58,237,.7); animation: flow 1.8s linear infinite; }
.flow-dot.d2 { animation-delay: .6s; } .flow-dot.d3 { animation-delay: 1.2s; }

.review-table td { padding: .55rem .25rem; }
.review-table tr:last-child td { font-size: 1.05rem; border-top: 2px solid var(--bs-border-color); }

/* Celebration overlay */
.celebrate { position: fixed; inset: 0; z-index: 3000; background: rgba(15,17,23,.55); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; transition: opacity .25s; }
.celebrate.show { opacity: 1; }
.cele-card { position: relative; background: var(--surface); border-radius: 28px; padding: 30px 24px 24px; width: min(420px, 100%); text-align: center; box-shadow: var(--shadow-lg); transform: scale(.9) translateY(10px); transition: transform .45s var(--spring); }
.celebrate.show .cele-card { transform: none; }
.cele-burst { position: absolute; left: 50%; top: 84px; width: 0; height: 0; pointer-events: none; }
.cele-burst i { position: absolute; width: 10px; height: 10px; border-radius: 3px; background: linear-gradient(135deg, #f59e0b, #ec4899); transform: rotate(var(--a)) translateY(0); opacity: 0; animation: burst .9s var(--ease) var(--d) forwards; }
.cele-burst i:nth-child(3n) { background: #34d399; } .cele-burst i:nth-child(3n+1) { background: #818cf8; }
.check { width: 96px; height: 96px; margin: 0 auto; display: block; }
.check-circle { stroke: #10b981; stroke-width: 3; stroke-dasharray: 151; stroke-dashoffset: 151; animation: draw .6s .1s var(--ease) forwards; }
.check-tick { stroke: #10b981; stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 36; stroke-dashoffset: 36; animation: draw .4s .55s var(--ease) forwards; }
.cele-title { font-weight: 800; margin-top: 10px; }
.cele-no { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--bs-secondary-color); font-weight: 600; }
.cele-amt { font-size: 2rem; font-weight: 800; margin: 6px 0 18px; }
.cele-actions .btn { min-width: 130px; }

/* Empty state & skeleton */
.empty-state { padding: 36px 16px; animation: rise .5s var(--ease) both; }
.es-icon { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 12px; display: grid; place-items: center; font-size: 1.8rem; background: var(--brand-soft); color: var(--brand); animation: float 3.2s ease-in-out infinite; }
.skeleton .skel { border-radius: 16px; background: linear-gradient(90deg, rgba(127,127,127,.12) 25%, rgba(127,127,127,.22) 50%, rgba(127,127,127,.12) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; margin-bottom: 12px; }
.alert { border-radius: 14px; border: 0; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }

/* Receipt (print) */
.receipt { font-family: 'Courier New', monospace; color: #000; background: #fff; padding: 2mm; }
.receipt.w58 { width: 58mm; font-size: 11px; } .receipt.w80 { width: 76mm; font-size: 12px; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 1px 0; vertical-align: top; }
.receipt .r { text-align: right; white-space: nowrap; }
.receipt .c { text-align: center; } .receipt .b { font-weight: 700; } .receipt .big { font-size: 1.2em; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; }
.receipt .ur { font-family: 'Jameel Noori Nastaleeq', serif; font-size: 1.15em; }
.report-print table { width: 100%; border-collapse: collapse; } .report-print td, .report-print th { border-bottom: 1px solid #ddd; padding: 6px; text-align: left; } .report-print .r { text-align: right; }

/* ================= Motion keyframes ================= */
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { transform: scale(.6); opacity: 0; } 70% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes fade { to { opacity: 1; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes fill { from { width: 0; } }
@keyframes dash { to { stroke-dashoffset: -28; } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes drift { from { transform: translate(0,0) scale(1); } to { transform: translate(24px, -18px) scale(1.08); } }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(225,29,72,.35); } 50% { box-shadow: 0 0 0 10px rgba(225,29,72,0); } }
@keyframes pulseBorder { 0% { box-shadow: 0 0 0 0 rgba(79,70,229,.35); } 100% { box-shadow: 0 0 0 12px rgba(79,70,229,0); } }
@keyframes ping { 0% { transform: scale(.9); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes toastIn { from { transform: translateY(-14px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes flow { 0% { left: -10%; } 100% { left: 100%; } }
@keyframes burst { 0% { opacity: 1; transform: rotate(var(--a)) translateY(0) scale(1); } 100% { opacity: 0; transform: rotate(var(--a)) translateY(-120px) scale(.6); } }
@keyframes coin { 0% { offset-distance: 0%; opacity: 0; } 10% { opacity: 1; } 90% { opacity: 1; } 100% { offset-distance: 100%; opacity: 0; } }

@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area { position: absolute; left: 0; top: 0; width: 100%; }
  .no-print { display: none !important; }
}
#print-area { display: none; }
#print-area:not(:empty) { display: block; }
@media print { #print-area { display: block; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .coin { display: none; }
}
