/* ShipZariya — cream + dark-bar theme (v6 design)
   Cream background, white cards, near-black store bar/drawer, violet primary #6C4CF1. */
:root {
  --bg1: #E9E7F2; --bg2: #DCD9EA;
  --primary: #6C4CF1; --primary-dark: #5839d6;
  --ink: #17171C; --muted: #6f6f7d;
  --card: rgba(255,255,255,.78); --card-border: rgba(255,255,255,.65);
  --input-bg: rgba(255,255,255,.9);
  --blue: #3B82F6; --green: #22C55E; --orange: #F59E0B; --purple: #8B5CF6;
  --red: #EF4444; --amber: #D97706;
  --shadow: 0 10px 30px rgba(40,35,80,.12);
  --radius: 18px;
}
[data-theme="dark"] {
  --bg1: #17171f; --bg2: #101016;
  --ink: #f2f2f7; --muted: #a3a3b2;
  --card: rgba(34,34,44,.85); --card-border: rgba(255,255,255,.08);
  --input-bg: rgba(255,255,255,.07);
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; overflow-x: hidden; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  background: linear-gradient(160deg, var(--bg1), var(--bg2));
  background-attachment: fixed;
  color: var(--ink);
  min-height: 100vh;
  min-height: 100dvh;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }

/* ---------- glass & controls ---------- */
.glass {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.btn {
  border: none; border-radius: 999px; padding: 12px 20px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  background: rgba(120,120,140,.15); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; transition: transform .12s ease, opacity .12s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; }
.btn.whatsapp { background: #25D366; color: #fff; }
.btn.ghost { background: transparent; border: 1px solid rgba(130,130,150,.4); }
.btn.glass-btn { background: var(--card); border: 1px solid var(--card-border); box-shadow: var(--shadow); }
.btn.full { width: 100%; margin-top: 10px; }
.btn.small { padding: 8px 14px; font-size: 13px; }
.btn.danger { background: rgba(239,68,68,.12); color: var(--red); }
.icon-btn {
  border: none; background: rgba(120,120,140,.15); color: var(--ink);
  width: 40px; height: 40px; border-radius: 50%; font-size: 18px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; flex: none;
}
.icon-btn.light { background: rgba(255,255,255,.12); color: #fff; }
input, select, textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 15px;
  border: 1px solid rgba(130,130,150,.25); background: var(--input-bg); color: var(--ink);
  outline: none; margin: 6px 0 10px;
}
input:focus, select:focus { border-color: var(--primary); }
label { font-size: 13px; font-weight: 600; color: var(--muted); display: block; margin-top: 6px; }
.form-error { color: var(--red); font-size: 13px; min-height: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row-gap { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 8px 0; }

/* ---------- auth (animated, premium) ---------- */
.auth-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 18px; position: relative; overflow: hidden;
}
.blob { position: absolute; border-radius: 50%; filter: blur(46px); pointer-events: none; z-index: 0; }
.blob.b1 { width: 300px; height: 300px; left: -90px; top: -70px; background: radial-gradient(circle at 35% 35%, #B7A6FF, #6C4CF1); opacity: .5; animation: blobFloat 11s ease-in-out infinite; }
.blob.b2 { width: 240px; height: 240px; right: -70px; top: 16%; background: radial-gradient(circle at 35% 35%, #FFE1A8, #F59E0B); opacity: .38; animation: blobFloat 13s ease-in-out infinite reverse; }
.blob.b3 { width: 280px; height: 280px; left: 22%; bottom: -120px; background: radial-gradient(circle at 35% 35%, #A7F3D0, #22B573); opacity: .32; animation: blobFloat 15s ease-in-out infinite 1.2s; }
[data-theme="dark"] .blob { opacity: .22; }
@keyframes blobFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(26px, -20px) scale(1.07); }
}
.auth-card {
  width: 100%; max-width: 400px; padding: 30px 24px 26px; position: relative; z-index: 1;
  box-shadow: 0 2px 6px rgba(40,35,80,.06), 0 14px 30px rgba(40,35,80,.13), 0 34px 64px rgba(76,54,190,.16), inset 0 1px 0 rgba(255,255,255,.9);
  animation: cardIn .55s cubic-bezier(.2,.75,.3,1) both;
}
@keyframes cardIn { from { opacity: 0; transform: translateY(22px) scale(.975); } to { opacity: 1; transform: none; } }
.auth-card .rise { animation: riseIn .55s cubic-bezier(.2,.75,.3,1) both; animation-delay: var(--d, 0s); }
@keyframes riseIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.auth-card h1 { margin: 10px 0 4px; font-size: 27px; font-weight: 800; letter-spacing: .2px; }
.auth-logo { display: flex; justify-content: center; }
.logo-svg {
  width: 78px; height: 78px; display: block;
  filter: drop-shadow(0 12px 22px rgba(88,57,214,.38));
  animation: floaty 4.6s ease-in-out infinite;
}
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.auth-tile {
  width: 78px; height: 78px; margin: 0 auto; border-radius: 22px; color: #fff;
  background: linear-gradient(140deg, #9D8BFF, #6C4CF1 55%, #4B2FD6);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 14px 26px rgba(88,57,214,.35), inset 0 1px 0 rgba(255,255,255,.35);
  animation: floaty 4.6s ease-in-out infinite;
}
.auth-tile svg { width: 38px; height: 38px; display: block; }
.auth-card .auth-logo + h1, .auth-card h1 { text-align: center; }
.auth-card p { text-align: center; }
.tabs { display: flex; background: rgba(120,120,140,.14); border-radius: 999px; padding: 4px; margin: 18px 0 8px; }
.tab { flex: 1; border: none; background: transparent; padding: 10px; border-radius: 999px; font-weight: 600; font-size: 15px; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--primary); color: #fff; }

/* ---------- shell ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  background: #141419; color: #fff; padding: 10px 14px;
}
.topbar .icon-btn { background: rgba(255,255,255,.12); color: #fff; }
.top-title { font-weight: 700; font-size: 17px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.top-pic { width: 36px; height: 36px; border-radius: 10px; object-fit: cover; }

.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 290px; max-width: 84vw; z-index: 50;
  background: #17171C; color: #fff; padding: 18px 14px;
  transform: translateX(-105%); transition: transform .28s ease;
  display: flex; flex-direction: column; overflow-y: auto;
}
.drawer.open { transform: translateX(0); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(10,10,20,.45); z-index: 40; }
.drawer-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.drawer-pic { width: 44px; height: 44px; border-radius: 12px; object-fit: cover; }
.drawer-appname { font-weight: 700; font-size: 16px; }
.drawer .muted { color: #9a9aa8; }
.menu-label { font-size: 11px; letter-spacing: 2px; color: #8a8a99; margin: 8px 6px; }
#sideMenu { display: flex; flex-direction: column; gap: 4px; }
.menu-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  background: transparent; border: none; color: #e8e8f0; text-align: left;
  padding: 12px 14px; border-radius: 14px; font-size: 15px; cursor: pointer;
}
.menu-item.active { background: var(--primary); color: #fff; box-shadow: 0 8px 18px rgba(108,76,241,.45); }
.badge { margin-left: auto; background: var(--red); color: #fff; font-size: 11px; font-weight: 700; border-radius: 999px; padding: 2px 8px; }
.account-card {
  margin-top: auto; background: rgba(255,255,255,.07); border-radius: 16px;
  padding: 12px; display: flex; gap: 10px; align-items: center;
}
.account-avatar { width: 42px; height: 42px; border-radius: 12px; background: var(--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.account-email { font-size: 13px; font-weight: 600; word-break: break-all; }
.account-sub { font-size: 12px; color: #b9b9c7; }
.account-sub.amber { color: #FBBF24; }
.account-sub.red { color: #F87171; }
.logout-btn { width: 100%; margin-top: 10px; background: rgba(255,255,255,.08); color: #fff; }

main { padding: 14px 14px 96px; max-width: 760px; margin: 0 auto; }
.view-head { display: flex; align-items: center; justify-content: space-between; margin: 4px 0 12px; }
.view-head h2 { margin: 0; font-size: 21px; }

/* bottom nav */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: var(--card); border-top: 1px solid var(--card-border);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.bottom-nav button {
  flex: 1; background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 0;
}
.bottom-nav button .bn-icon { font-size: 20px; }
.bottom-nav button.active { color: var(--primary); font-weight: 700; }

/* ---------- dashboard ---------- */
.pay-pill {
  display: inline-flex; align-items: center; gap: 8px; background: rgba(239,68,68,.12);
  color: var(--red); font-weight: 700; font-size: 13px; border-radius: 999px; padding: 6px 14px; margin-bottom: 10px;
}
.pay-pill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--red); animation: pulse 1.4s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.period-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; margin-bottom: 12px; }
.period-bar span { font-weight: 600; font-size: 14px; }
.period-bar select { width: auto; max-width: 52vw; margin: 0; border-radius: 999px; padding: 8px 12px; }
.custom-range { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.custom-range input { margin: 0; }
.hero {
  background: linear-gradient(135deg, #141419, #23202f); color: #fff;
  border-radius: 22px; padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -50px; top: -60px; width: 190px; height: 190px;
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, #9d8bff, #6C4CF1 60%, #3d2a8a);
  opacity: .85;
}
.hero-label { font-size: 11px; letter-spacing: 2px; color: #b9b9c7; }
.hero-amount { font-size: 36px; font-weight: 800; margin: 6px 0 2px; }
.hero-sub { color: #c9c9d6; font-size: 13px; position: relative; z-index: 1; }
.hero-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.hero-cell { background: rgba(255,255,255,.07); border-radius: 16px; padding: 14px; min-width: 0; }
.hero-cell-label { font-size: 11px; letter-spacing: 1.5px; color: #b9b9c7; }
.hero-cell-value { font-size: 24px; font-weight: 800; margin: 4px 0 2px; }
.hero-cell-value.green { color: #4ADE80; }
/* v21.10.1: the Net Profit hero value never wraps — fitNetHero() in
   app.js shrinks only this value's font when a long amount would
   otherwise break onto two lines and stretch both hero tiles.
   (.hero-cell also gains min-width: 0 above so a nowrap value can
   never stretch its grid column wider than its 1fr share and
   squash the neighbouring tile — the fit is measured against the
   tile's true width.) */
#dNetHero { white-space: nowrap; }
.hero-cell-sub { font-size: 12px; color: #a9a9ba; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 12px; }
.stat { padding: 14px 6px; text-align: center; }
.stat-num { font-size: 24px; font-weight: 800; }
.stat-num.blue { color: var(--blue); } .stat-num.green { color: var(--green); }
.stat-num.orange { color: var(--orange); } .stat-num.purple { color: var(--purple); }
.stat-label { font-size: 10px; letter-spacing: 1px; color: var(--muted); margin-top: 3px; }
.period-left { display: inline-flex; align-items: center; gap: 8px; }
.period-left svg { width: 19px; height: 19px; display: block; color: var(--primary); }

/* ---------- cards & lists ---------- */
.card { padding: 16px; margin-bottom: 12px; }
.card-title { font-weight: 700; font-size: 15px; margin-bottom: 8px; }
.summary-strip { padding: 14px 16px; margin-bottom: 12px; font-weight: 600; }
.product-card { padding: 16px; margin-bottom: 10px; }
.product-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.product-name { font-weight: 700; font-size: 16px; }
.stock-pill { background: #17171C; color: #fff; border-radius: 999px; padding: 5px 12px; font-size: 12px; font-weight: 700; white-space: nowrap; }
[data-theme="dark"] .stock-pill { background: #fff; color: #17171C; }
.low-flag { color: var(--red); font-weight: 700; font-size: 12px; }
.product-meta { color: var(--muted); font-size: 13px; margin-top: 4px; line-height: 1.55; }
.card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.card-actions .btn { padding: 8px 14px; font-size: 13px; }
.order-card { padding: 14px 16px; margin-bottom: 10px; }
.order-top { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.order-no { font-weight: 700; }
.status-pill { border-radius: 999px; padding: 4px 11px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.status-pill.in_transit { background: rgba(59,130,246,.14); color: var(--blue); }
.status-pill.delivered { background: rgba(34,197,94,.14); color: #16A34A; }
.status-pill.kept { background: rgba(107,114,128,.14); color: #6B7280; }
.status-pill.returned { background: rgba(245,158,11,.16); color: var(--amber); }
.filter-row { display: flex; gap: 8px; margin-bottom: 12px; }
.filter-row input { flex: 1; margin: 0; min-width: 0; }
.filter-row select { width: auto; margin: 0; }
/* v20: the Orders filter row also carries the City filter — on narrow phones
   the two selects drop to their own row so nothing is squeezed. */
@media (max-width: 560px) {
  .filter-row { flex-wrap: wrap; }
  .filter-row input { flex: 1 1 100%; }
  .filter-row select { flex: 1; }
}
.find-row { display: flex; gap: 8px; }
.find-row input { flex: 1; margin: 0; }
.find-row .btn { flex: none; }
.found-box { margin-top: 12px; background: rgba(108,76,241,.08); border-radius: 14px; padding: 12px; }
.scan-video { width: 100%; border-radius: 14px; background: #000; max-height: 300px; }
.manage-card { padding: 18px 16px; margin-bottom: 12px; }
.manage-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.manage-name { font-size: 19px; font-weight: 800; }
.manage-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; text-align: center; }
.manage-num { font-size: 21px; font-weight: 800; }
.manage-lbl { font-size: 9.5px; letter-spacing: .5px; color: var(--muted); margin-top: 2px; }
table.fin { width: 100%; border-collapse: collapse; font-size: 13px; }
table.fin th, table.fin td { padding: 9px 8px; text-align: right; border-bottom: 1px solid rgba(130,130,150,.15); white-space: nowrap; }
table.fin th:first-child, table.fin td:first-child { text-align: left; white-space: normal; }
table.fin th { color: var(--muted); font-size: 11px; letter-spacing: .5px; }
.table-scroll { overflow-x: auto; }
.activity-item { padding: 12px 16px; margin-bottom: 8px; font-size: 14px; }
.activity-item .when { color: var(--muted); font-size: 12px; margin-top: 2px; }
.set-pic { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; }
.tappable { cursor: pointer; }

/* ---------- users / licensing ---------- */
.user-card { padding: 16px; margin-bottom: 10px; }
/* v21.8: Users & Licenses — search/filter tools, on-card expiry line,
   detail-view stat grid and the reminder preview. */
.user-card { cursor: pointer; }
.users-tools { padding: 14px 16px; margin-bottom: 12px; }
.users-tools input[type="search"] { margin-bottom: 10px; }
.users-tools select { margin-bottom: 0; }
.expiry-line { font-weight: 600; }
.expiry-line.amber { color: var(--amber); }
.expiry-line.red { color: var(--red); }
.ud-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 6px; text-align: center; }
.reminder-preview { white-space: pre-wrap; background: rgba(108,76,241,.07); border: 1px solid rgba(108,76,241,.18); border-radius: 12px; padding: 12px; font-size: 13.5px; line-height: 1.6; margin-top: 10px; }
.user-card.expiring { border: 1.5px solid rgba(245,158,11,.65); }
.user-card.locked, .user-card.grace { border: 1.5px solid rgba(239,68,68,.55); }
.tag { border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; }
.tag.amber { background: rgba(245,158,11,.16); color: var(--amber); }
.tag.red { background: rgba(239,68,68,.14); color: var(--red); }
.tag.green { background: rgba(34,197,94,.14); color: #16A34A; }
.tag.gray { background: rgba(130,130,150,.16); color: var(--muted); }
.tag.trial { background: rgba(108,76,241,.15); color: var(--purple); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 6px; }
.chip { border: 1px solid rgba(130,130,150,.4); background: transparent; border-radius: 999px; padding: 7px 13px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit; color: inherit; }
.chip.active { background: var(--purple); border-color: var(--purple); color: #fff; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 60; background: rgba(12,10,25,.5);
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal { width: 100%; max-width: 430px; max-height: 92vh; overflow-y: auto; padding: 20px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.modal-head h3 { margin: 0; font-size: 18px; }
.scroll-list { max-height: 55vh; overflow-y: auto; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 80;
  background: #17171C; color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; box-shadow: var(--shadow); max-width: 92vw; text-align: center;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.view, .product-card, .order-card, .manage-card { animation: rise .3s ease both; }
@media (max-width: 380px) {
  .stat-num { font-size: 20px; }
  .manage-num { font-size: 17px; }
  .hero-amount { font-size: 30px; }
}

/* ================= v4 — hosted-app look (cream scheme, stat cards, line icons) ================= */
:root {
  --bg1: #F4EFE6; --bg2: #EAE1CF;
  --card: #FFFFFF; --card-border: rgba(23,23,28,.06);
  --muted: #7C7668;
  --input-bg: #FFFFFF;
}
[data-theme="dark"] {
  --bg1: #17171f; --bg2: #101016;
  --card: #1D1D24; --card-border: rgba(255,255,255,.08);
  --muted: #a3a3b2; --input-bg: rgba(255,255,255,.07);
}
.glass {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
/* floating dark store bar */
.topbar {
  margin: 10px 10px 0; border-radius: 20px; top: 10px;
  padding: 10px 12px; box-shadow: var(--shadow);
}
.top-main { flex: 1; min-width: 0; }
.top-date { font-size: 12px; color: #B9B9C7; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-pill {
  background: rgba(255,255,255,.14); color: #fff; border: none; flex: none;
  padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: 13px; cursor: pointer;
  font-family: inherit;
}
.topbar .icon-btn svg { width: 20px; height: 20px; display: block; }
.icon-btn.light svg { width: 18px; height: 18px; display: block; }
/* drawer + nav line icons */
.menu-item .mi { display: inline-flex; align-items: center; justify-content: center; width: 22px; flex: none; }
.menu-item .mi svg { width: 21px; height: 21px; display: block; }
.menu-item .mi-dollar { font-weight: 800; font-size: 17px; }
.bottom-nav button .bn-icon { display: inline-flex; align-items: center; justify-content: center; }
.bottom-nav button .bn-icon svg { width: 23px; height: 23px; display: block; }
.bottom-nav button.active .bn-icon { background: #EFEAFE; border-radius: 999px; padding: 4px 13px; }
[data-theme="dark"] .bottom-nav button.active .bn-icon { background: rgba(108,76,241,.28); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn svg { width: 19px; height: 19px; }
/* dashboard stat cards */
.dgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dcard {
  position: relative; background: var(--card); border: 1px solid var(--card-border);
  border-radius: 20px; padding: 14px; box-shadow: var(--shadow); overflow: hidden; min-height: 122px;
}
.dcard.dark { background: #17171C; color: #fff; border-color: #17171C; }
[data-theme="dark"] .dcard.dark { background: #26262F; border-color: #26262F; }
.dcard-label { font-size: 11px; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; max-width: 65%; line-height: 1.5; min-height: 33px; }
.dcard.dark .dcard-label { color: #A9A9BA; }
.dcard-value { font-size: 23px; font-weight: 800; margin-top: 10px; letter-spacing: -0.9px; }
.dcard-sub { color: #1F9D63; font-size: 12.5px; font-weight: 600; margin-top: 3px; line-height: 1.4; max-width: 76%; }
.tile {
  position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border-radius: 13px;
  display: flex; align-items: center; justify-content: center; color: #fff;
}
.tile svg { width: 23px; height: 23px; display: block; }
.tile-dollar { font-size: 21px; font-weight: 800; line-height: 1; }
.bars { position: absolute; right: 12px; bottom: 10px; display: flex; align-items: flex-end; gap: 2.5px; height: 16px; }
.bars span { width: 3.5px; border-radius: 2px; background: var(--acc, #6C4CF1); opacity: .38; }
.bars span:nth-child(1) { height: 6px; } .bars span:nth-child(2) { height: 10px; }
.bars span:nth-child(3) { height: 7px; } .bars span:nth-child(4) { height: 13px; }
.bars span:nth-child(5) { height: 9px; } .bars span:nth-child(6) { height: 15px; }
.bars span:nth-child(7) { height: 11px; }
/* sales breakdown */
.breakdown { margin-top: 12px; padding: 18px 16px 8px; }
.bd-title { font-size: 19px; font-weight: 800; }
.bd-sub { color: var(--muted); font-size: 13px; margin: 3px 0 6px; }
.bd-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(120,120,140,.14); font-size: 14.5px; }
.bd-row:last-child { border-bottom: none; }
.bd-k { color: var(--muted); }
.bd-v { font-weight: 700; text-align: right; white-space: nowrap; }
.bd-row.net .bd-k { color: var(--ink); font-weight: 700; }
.bd-row.net .bd-v { color: #1F9D63; }

/* ---------- couriers, settings managers, inline icons ---------- */
.courier-chip {
  display: inline-flex; align-items: center; gap: 5px; vertical-align: -4px;
  background: rgba(108,76,241,.1); color: var(--primary-dark);
  border-radius: 999px; padding: 2.5px 9px 2.5px 7px; font-size: 11.5px; font-weight: 700;
  margin-left: 6px; white-space: nowrap;
}
[data-theme="dark"] .courier-chip { background: rgba(108,76,241,.25); color: #C4B5FD; }
.courier-chip svg { width: 14px; height: 14px; display: block; flex: none; }
.courier-chip.empty { background: rgba(130,130,150,.14); color: var(--muted); }
.mgr-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-bottom: 1px solid rgba(130,130,150,.15); padding: 7px 0;
}
.mgr-row:last-of-type { border-bottom: none; }
.mgr-empty { padding: 6px 0 2px; }
.h3-flex { display: flex; align-items: center; gap: 8px; }
.h3-flex svg { width: 21px; height: 21px; display: block; color: var(--orange); flex: none; }
.modal-head .icon-btn svg { width: 18px; height: 18px; display: block; }
.warn-ic { width: 14px; height: 14px; display: inline-block; vertical-align: -2px; }
.btn.whatsapp svg { width: 19px; height: 19px; }
.help-ic { width: 21px; height: 21px; display: inline-block; vertical-align: -4px; margin-right: 7px; color: var(--primary); }

/* ================= DESKTOP LAYOUT (laptop / wide screens) =================
   Mobile stays exactly as designed. On wide screens the drawer becomes a
   permanent left sidebar, the bottom nav disappears, and content goes wide
   with multi-column grids — a proper desktop portal. */
@media (min-width: 1024px) {
  #appShell { padding-left: 280px; }
  .drawer {
    transform: none !important; transition: none;
    width: 280px; max-width: 280px;
    box-shadow: 6px 0 24px rgba(20, 16, 40, .18);
  }
  .drawer-backdrop { display: none !important; }
  .drawer-head .icon-btn { display: none; }        /* no close X in sidebar */
  .topbar { margin: 16px 22px 0; top: 16px; }
  .topbar > .icon-btn { display: none; }           /* no hamburger in sidebar mode */
  .bottom-nav { display: none !important; }
  main { max-width: 1220px; padding: 18px 22px 48px; }
  .dgrid { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .stat-grid { gap: 14px; }
  .hero { padding: 26px 28px; }
  .hero-amount { font-size: 44px; }
  #productList { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
  #manageList { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: start; }
  #trackList { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; align-items: start; }
  #userList { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; align-items: start; }
  .view .card, .view .glass { margin-bottom: 14px; }
  #productList .card, #manageList .card, #trackList .card, #userList .card { margin-bottom: 0; }
  .auth-card { max-width: 430px; }
  .modal-card { max-width: 520px; }
}

/* danger zone / legal (store compliance) */
.btn.warn { background: rgba(245,158,11,.14); color: #B45309; }
.card.danger-card { border: 1px solid rgba(229,72,77,.45); }
.card-title.danger-title { color: #C0322B; }
/* ---------- plans & pricing stacked deck (v10; full-screen view v11;
   v12 cards: dark dashboard body, domed accent header) ---------- */
.plans-deck { width: 100%; margin: 2px 0; text-align: left; overflow: hidden; }
.plans-stage {
  position: relative; width: 100%; height: 408px;
  touch-action: pan-y; cursor: grab; user-select: none; -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.plans-stage.dragging { cursor: grabbing; }
.plan-card {
  position: absolute; left: 50%; bottom: 0; width: 72%; max-width: 300px; height: 376px;
  margin: 0; border-radius: 22px; padding: 0;
  transform-origin: 50% 100%;
  transition: transform .55s cubic-bezier(.22,.9,.28,1), opacity .4s ease, box-shadow .45s ease, border-color .45s ease;
}
.plan-card.slot-center { transform: translateX(-50%) rotate(0deg) scale(1); opacity: 1; z-index: 3; }
.plan-card.slot-left { transform: translateX(calc(-50% - 62%)) rotate(-7deg) scale(.93); opacity: .85; z-index: 1; cursor: pointer; }
.plan-card.slot-right { transform: translateX(calc(-50% + 62%)) rotate(7deg) scale(.93); opacity: .85; z-index: 2; cursor: pointer; }
/* entrance: deck fans out from a collapsed stack when the pane/screen shows */
.plans-deck:not(.in) .plan-card { transform: translateX(-50%) translateY(16px) rotate(0deg) scale(.94); opacity: 0; }
.plans-deck.entering .plan-card.slot-left { transition-delay: .08s; }
.plans-deck.entering .plan-card.slot-right { transition-delay: .16s; }
/* drag: centre card follows the finger, the incoming card leans in */
.plans-stage.dragging .plan-card { transition: none; }
.plans-stage.dragging .plan-card.slot-center { transform: translateX(calc(-50% + var(--dragdx, 0px))) rotate(var(--dragrot, 0deg)) scale(1); }
.plans-stage.dragging[data-dir="next"] .plan-card.slot-right { transform: translateX(calc(-50% + 62%)) rotate(7deg) scale(calc(.93 + var(--boost, 0))); }
.plans-stage.dragging[data-dir="prev"] .plan-card.slot-left { transform: translateX(calc(-50% - 62%)) rotate(-7deg) scale(calc(.93 + var(--boost, 0))); }
/* v12 card anatomy (Ahmad's pricing reference + the app dashboard theme):
   near-black body like the dashboard hero, a domed accent header zone with
   the plan name + big price, accent check chips, a Select Plan pill and a
   thin accent line along the bottom edge. Each plan brings its accent via
   --acc1/2/3. (The soft top-right ball the reference had was removed in v16
   at Ahmad's order — it rendered half-clipped and read as a glitch.) */
.plan-card {
  color: #fff; border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(160deg, #1B1B22, #121218);
  box-shadow: 0 16px 34px rgba(10,9,20,.45);
}
.plan-blue { --acc1: #5EA0FF; --acc2: #2E7CF6; --acc3: #1D5FD1; --accSoft: rgba(46,124,246,.30); }
.plan-featured { --acc1: #9D8BFF; --acc2: #6C4CF1; --acc3: #4B2FD6; --accSoft: rgba(108,76,241,.34); }
.plan-green { --acc1: #34D399; --acc2: #22B573; --acc3: #0E9F6E; --accSoft: rgba(34,181,115,.30); }
.plan-inner {
  position: relative; height: 100%; border-radius: inherit; overflow: hidden;
  display: flex; flex-direction: column;
}
/* domed header zone: a layer wider than the card, its bottom corners rounded
   into a smooth dome; its height matches .plan-head so the list starts below it */
.plan-inner::before {
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 160%; height: 146px; z-index: 0;
  background: linear-gradient(160deg, var(--acc1), var(--acc2) 55%, var(--acc3));
  border-bottom-left-radius: 50% 42px; border-bottom-right-radius: 50% 42px;
}
/* thin accent line along the card's bottom edge (the reference's accent bar) */
.plan-inner::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; z-index: 3;
  background: linear-gradient(90deg, var(--acc1), var(--acc3));
}
.plan-pop {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, #FF5A4E, #E5322D); color: #fff;
  border-radius: 999px; padding: 5px 14px; font-size: 10.5px; font-weight: 800;
  letter-spacing: 1.1px; text-transform: uppercase; white-space: nowrap;
  box-shadow: 0 8px 18px rgba(229,50,45,.45);
}
.plan-head { position: relative; z-index: 2; flex: none; height: 146px; box-sizing: border-box; text-align: center; padding: 18px 14px 0; }
.plan-name { font-weight: 800; font-size: 13px; letter-spacing: 2.2px; text-transform: uppercase; color: rgba(255,255,255,.92); }
.plan-price { font-size: 32px; font-weight: 800; margin-top: 5px; color: #fff; }
.plan-featured .plan-price { font-size: 36px; }
.plan-meta { color: rgba(255,255,255,.88); font-size: 12.5px; margin-top: 3px; }
.plan-meta .save { color: #FFDF8E; font-weight: 800; }
.plan-feats { position: relative; z-index: 2; flex: none; list-style: none; margin: 12px 0 0; padding: 0 20px; display: flex; flex-direction: column; gap: 8px; }
.plan-feats li { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 500; color: #fff; }
.plan-check { flex: none; width: 19px; height: 19px; border-radius: 50%; background: var(--accSoft); color: #fff; display: inline-flex; align-items: center; justify-content: center; }
.plan-check svg { width: 11px; height: 11px; display: block; }
.plan-select {
  position: relative; z-index: 2; flex: none; margin: auto 20px 16px; padding: 10px 16px;
  border-radius: 999px; font-family: inherit; font-size: 13.5px; font-weight: 700;
  cursor: pointer; transition: transform .2s ease, box-shadow .25s ease;
}
.plan-featured .plan-select {
  background: linear-gradient(90deg, var(--acc1), var(--acc2) 60%, var(--acc3));
  color: #fff; border: none; box-shadow: 0 10px 22px var(--accSoft);
}
.plan-blue .plan-select, .plan-green .plan-select { background: transparent; border: 1.5px solid var(--acc2); color: var(--acc1); }
.plan-select:active { transform: scale(.97); }
.plans-dots { display: flex; justify-content: center; gap: 6px; padding: 4px 0 6px; }
.plan-dot { width: 8px; height: 8px; border-radius: 999px; border: none; padding: 0; background: rgba(108,76,241,.25); cursor: pointer; transition: width .3s ease, background .3s ease; }
.plan-dot.on { width: 22px; background: var(--primary); }
/* full-screen plans view (v11; enlarged in v14): the same deck, bigger —
   stage spans the whole content width, with a taller domed header to match.
   The locked screen keeps the compact default sizing above, with slightly
   tighter type so all six features + the button fit its stage. */
.view-head-spacer { width: 40px; flex: none; }
/* v14: big strong centred title (near-black on light, pure white on dark —
   Ahmad found the default title too faint on his phone), no status line or
   payment note, and a bigger deck: cards ~92% wide / 400px tall. The stock
   ±62% slot offsets scale with card width, so the side cards still peek
   ~26-28px behind the centre card; the deck clips them, page never widens. */
#view-plans .view-head h2, #view-download .view-head h2 { font-size: 27px; font-weight: 800; color: #141419; text-align: center; }
[data-theme="dark"] #view-plans .view-head h2, [data-theme="dark"] #view-download .view-head h2 { color: #FFFFFF; }
/* overflow visible (scoped): the side cards paint past the deck box out to
   the screen edges — html/body already carry overflow-x:hidden, so the page
   never widens — which is what lets a ~26px strip of each side card show
   beside the 92%-wide centre card. The locked deck keeps the clipped box. */
#view-plans .plans-deck { margin-top: 10px; overflow: visible; }
#view-plans .plans-stage { height: 432px; }
#view-plans .plan-card { width: 92%; max-width: 400px; height: 400px; }
#view-plans .plan-head { height: 162px; padding-top: 24px; }
#view-plans .plan-inner::before { height: 162px; }
#view-plans .plan-price { font-size: 34px; }
#view-plans .plan-featured .plan-price { font-size: 38px; }
#view-plans .plan-feats { gap: 9px; padding: 0 22px; }
#view-plans .plan-feats li { font-size: 14px; }
#lockedScreen .plan-head { height: 140px; }
#lockedScreen .plan-inner::before { height: 140px; }
#lockedScreen .plan-price { font-size: 29px; }
#lockedScreen .plan-featured .plan-price { font-size: 31px; }
#lockedScreen .plan-meta { font-size: 11.5px; }
#lockedScreen .plan-feats { gap: 6px; margin-top: 10px; padding: 0 17px; }
#lockedScreen .plan-feats li { font-size: 12.5px; }
#lockedScreen .plan-check { width: 17px; height: 17px; }
#lockedScreen .plan-select { margin: auto 17px 13px; padding: 8px 14px; font-size: 13px; }
/* The locked card scrolls internally above a 94vh cap. The cap MUST have a
   floor: in some Android WebViews / in-app HTML viewers the vh unit resolves
   to a small stuck first-layout height, which crushed this card to a thin
   ~130px strip showing only a slice of the plans deck. max() keeps the exact
   94vh behaviour wherever vh is sane (>= ~511px viewport) and never lets the
   window drop below a usable 480px; dvh variants track the visible viewport
   where supported. */
#lockedScreen .auth-card {
  max-height: 94vh;
  max-height: 94dvh;
  max-height: max(94vh, 480px);
  max-height: max(94dvh, 480px);
  overflow-y: auto;
}
@media (prefers-reduced-motion: reduce) {
  .plan-card { transition: none; }
  .plans-deck:not(.in) .plan-card { opacity: 1; }
  .plans-deck:not(.in) .plan-card.slot-center { transform: translateX(-50%) rotate(0deg) scale(1); }
  .plans-deck:not(.in) .plan-card.slot-left { transform: translateX(calc(-50% - 62%)) rotate(-7deg) scale(.93); }
  .plans-deck:not(.in) .plan-card.slot-right { transform: translateX(calc(-50% + 62%)) rotate(7deg) scale(.93); }
}

/* ------- download app view (v15; browser-only, hidden inside the APK) ------- */
.dl-card { margin-bottom: 12px; }
.dl-top { display: flex; align-items: center; gap: 14px; position: relative; z-index: 1; }
.dl-logo { width: 58px; height: 58px; flex: none; display: block; filter: drop-shadow(0 10px 18px rgba(88,57,214,.35)); }
.dl-title { margin: 0 0 4px; font-size: 20px; font-weight: 800; }
.dl-android { display: flex; align-items: center; gap: 6px; margin: 0; color: #4ADE80; font-weight: 700; font-size: 14px; }
.dl-android-ic { width: 19px; height: 19px; flex: none; }
.dl-meta { position: relative; z-index: 1; color: #c9c9d6; font-size: 13px; margin: 16px 0 14px; }
.dl-btn { position: relative; z-index: 1; width: 100%; padding: 14px; font-size: 16px; font-weight: 700; text-decoration: none; }
.dl-btn svg { width: 20px; height: 20px; }
.dl-steps h3 { margin: 0 0 6px; font-size: 16px; }
.dl-steps ol { margin: 0; padding-left: 20px; }
.dl-steps li { margin: 7px 0; font-size: 14px; line-height: 1.5; }
.dl-note { text-align: center; font-size: 13px; margin: 4px 8px 0; }

/* ------- finance: business layer + courier invoice analyzer (v17) ------- */
.biz-card { padding-bottom: 14px; }
.biz-net {
  background: linear-gradient(135deg, #17171C, #2A2145);
  color: #fff; border-radius: 16px; padding: 16px; margin-bottom: 10px;
}
.biz-net .biz-lbl { color: #b9b9c7; }
.biz-net-num { font-size: 30px; font-weight: 800; margin: 4px 0 2px; }
.biz-net-sub { color: #a9a9ba; font-size: 12px; }
.biz-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.biz-tile { background: rgba(120,120,140,.08); border-radius: 14px; padding: 12px; }
.biz-num { font-size: 19px; font-weight: 800; }
.biz-num.purple { color: var(--purple); } .biz-num.green { color: #16A34A; }
.biz-num.orange { color: var(--orange); } .biz-num.red { color: var(--red); }
.biz-lbl { font-size: 10px; letter-spacing: 1px; color: var(--muted); margin-top: 3px; font-weight: 700; }
.acct-row {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 10px 2px; border-bottom: 1px solid rgba(130,130,150,.15);
}
.acct-row:last-of-type { border-bottom: none; }
.acct-name { font-weight: 700; font-size: 14px; }
.acct-bal { font-weight: 800; font-size: 16px; white-space: nowrap; }
.amt-in { color: #16A34A; } .amt-out { color: var(--red); } .amt-inv { color: var(--purple); }
.daily-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid rgba(130,130,150,.12); font-size: 14px; }
.daily-row:last-child { border-bottom: none; }
.inv-upload-btn { display: block; text-align: center; cursor: pointer; box-sizing: border-box; text-decoration: none; }
.inv-analysing { display: flex; align-items: center; gap: 14px; margin-top: 14px; padding: 14px; border-radius: 14px; background: rgba(108,76,241,.08); }
.spin {
  width: 26px; height: 26px; flex: none; border-radius: 50%;
  border: 3px solid rgba(108,76,241,.25); border-top-color: var(--primary);
  animation: invspin .8s linear infinite;
}
@keyframes invspin { to { transform: rotate(360deg); } }
.inv-head { margin-top: 14px; font-size: 15px; }
.inv-summary { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.inv-chip { background: rgba(120,120,140,.12); border-radius: 999px; padding: 6px 12px; font-size: 12.5px; font-weight: 700; }
.inv-chip.ok { background: rgba(34,197,94,.15); color: #16A34A; }
.inv-chip.warn { background: rgba(245,158,11,.18); color: var(--amber); }
table.fin.inv td:first-child { white-space: nowrap; font-weight: 600; }
tr.inv-nf td { background: rgba(245,158,11,.10); }
.inv-cards { display: none; }
.inv-card { border: 1px solid rgba(130,130,150,.18); border-radius: 14px; padding: 12px; margin-bottom: 8px; }
.inv-card.inv-nf { background: rgba(245,158,11,.10); border-color: rgba(245,158,11,.4); }
.inv-track { font-weight: 700; font-size: 14px; }
.inv-success { margin-top: 14px; background: rgba(34,197,94,.10); border: 1px solid rgba(34,197,94,.35); border-radius: 14px; padding: 16px; }
.inv-success-title { font-weight: 800; font-size: 16px; color: #16A34A; margin-bottom: 8px; }
.inv-success-lines { font-size: 14px; line-height: 1.9; margin-bottom: 6px; }
@media (max-width: 560px) {
  .inv-table-wrap { display: none; }
  .inv-cards { display: block; }
  .biz-num { font-size: 17px; }
}

/* ---------- v18: grouped settings, entry sheet, bell ---------- */
/* settings home: grouped rows */
.set-group-label{font-size:11px;font-weight:800;letter-spacing:.12em;color:var(--muted);margin:18px 4px 8px}
.set-group-label:first-child{margin-top:2px}
.set-list{border-radius:20px;padding:6px}
.set-row{display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:transparent;border:0;padding:11px 8px;cursor:pointer;color:var(--txt);font-family:inherit;border-bottom:1px solid var(--line)}
.set-row:last-child{border-bottom:0}
.set-ic{width:38px;height:38px;border-radius:12px;display:inline-flex;align-items:center;justify-content:center;flex:none}
.set-ic svg{width:21px;height:21px}
.set-row-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}
.set-title{font-weight:700;font-size:15px}
.set-sub{font-size:12.5px;color:var(--muted)}
.set-chev{font-size:22px;color:var(--muted);line-height:1;flex:none}
.set-back{display:inline-flex;align-items:center;gap:2px;background:transparent;border:0;color:var(--primary);font-weight:800;font-size:15px;font-family:inherit;cursor:pointer;padding:6px 0 12px}
/* bell + notifications panel */
.bell-btn{position:relative}
.bell-btn.has-unread{color:#FF7A7A;background:rgba(239,68,68,.28)}
.bell-badge{position:absolute;top:1px;right:1px;min-width:18px;height:18px;padding:0 5px;border-radius:999px;background:var(--red);color:#fff;font-size:11px;font-weight:800;line-height:1;display:inline-flex;align-items:center;justify-content:center;border:2px solid rgba(20,16,40,.55);box-sizing:border-box}
.notif-head-actions{display:inline-flex;align-items:center;gap:6px}
.notif-readall{background:transparent;border:0;color:var(--primary);font-weight:800;font-size:12.5px;font-family:inherit;cursor:pointer;padding:6px 4px}
.notif-panel{position:fixed;top:64px;right:12px;left:12px;max-width:440px;margin-left:auto;z-index:90;border-radius:20px;padding:14px;box-shadow:0 24px 60px rgba(20,16,40,.28)}
@media(min-width:700px){.notif-panel{left:auto;width:420px}}
.notif-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.notif-item{display:flex;gap:11px;padding:11px 4px;border-top:1px solid var(--line);cursor:pointer}
.notif-item:first-of-type{border-top:0}
.notif-item.unread{background:rgba(108,76,241,.05);border-radius:14px;padding:11px 8px}
.notif-main{flex:1;min-width:0}
.notif-title{font-weight:800;margin-bottom:2px}
.notif-btn{margin-top:9px;padding:8px 16px;font-size:13.5px}
.notif-new{font-size:10px;font-weight:900;letter-spacing:.08em;color:var(--red);flex:none;margin-top:3px}
/* add-entry sheet */
.type-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-bottom:4px}
.type-btn{display:flex;align-items:center;gap:10px;padding:13px 12px;border-radius:16px;border:1.5px solid var(--line);background:rgba(255,255,255,.55);color:var(--txt);font-family:inherit;font-weight:800;font-size:14.5px;cursor:pointer;text-align:left}
[data-theme="dark"] .type-btn{background:rgba(255,255,255,.06)}
.type-btn.active{border-color:var(--primary);background:rgba(108,76,241,.1)}
.type-ic{width:32px;height:32px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;font-size:16px;font-weight:900;flex:none}
/* finance unified entries */
.card-title-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px}
.fin-add-btn{width:40px;height:40px;border-radius:50%;font-size:22px;line-height:1;padding:0}
.entry-filters{margin:0 0 12px}
.entry-kind{display:inline-flex;align-items:center;gap:8px}
.entry-ic{width:26px;height:26px;border-radius:9px;display:inline-flex;align-items:center;justify-content:center;font-size:13px;font-weight:900}
.entry-ic.in{background:rgba(34,197,94,.14);color:#16A34A}
.entry-ic.expense{background:rgba(239,68,68,.12);color:var(--red)}
.entry-ic.investment{background:rgba(139,92,246,.14);color:var(--purple)}
.entry-ic.udhaar{background:rgba(59,130,246,.13);color:var(--blue)}
.amt-ud{color:var(--blue)}
.tag.gray{background:rgba(130,130,150,.16);color:var(--muted)}
.entry-item{margin-bottom:8px}
.entry-item.reversed{opacity:.6}
.entry-item .rev-amt{text-decoration:line-through}
.fx-box{background:rgba(59,130,246,.08);border:1px solid rgba(59,130,246,.18);border-radius:12px;padding:10px 12px;font-size:13px;color:var(--muted);margin:12px 0 4px;line-height:1.5}

/* ---------- v21: payout card + invoice reconciliation ---------- */
#payoutCard{margin-top:12px}
#payoutCard .bd-row{padding:7px 0}
.sz-recon{margin-top:10px}
.sz-recon .bd-row{padding:6px 0;font-size:13.5px}
.sz-recon-warn{color:var(--red);font-weight:600;font-size:13px;padding-top:6px}
.sz-recon-ok{color:#1F9D63;font-weight:600}

/* ---------- v21.5: dashboard style RESTORED to the v17-era original
   (the v16 package rules, byte-for-byte): tiles are flat — label,
   value, sub in flow, icon chip ABSOLUTELY positioned top-right
   (12/12, 44×44) — value one fixed 23px, hero amount 36px, hero
   cells 24px. The v21.2 header row, v21.3 auto-shrink and v21.4
   uniform-18px experiments are all reverted at Ahmad's order; no
   dynamic value sizing exists anywhere. Kept from the v21 line:
   only the Latest Payout placement (renderPayoutCard, app.js) and
   the payout/recon CSS above. ---------- */

/* ---------- v21.7: order View Details rows + Your backups list ----------
   New classes only — nothing existing is restyled. */
.detail-rows { display: flex; flex-direction: column; }
.detail-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 8px 2px; border-bottom: 1px solid rgba(128,128,140,.18); }
.detail-row:last-child { border-bottom: none; }
.detail-label { color: var(--muted); font-size: 13px; white-space: nowrap; }
.detail-value { font-weight: 600; font-size: 13.5px; text-align: right; word-break: break-word; }
.detail-row.sub .detail-label { padding-left: 16px; }
.detail-row.sub .detail-value { font-weight: 500; }
/* v21.7.2: the row is STACKED (name / date+size / buttons, each on
   its own line). The v21.7 flex row was broken on phones: the
   .backup-actions group (flex-shrink: 0, three buttons ≈ 290px)
   took nearly the whole card width and squeezed .backup-main into
   a ~20px column, where word-break: break-all stacked the file
   name letter-by-letter and buried the date/size line (Ahmad's
   phone screenshot). The name now takes the full row width and
   wraps only at natural points (after hyphens) — break-all is
   gone — and the buttons get their own full-width row. */
.backup-row { padding: 12px 2px; border-bottom: 1px solid rgba(128,128,140,.18); }
.backup-row:last-child { border-bottom: none; }
.backup-main { min-width: 0; }
.backup-name { font-weight: 600; font-size: 13.5px; overflow-wrap: break-word; }
.backup-meta { margin-top: 2px; }
.backup-actions { display: flex; gap: 6px; margin-top: 10px; }
.backup-actions .btn { flex: 1; }
/* ---------- v21.7.1: low-ratio gate decision UI — a "Fix Now" pill
   in the bulk result table (in place of the v21.7 above-table warning
   cards) opening the standard centered popup with the group's detail
   card and Allow Dispatch / Deny Hold. ---------- */
.status-pill.fix-now { border: none; cursor: pointer; font-family: inherit; -webkit-appearance: none; appearance: none; background: rgba(239,68,68,.16); color: var(--red); }
.status-pill.fix-now:active { transform: scale(.96); }
.gate-detail { border: 1px solid rgba(239,68,68,.4); background: rgba(239,68,68,.06); border-radius: 14px; padding: 6px 14px; margin-bottom: 12px; }
.gate-detail .detail-value.bad { color: var(--red); font-weight: 800; font-size: 16px; }
.gate-suggest { font-size: 13px; padding: 8px 2px 10px; border-top: 1px solid rgba(239,68,68,.25); }

/* ---------- v21.9: payment status, receipts, refer & earn ---------- */
.account-email-row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.account-email-row .account-email { flex: 1 1 auto; min-width: 0; }
.pay-pill-mini { background: var(--green); color: #fff; font-size: 10px; font-weight: 800; letter-spacing: .6px; border-radius: 999px; padding: 2px 8px; flex: none; }
.pay-badge { border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.pay-badge.paid { background: rgba(34,197,94,.16); color: #16A34A; }
.pay-badge.pending { background: rgba(245,158,11,.18); color: var(--amber); }
.pay-badge.inactive { background: rgba(239,68,68,.12); color: var(--red); }
.tag-row { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-items: center; }
.receipt-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.receipt-thumb { background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; text-align: center; }
.receipt-thumb img { width: 76px; height: 76px; object-fit: cover; border-radius: 12px; display: block; }
.receipt-thumb span { font-size: 11px; color: var(--muted); display: block; margin-top: 4px; }
.receipt-full { width: 100%; border-radius: 14px; display: block; }
.ref-code { font-size: 27px; font-weight: 800; letter-spacing: 2px; text-align: center; margin: 6px 0 12px; word-break: break-all; }
.ref-est { font-size: 28px; font-weight: 800; letter-spacing: -.5px; margin: 2px 0 6px; }
.ref-counts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 4px; text-align: center; }
.ref-counts .ud-num { font-size: 22px; font-weight: 800; }
.ref-counts .ud-label { font-size: 9.5px; font-weight: 700; letter-spacing: .5px; color: var(--muted); margin-top: 2px; }
.ladder-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 12px; border: 1px solid transparent; font-size: 13.5px; }
.ladder-row + .ladder-row { margin-top: 6px; }
.ladder-row.done { opacity: .7; }
.ladder-row.on { background: rgba(139,92,246,.13); border-color: var(--purple); font-weight: 700; }
.ref-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid rgba(130,130,150,.14); }
.ref-row:last-child { border-bottom: none; padding-bottom: 2px; }

/* ---------- v21.10: finance polish ---------- */
/* Import result button rows (invoice + bulk): the two buttons share
   one line at one height — no wrap, no two-line "Undo" button. */
.row-gap.btn-row-nowrap { flex-wrap: nowrap; }
.row-gap.btn-row-nowrap .btn { flex: 1 1 0; white-space: nowrap; height: 48px; padding-top: 0; padding-bottom: 0; box-sizing: border-box; }

/* Business Summary as a dashboard-family hero: same dark grading and
   sub-tile language as the Gross Sale hero, different tint + ball
   placement so the two screens are family, not copies. */
.fin-hero {
  background: linear-gradient(150deg, #101623, #1d2440 70%, #232038); color: #fff;
  border-radius: 22px; padding: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden;
  margin-bottom: 14px;
}
.fin-hero::after {
  content: ""; position: absolute; left: -60px; bottom: -80px; width: 180px; height: 180px;
  border-radius: 50%; background: radial-gradient(circle at 35% 35%, #7dd3fc, #3B82F6 55%, #6C4CF1);
  opacity: .55;
}
.fin-hero-eyebrow { font-size: 11px; letter-spacing: 2px; font-weight: 700; color: #9fb4d8; margin-bottom: 14px; position: relative; z-index: 1; }
.fin-hero .hero-label { position: relative; z-index: 1; }
.fin-hero-amount { font-size: 34px; font-weight: 800; margin: 6px 0 2px; position: relative; z-index: 1; letter-spacing: -.5px; }
.fin-hero .hero-sub { margin-bottom: 2px; }
.fin-hero-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; position: relative; z-index: 1; }
.fin-cell-value { font-size: 20px; font-weight: 800; margin-top: 4px; }
.fin-cell-value.purple { color: #C4B5FD; } .fin-cell-value.green { color: #4ADE80; }
.fin-cell-value.orange { color: #FBBF24; } .fin-cell-value.red { color: #FCA5A5; }

/* Entries controls: one filter dropdown + a proper Add Entry button. */
.entry-controls { display: flex; gap: 10px; align-items: stretch; margin: 10px 0 14px; }
.entry-controls select { flex: 1 1 auto; margin: 0; min-width: 0; }
.entry-add-btn { flex: none; white-space: nowrap; padding: 12px 18px; }

/* Entry cards: clean stacked card — amount row, category · note line,
   date · account line, then ONE action line (View Details · Reverse ·
   Delete) divided from the body. */
.entry-card { padding: 14px 16px; margin-bottom: 10px; }
.entry-card-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.entry-card-top .entry-kind b { font-size: 17px; }
.entry-tags { display: inline-flex; gap: 6px; align-items: center; flex: none; }
.entry-card-main { font-size: 14.5px; font-weight: 600; margin-top: 9px; line-height: 1.45; }
.entry-card-meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.entry-card.reversed { opacity: .62; }
.entry-card .rev-amt { text-decoration: line-through; }
.entry-actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 11px; border-top: 1px solid rgba(130,130,150,.16); }
.entry-act {
  flex: 1 1 0; border: none; background: transparent; cursor: pointer;
  font-size: 13.5px; font-weight: 700; color: var(--primary); padding: 6px 2px;
  white-space: nowrap; text-align: center; border-radius: 8px;
}
.entry-act:active { background: rgba(108,76,241,.1); }
.entry-act.danger { color: var(--red); }

/* ===== FREE MODE (2026-11-12, Ahmad's order) =====================
   The app is free for everyone: Plans & Pricing, Refer, the register
   referral field and the licence filter are HIDDEN, not removed.
   Set FREE_MODE = false (app.js + server.js) to bring them back. */
body.free-mode [data-nav="plans"],
body.free-mode [data-nav="refer"],
body.free-mode #regRefWrap,
body.free-mode #userFilter,
body.free-mode label[for="userFilter"] { display: none !important; }
