/* PY Watch House – midnight navy & champagne gold */
:root {
  color-scheme: dark;
  --bg: #0b1220; --card: #131c2e; --card2: #1a2539; --ink: #e7ecf5; --muted: #8c99b3; --line: #233049;
  --gold: #d6b25e; --gold2: #f1d999; --gold3: #a8853a; --navy: #1a2539;
  --green: #3ecf8e; --red: #ff7a7a; --amber: #f5b955; --wa: #25d366;
  --gold-grad: linear-gradient(135deg, #f1d999 0%, #d6b25e 50%, #b48f3f 100%);
  --shadow: 0 10px 30px -12px rgba(0,0,0,.6);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { overscroll-behavior-y: contain;
  background: radial-gradient(90% 50% at 85% -5%, rgba(214,178,94,.10), transparent 60%),
              radial-gradient(80% 50% at 0% 0%, rgba(70,110,200,.14), transparent 60%), var(--bg); background-attachment: fixed; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.err { color: var(--red); min-height: 1em; margin: 4px 0; font-size: 13px; }
h1, h2, h3 { margin: 0; }
a { color: inherit; }
.serif { font-family: Georgia, "Times New Roman", serif; }

/* ---------- Watch (live analog clock) ---------- */
.watch .w-bezel { fill: none; stroke: var(--gold); stroke-width: 2.4; }
.watch .w-face { fill: #0e1628; stroke: #2b3a58; stroke-width: 1; }
.watch .tk { stroke: #4b5a78; stroke-width: .6; }
.watch .tk-b { stroke: var(--gold2); stroke-width: 1.8; stroke-linecap: round; }
.watch .w-h { stroke: #f4f6fb; stroke-width: 3.2; stroke-linecap: round; }
.watch .w-m { stroke: #f4f6fb; stroke-width: 2.2; stroke-linecap: round; }
.watch .w-s { stroke: var(--gold); stroke-width: .9; stroke-linecap: round; }
.watch .w-pin { fill: var(--gold); }
.watch .w-brand { fill: var(--gold); font: bold 8px Georgia, serif; text-anchor: middle; letter-spacing: 1px; }
.watch { filter: drop-shadow(0 8px 20px rgba(0,0,0,.45)); }

/* Splash */
.splash { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; background: var(--bg); transition: opacity .5s, transform .5s; }
.splash .watch { width: 130px; height: 130px; animation: pop .7s cubic-bezier(.2,1.4,.4,1) both; }
.splash h1 { font: bold 24px Georgia, serif; letter-spacing: 1px; background: var(--gold-grad); -webkit-background-clip: text;
  background-clip: text; color: transparent; animation: rise .7s .25s both; }
.splash.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
@keyframes pop { from { transform: scale(.4) rotate(-90deg); opacity: 0; } }
@keyframes rise { from { transform: translateY(12px); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Login */
.login { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px 16px; text-align: center; }
.login-clock { position: relative; width: 150px; height: 150px; }
.login-clock::before { content: ""; position: absolute; inset: -12px; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0 70%, rgba(214,178,94,.6) 100%); animation: spin 4s linear infinite;
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63%); mask: radial-gradient(circle, transparent 62%, #000 63%); }
.login-clock .watch { width: 100%; height: 100%; position: relative; }
.login h1 { margin-top: 22px; font: bold 28px Georgia, serif; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.login .muted { margin: 6px 0 22px; letter-spacing: .5px; }
.login .card { width: 100%; max-width: 360px; text-align: left; box-shadow: var(--shadow); }

/* Shell */
.icon-btn { background: none; border: 0; color: var(--gold2); font-size: 22px; padding: 0 6px; }
#phead { max-width: 720px; margin: 0 auto; padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px 0; }
main { padding: 0 16px calc(100px + var(--safe-b)); max-width: 720px; margin: 0 auto; }
main.enter > * { animation: rise .35s both; }
main.enter > *:nth-child(2) { animation-delay: .05s; } main.enter > *:nth-child(3) { animation-delay: .1s; }
main.enter > *:nth-child(4) { animation-delay: .15s; } main.enter > *:nth-child(n+5) { animation-delay: .2s; }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; background: rgba(15,23,40,.94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabbar a { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 8px; font-size: 11px; color: var(--muted); text-decoration: none; transition: color .2s; }
.tabbar svg { width: 23px; height: 23px; transition: transform .25s; }
.tabbar a.active { color: var(--gold2); font-weight: 600; }
.tabbar a.active svg { transform: translateY(-1px) scale(1.08); }
.tabbar a::before { content: ""; position: absolute; top: 0; left: 50%; width: 0; height: 2px; border-radius: 2px;
  background: var(--gold); transform: translateX(-50%); transition: width .25s; }
.tabbar a.active::before { width: 28px; }


/* ---------- Home ---------- */
.hero { position: relative; overflow: hidden; border-radius: 18px; padding: 12px 14px; margin-bottom: 14px;
  background: linear-gradient(140deg, #22345c 0%, #16213a 55%, #121b2f 100%); border: 1px solid #2c3d62; box-shadow: var(--shadow); }
.hero::before { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(214,178,94,.22), transparent 70%); }
.hero::after { content: ""; position: absolute; top: -40%; left: -60%; width: 40%; height: 180%; transform: rotate(20deg);
  background: linear-gradient(90deg, transparent, rgba(241,217,153,.07), transparent); animation: shine 6s ease-in-out infinite; }
@keyframes shine { 0%, 60% { left: -60%; } 100% { left: 130%; } }
.hero-top { position: relative; display: flex; align-items: center; gap: 12px; }
.hero-clock { width: 52px; height: 52px; flex: none; }
.hero-txt small { color: #a9b5cf; display: block; font-size: 12.5px; }
.hero-txt { min-width: 0; }
.hero-txt h3 { font: bold 18px Georgia, serif; color: var(--gold2); margin: 0 0 1px; }
.hero-time { margin-top: 6px; font: 600 22px ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: 1px; }
.hero-sales { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
  margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255,255,255,.08); }
.hero-sales small { color: #a9b5cf; font-size: 12.5px; }
.hero-sales b { display: block; font-size: 25px; line-height: 1.15; letter-spacing: -.5px; }
.pill { display: inline-block; margin-top: 4px; font-size: 11.5px; color: #c9d3e6; background: rgba(255,255,255,.08); padding: 2px 9px; border-radius: 99px; }
.hero-sales .btn { flex: none; padding: 9px 14px; }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px 6px 12px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; font-size: 12.5px; font-weight: 600; text-align: center; transition: transform .15s, border-color .2s; }
.tile svg { width: 42px; height: 42px; padding: 10px; border-radius: 12px; color: var(--gold2); background: rgba(214,178,94,.12); }
.tile:active { transform: scale(.96); border-color: var(--gold3); }

.chart-card { position: relative; overflow: hidden; margin-bottom: 12px; padding: 12px 12px 8px; border-radius: 16px; color: #1b2540;
  background: linear-gradient(135deg, #fffaf0 0%, #f7ebd0 55%, #ecd9ae 100%); border: 1px solid #ead9b0; box-shadow: 0 12px 28px -14px rgba(0,0,0,.6); }
.chart-card::before { content: ""; position: absolute; right: -40px; top: -50px; width: 150px; height: 150px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.75), transparent 70%); pointer-events: none; }
.chart-head { position: relative; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.chart-head small { display: block; font-size: 11.5px; color: #7a6a48; }
.chart-head b { display: block; font-size: 20px; line-height: 1.2; letter-spacing: -.3px; color: #14203a; }
.chart-tip { position: absolute; top: -4px; right: -4px; font-size: 11.5px; color: #5b5240; background: rgba(255,255,255,.65); border: 1px solid rgba(180,143,63,.25);
  border-radius: 10px; padding: 4px 9px; text-align: right; max-width: 58%; }
.chart-tip b { display: inline; font-size: 12px; color: #14203a; }
.bars { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; height: 104px; margin-top: 4px; padding-top: 16px; }
.bcol { display: flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: 0; padding: 0; font: inherit; font-size: 10.5px; color: #7a6a48; cursor: pointer; }
.bwrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid rgba(122,106,72,.3); }
.bcol i { position: relative; width: 34%; max-width: 14px; border-radius: 5px 5px 1px 1px; background: linear-gradient(180deg, #c3cfe6, #93a6cc);
  transition: background .2s; animation: growY .7s ease-out both; transform-origin: bottom; }
.bcol em { position: absolute; left: 50%; bottom: 100%; transform: translateX(-50%); margin-bottom: 2px; font: 700 10px system-ui, sans-serif; color: #14203a; white-space: nowrap; opacity: 0; transition: opacity .2s; }
.bcol.today i { background: linear-gradient(180deg, #f1d999, #d6b25e 55%, #a8853a); box-shadow: 0 4px 12px -4px rgba(168,133,58,.8); }
.bcol:not(.today).sel i { background: linear-gradient(180deg, #4a65a0, #1f2f52); }
.bcol.sel em, .bcol.today em { opacity: 1; }
.bcol.today span, .bcol.sel span { color: #14203a; font-weight: 700; }
@keyframes growY { from { transform: scaleY(0); } }

.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpi { display: block; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.kpi small { color: var(--muted); font-size: 12px; display: block; }
.kpi b { display: block; font-size: 19px; margin: 2px 0; }
.kpi span { color: var(--muted); font-size: 12px; }

.hscroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; scroll-snap-type: x mandatory; }
.mini { flex: none; width: 150px; scroll-snap-align: start; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.mini b { display: block; margin: 8px 0 2px; font-size: 14px; line-height: 1.3; height: 2.6em; overflow: hidden; }
.mini small { color: var(--muted); font-size: 12px; }

/* ---------- Components ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
.stat small { color: var(--muted); font-size: 12px; }
.stat b { display: block; font-size: 21px; margin-top: 2px; }
.stat.dark { background: linear-gradient(140deg, #22345c, #16213a); border-color: #2c3d62; }
.stat.dark small { color: #a9b5cf; } .stat.dark b { color: var(--gold2); }
.sec-title { display: flex; justify-content: space-between; align-items: center; margin: 20px 2px 10px; font-weight: 600; font-size: 15.5px; }
.sec-title a { font-size: 13px; color: var(--gold); text-decoration: none; font-weight: 500; }

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
label small { opacity: .8; }
label.check { display: flex; align-items: center; gap: 8px; color: var(--ink); }
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--gold); }
input, select, textarea { display: block; width: 100%; margin-top: 4px; padding: 11px 12px; font: inherit; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; background: #0e1626; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214,178,94,.18); }
input:disabled { opacity: .6; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; min-width: 0; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 11px 16px; border-radius: 12px; cursor: pointer;
  border: 1px solid var(--line); background: var(--card2); color: var(--ink); font: inherit; font-weight: 600; text-decoration: none; transition: transform .1s; }
.btn.primary { background: #2a3d66; border-color: #36507f; color: #fff; }
.btn.gold { background: var(--gold-grad); color: #1a1406; border-color: transparent; }
.btn.wa { background: var(--wa); color: #06210f; border-color: var(--wa); }
.btn.danger { color: var(--red); border-color: #4a2a35; background: #1f1824; }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.sq { padding: 0; width: 46px; flex: none; }
.btn.block { width: 100%; }
.btn:active { transform: scale(.97); }
.btns { display: flex; gap: 8px; flex-wrap: wrap; } .btns .btn { flex: 1; }

.scanrow { display: flex; gap: 8px; align-items: stretch; }
.scanrow input { margin-top: 0; flex: 1; min-width: 0; }
label .scanrow { margin-top: 4px; }
.scanbox { display: grid; gap: 8px; margin-bottom: 10px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.scanbig { padding: 14px; font-size: 16px; }
.code { display: inline-block; font: 700 11px ui-monospace, Menlo, Consolas, monospace; letter-spacing: .5px; color: var(--gold2);
  background: rgba(214,178,94,.12); border: 1px solid rgba(214,178,94,.25); padding: 1px 6px; border-radius: 6px; margin-bottom: 3px; }

.search { position: sticky; top: 0; z-index: 4; background: var(--bg); padding: 2px 0 8px; }
.list { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.item { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item:active { background: var(--card2); }
.item .main { flex: 1; min-width: 0; }
.item .main b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .main small { color: var(--muted); }
.item .end { text-align: right; white-space: nowrap; }
.avatar { width: 38px; height: 38px; flex: none; border-radius: 50%; display: grid; place-items: center;
  font-weight: 700; color: var(--gold2); background: #1f2c47; border: 1px solid #2c3d62; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; }
.badge.ok { background: rgba(62,207,142,.14); color: var(--green); }
.badge.due { background: rgba(255,122,122,.14); color: var(--red); }
.badge.low { background: rgba(245,185,85,.15); color: var(--amber); }
.chip { background: var(--gold-grad); color: #1a1406; font-size: 12px; font-weight: 700; padding: 5px 12px; border-radius: 99px; }
.chips { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 10px; scrollbar-width: none; }
.chips button { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 99px; padding: 6px 13px; font: inherit; font-size: 13px; }
.chips button.on { background: var(--gold-grad); color: #1a1406; border-color: transparent; font-weight: 600; }

.green { color: var(--green); } .red { color: var(--red); } .amber { color: var(--amber); }
.tot { display: flex; justify-content: space-between; padding: 4px 0; }
.tot.big { font-size: 19px; font-weight: 700; color: var(--gold2); border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 8px; }
.line-item { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex: none; }
.qty button { width: 32px; height: 30px; border: 0; background: var(--card2); color: var(--gold2); font-size: 18px; }
.qty input { width: 44px; margin: 0; border: 0; border-radius: 0; text-align: center; padding: 4px; }
.price-in { width: 100px; margin: 0; padding: 6px 8px; }

/* Bottom sheet */
.sheet { position: fixed; inset: 0; z-index: 20; background: rgba(3,7,15,.7); display: flex; align-items: center; justify-content: center; padding: 16px;
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.sheet-body { width: 100%; max-width: 440px; max-height: 86vh; overflow-y: auto; background: var(--card);
  border: 1px solid #2c3d62; border-radius: 20px; padding: 18px 16px; box-shadow: 0 24px 60px rgba(0,0,0,.6); animation: zoomIn .22s cubic-bezier(.2,1.2,.4,1); }
.sheet-body h3 { margin-bottom: 12px; color: var(--gold2); }
@keyframes zoomIn { from { transform: scale(.88); opacity: 0; } }
@keyframes fadeIn { from { opacity: 0; } }

/* Confirm dialog */
.ask { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(3,7,15,.72); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fadeIn .15s; }
.ask-box { width: 100%; max-width: 340px; text-align: center; background: var(--card); border: 1px solid #2c3d62; border-radius: 22px;
  padding: 22px 18px 16px; box-shadow: 0 24px 60px rgba(0,0,0,.6); animation: zoomIn .22s cubic-bezier(.2,1.2,.4,1); }
.ask-ic { width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font: 800 24px Georgia, serif;
  color: var(--gold2); background: rgba(214,178,94,.14); border: 2px solid rgba(214,178,94,.4); }
.ask-ic.danger { color: var(--red); background: rgba(255,122,122,.12); border-color: rgba(255,122,122,.4); }
.ask-box h3 { font-size: 18px; margin-bottom: 6px; }
.ask-box p { color: var(--muted); margin: 0 0 4px; font-size: 14px; }
.ask-box .btns { margin-top: 18px; }
.btn.dangerfill { background: #e35d5d; border-color: #e35d5d; color: #fff; }

/* Page heading (sub pages) */
.pagehead { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; min-height: 40px; }
.pagehead h2 { font: bold 21px Georgia, serif; color: var(--gold2); }
.backbtn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--gold2); }
.backbtn:active { transform: scale(.94); }

/* Swipe-back hint */
.swipe-hint { position: fixed; left: 0; top: 50%; z-index: 80; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  font-size: 30px; line-height: 1; color: #1a1406; background: var(--gold-grad); opacity: 0; pointer-events: none; transform: translate(-50px, -50%);
  box-shadow: 0 6px 18px rgba(0,0,0,.5); }

/* Install (download) button */
.install-fab { position: fixed; right: 16px; bottom: calc(78px + var(--safe-b)); z-index: 15; width: 52px; height: 52px; border-radius: 50%;
  border: 0; display: grid; place-items: center; color: #1a1406; background: var(--gold-grad); box-shadow: 0 10px 24px rgba(214,178,94,.35); }
.install-fab::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 2px solid rgba(214,178,94,.5); animation: pulse 2s ease-out infinite; }
@keyframes pulse { to { transform: scale(1.35); opacity: 0; } }

.toast { position: fixed; left: 50%; bottom: calc(150px + var(--safe-b)); transform: translateX(-50%); z-index: 60;
  background: #f4f6fb; color: #0b1220; font-weight: 600; padding: 10px 18px; border-radius: 99px; font-size: 14px; max-width: 90vw; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .2s; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.toast.show { opacity: 1; }

.inv-img { width: 100%; border-radius: 10px; display: block; }
.bar { height: 8px; background: var(--card2); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.bar i { display: block; height: 100%; background: var(--gold-grad); animation: grow .8s ease-out both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }

/* Loader */
.loader { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 30px 0; }
.spin-watch { position: relative; width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--gold); }
.spin-watch i, .spin-watch b { position: absolute; left: 50%; bottom: 50%; width: 2px; margin-left: -1px; border-radius: 2px; transform-origin: bottom center; background: var(--gold2); }
.spin-watch i { height: 16px; animation: spin 1s linear infinite; }
.spin-watch b { height: 11px; animation: spin 6s linear infinite; }

/* ---------- Scanner ---------- */
.scanner { position: fixed; inset: 0; z-index: 40; background: #05080f; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px calc(16px + var(--safe-b)); }
.scan-top { display: flex; justify-content: space-between; align-items: center; color: var(--gold2); font-size: 17px; margin-bottom: 12px; }
.scan-view { position: relative; flex: 1; min-height: 0; border-radius: 18px; overflow: hidden; background: #000; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
#scanReader { width: 100%; }
#scanReader video { width: 100% !important; }
.scan-frame { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.scan-frame i { position: relative; width: 74%; height: 38%; border: 2px solid var(--gold); border-radius: 14px; box-shadow: 0 0 0 999px rgba(0,0,0,.45); overflow: hidden; }
.scan-frame i::after { content: ""; position: absolute; left: 6%; right: 6%; height: 2px; background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; animation: sweep 1.8s ease-in-out infinite alternate; }
@keyframes sweep { from { top: 8%; } to { top: 92%; } }
.scan-hint { text-align: center; color: var(--muted); font-size: 13px; margin: 12px 0; }

/* ---------- Stickers ---------- */
.sticker-prev { display: flex; justify-content: center; padding: 14px; border-radius: 12px; background: repeating-linear-gradient(45deg, #1a2539 0 8px, #172134 8px 16px); }
.sticker-prev .stk { zoom: 1.7; box-shadow: 0 4px 14px rgba(0,0,0,.4); }
.printbar { position: sticky; bottom: calc(66px + var(--safe-b)); z-index: 4; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding: 10px 12px; background: rgba(19,28,46,.96); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }

.stk { background: #fff; color: #000; font-family: Arial, Helvetica, sans-serif; display: flex; flex-direction: column;
  border: .2mm dashed #9a9a9a; overflow: hidden; break-inside: avoid; page-break-inside: avoid; }
.stk-body { display: flex; gap: 1mm; flex: 1; min-height: 0; }
.stk-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.stk-shop { font-weight: 700; color: #444; text-transform: uppercase; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stk-name { font-weight: 700; line-height: 1.12; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.stk-sub { color: #333; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stk-price { font-weight: 800; margin-top: auto; }
.stk-qr { flex: none; }
.stk-qr svg { display: block; width: 100%; height: 100%; }
.stk-bar svg { display: block; width: 100%; height: 100%; }
.stk-code { text-align: center; font-weight: 700; letter-spacing: .6px; line-height: 1; }
.stk-s { width: 38mm; height: 25mm; padding: 1.3mm 1.6mm 1mm; }
.stk-s .stk-shop { font-size: 4.6pt; } .stk-s .stk-name { font-size: 6.3pt; } .stk-s .stk-price { font-size: 8.5pt; }
.stk-s .stk-qr { width: 11mm; height: 11mm; } .stk-s .stk-bar { height: 5mm; margin-top: .8mm; } .stk-s .stk-code { font-size: 6pt; margin-top: .4mm; }
.stk-m { width: 50mm; height: 30mm; padding: 1.6mm 2mm 1.2mm; }
.stk-m .stk-shop { font-size: 5.2pt; } .stk-m .stk-name { font-size: 7.5pt; } .stk-m .stk-sub { font-size: 6pt; } .stk-m .stk-price { font-size: 10.5pt; }
.stk-m .stk-qr { width: 13mm; height: 13mm; } .stk-m .stk-bar { height: 6mm; margin-top: 1mm; } .stk-m .stk-code { font-size: 7pt; margin-top: .5mm; }
.stk-l { width: 63mm; height: 38mm; padding: 2mm 2.5mm 1.5mm; }
.stk-l .stk-shop { font-size: 6pt; } .stk-l .stk-name { font-size: 9pt; } .stk-l .stk-sub { font-size: 7pt; } .stk-l .stk-price { font-size: 13pt; }
.stk-l .stk-qr { width: 17mm; height: 17mm; } .stk-l .stk-bar { height: 8mm; margin-top: 1.2mm; } .stk-l .stk-code { font-size: 8pt; margin-top: .6mm; }

#printArea { display: none; }
@media print {
  @page { size: A4; margin: 15mm 10mm; }
  :root { color-scheme: light !important; }
  html, body { background: #fff !important; background-image: none !important; color: #000 !important; margin: 0 !important; padding: 0 !important; }
  #printArea { background: #fff; }
  body > *:not(#printArea) { display: none !important; }
  #printArea { display: block !important; }
  .sheet-a4 { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; }
  .stk { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
input::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ---------- Home: quick actions (round icons, no boxes) ---------- */
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 6px; margin: 4px 0 18px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 7px; text-decoration: none; font-size: 12.5px; font-weight: 600; color: #cfd7e6; }
.act > span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; color: #fff;
  box-shadow: 0 8px 18px -8px var(--glow, rgba(0,0,0,.6)), inset 0 1px 0 rgba(255,255,255,.25); transition: transform .15s; }
.act:active > span { transform: scale(.9); }
.a-gold   { --glow: rgba(214,178,94,.8); }  .a-gold > span, .ov-ic.a-gold { background: linear-gradient(135deg, #f1d999, #c79a3e); color: #2a1f05; }
.a-blue   { --glow: rgba(80,130,240,.8); }  .a-blue > span, .ov-ic.a-blue { background: linear-gradient(135deg, #6f9bff, #2f56c8); }
.a-violet { --glow: rgba(150,100,240,.8); } .a-violet > span { background: linear-gradient(135deg, #b18cff, #6a3fd0); }
.a-teal   { --glow: rgba(40,190,180,.8); }  .a-teal > span, .ov-ic.a-teal { background: linear-gradient(135deg, #4fe0cf, #128a85); }
.a-rose   { --glow: rgba(240,90,120,.8); }  .a-rose > span, .ov-ic.a-rose { background: linear-gradient(135deg, #ff8fa6, #d0405f); }
.a-green  { --glow: rgba(60,200,120,.8); }  .a-green > span { background: linear-gradient(135deg, #7be3a4, #1f9a59); }

/* ---------- Home: overview (one panel, divided) ---------- */
.overview { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 14px; border-radius: 18px; overflow: hidden;
  background: linear-gradient(160deg, rgba(42,61,102,.55), rgba(19,28,46,.9)); border: 1px solid #2a3a5c; }
.ov { display: flex; gap: 10px; align-items: flex-start; padding: 13px 12px; text-decoration: none; position: relative; }
.ov:nth-child(odd) { border-right: 1px solid rgba(255,255,255,.07); }
.ov:nth-child(-n+2) { border-bottom: 1px solid rgba(255,255,255,.07); }
.ov:active { background: rgba(255,255,255,.04); }
.ov-ic { width: 34px; height: 34px; flex: none; border-radius: 11px; display: grid; place-items: center; color: #fff; }
.ov div { min-width: 0; }
.ov small { display: block; color: var(--muted); font-size: 11.5px; }
.ov b { display: block; font-size: 17px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov em { font-style: normal; color: var(--muted); font-size: 11.5px; }

/* ---------- Home: needs restock ---------- */
.restock { position: relative; margin-bottom: 6px; border-radius: 18px; padding: 4px 0 6px; overflow: hidden;
  background: linear-gradient(180deg, rgba(245,185,85,.10), rgba(19,28,46,.0) 70%), var(--card); border: 1px solid #3a3424; }
.restock::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: linear-gradient(180deg, #f5b955, #ff7a7a); }
.rs-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px 6px; }
.rs-head b { display: block; font-size: 15.5px; }
.rs-head small { color: var(--muted); font-size: 12px; }
.rs-head a { color: var(--gold); text-decoration: none; font-size: 13px; font-weight: 600; }
.rs-row { display: flex; align-items: center; gap: 12px; padding: 9px 14px; cursor: pointer; }
.rs-row + .rs-row { border-top: 1px dashed rgba(255,255,255,.06); }
.rs-row:active { background: rgba(255,255,255,.03); }
.ring { position: relative; width: 40px; height: 40px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke: rgba(255,255,255,.08); stroke-width: 3.5; }
.ring .fg { stroke-linecap: round; stroke-dasharray: 97.4; stroke-dashoffset: calc(97.4 * (1 - var(--p))); animation: ringIn .9s ease-out both; }
.ring.low .fg { stroke: var(--amber); } .ring.out .fg { stroke: var(--red); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 14px; }
.ring.out b { color: var(--red); } .ring.low b { color: var(--amber); }
@keyframes ringIn { from { stroke-dashoffset: 97.4; } }
.rs-main { flex: 1; min-width: 0; }
.rs-main b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rs-main small { color: var(--muted); font-size: 12px; }
.rs-main .code { margin: 0 4px 0 0; padding: 0 5px; font-size: 10px; }
.rs-add { width: 34px; height: 34px; flex: none; border-radius: 10px; border: 1px solid rgba(214,178,94,.4); background: rgba(214,178,94,.12);
  color: var(--gold2); font-size: 20px; line-height: 1; }
.rs-add:active { transform: scale(.92); }

/* Page header actions */
.pagehead h2 { flex: 1; }
.head-acts { display: flex; gap: 8px; }
.hbtn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--gold2); }
.hbtn.gold { background: var(--gold-grad); color: #1a1406; border-color: transparent; box-shadow: 0 6px 16px -6px rgba(214,178,94,.7); }
.hbtn:active { transform: scale(.94); }

/* ---------- Stock page ---------- */
.st-summary { display: grid; grid-template-columns: repeat(4, 1fr); margin-bottom: 12px; border-radius: 16px; overflow: hidden;
  background: linear-gradient(135deg, #22345c, #16213a 70%); border: 1px solid #2c3d62; }
.st-summary > div { padding: 10px 6px; text-align: center; min-width: 0; }
.st-summary > div + div { border-left: 1px solid rgba(255,255,255,.07); }
.st-summary b { display: block; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-summary small { color: #a9b5cf; font-size: 11px; }
.st-summary .warn b { color: var(--amber); }
.searchbox { display: flex; align-items: center; gap: 8px; padding: 0 6px 0 12px; height: 48px; border-radius: 14px;
  background: #0e1626; border: 1px solid var(--line); color: var(--muted); transition: border-color .2s, box-shadow .2s; }
.searchbox:focus-within { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(214,178,94,.15); }
.searchbox input { flex: 1; min-width: 0; margin: 0; border: 0; background: none; padding: 0; height: 100%; box-shadow: none !important; }
.searchbox button { width: 38px; height: 38px; flex: none; border: 0; border-radius: 10px; display: grid; place-items: center; background: var(--gold-grad); color: #1a1406; }
.search .chips { margin: 10px 0 0; }
.chips button i { font-style: normal; margin-left: 6px; font-size: 11px; padding: 0 6px; border-radius: 99px; background: rgba(255,255,255,.08); color: var(--muted); }
.chips button.on i { background: rgba(0,0,0,.15); color: #1a1406; }
.chips button.lowchip:not(.on) { color: var(--amber); border-color: rgba(245,185,85,.35); }

.pcard { position: relative; display: flex; gap: 12px; padding: 12px; margin-bottom: 10px; border-radius: 16px; cursor: pointer;
  background: linear-gradient(160deg, #172238, #121a2b); border: 1px solid var(--line); overflow: hidden; transition: transform .12s, border-color .2s; }
.pcard::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--green); }
.pcard.low::before { background: var(--amber); } .pcard.out::before { background: var(--red); }
.pcard:active { transform: scale(.985); border-color: #36507f; }
.p-ic { width: 52px; height: 52px; flex: none; border-radius: 14px; display: grid; place-items: center; color: #fff; }
.k-watch { background: linear-gradient(135deg, #f1d999, #c79a3e); color: #2a1f05; }
.k-clock { background: linear-gradient(135deg, #6f9bff, #2f56c8); }
.k-strap { background: linear-gradient(135deg, #b18cff, #6a3fd0); }
.k-battery { background: linear-gradient(135deg, #4fe0cf, #128a85); }
.k-gift { background: linear-gradient(135deg, #ff8fa6, #d0405f); }
.k-box { background: linear-gradient(135deg, #8fa3c7, #4a5d82); }
.p-main { flex: 1; min-width: 0; }
.p-top { display: flex; gap: 6px; align-items: center; }
.p-top .code { margin: 0; }
.p-cat { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.p-name { display: block; font-size: 15px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-sub { display: block; color: var(--muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-price { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.p-price > b { font-size: 17px; color: var(--gold2); }
.p-price small { font-size: 11.5px; color: var(--muted); }
.p-bar { height: 4px; margin-top: 8px; border-radius: 99px; background: rgba(255,255,255,.07); overflow: hidden; }
.p-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #2fae74, #3ecf8e); animation: grow .8s ease-out both; transform-origin: left; }
.pcard.low .p-bar i { background: linear-gradient(90deg, #d9932a, #f5b955); }
.pcard.out .p-bar i { background: var(--red); }
.p-side { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 8px; flex: none; }
.p-qty { text-align: center; min-width: 48px; padding: 5px 6px; border-radius: 12px; background: rgba(62,207,142,.12); }
.p-qty b { display: block; font-size: 18px; line-height: 1.1; color: var(--green); }
.p-qty small { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.pcard.low .p-qty { background: rgba(245,185,85,.13); } .pcard.low .p-qty b, .pcard.low .p-qty small { color: var(--amber); }
.pcard.out .p-qty { background: rgba(255,122,122,.13); } .pcard.out .p-qty b, .pcard.out .p-qty small { color: var(--red); }
.p-adj { display: flex; align-items: center; gap: 1px; padding: 6px 8px; border-radius: 10px; border: 1px solid #2c3d62; background: #1d2a44; color: var(--gold2); }
.p-adj span { opacity: .5; font-size: 12px; }
.p-adj:active { transform: scale(.93); }
.st-foot { text-align: center; color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.st-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 16px; text-align: center; color: var(--muted);
  border: 1px dashed var(--line); border-radius: 16px; }
.st-empty svg { width: 40px; height: 40px; color: var(--gold); margin-bottom: 4px; }
.st-empty b { color: var(--ink); }
.st-empty .btn { margin-top: 10px; }

/* ---------- Product photos ---------- */
.pic { width: 42px; height: 42px; flex: none; border-radius: 11px; object-fit: cover; }
.pic.sm { width: 38px; height: 38px; border-radius: 10px; }
.pic.p-ic svg { width: 20px; height: 20px; }
.p-pic { width: 58px; height: 58px; flex: none; border-radius: 14px; object-fit: cover; }
img.has-photo { background: #fff; border: 1px solid rgba(214,178,94,.35); cursor: zoom-in; box-shadow: 0 4px 12px -4px rgba(0,0,0,.6); }
.li-name { display: flex; gap: 10px; align-items: center; min-width: 0; }
.li-name > div { min-width: 0; }

.photo-pick { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px dashed var(--line); }
.photo-box { width: 104px; height: 104px; flex: none; border-radius: 18px; overflow: hidden; display: grid; place-items: center;
  background: #0e1626; border: 1.5px dashed #3a4a6b; }
.photo-box img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.photo-box .loader { padding: 0; }
.ph-empty { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--muted); }
.ph-empty svg { width: 30px; height: 30px; color: var(--gold); }
.ph-empty small { font-size: 10.5px; line-height: 1.25; }
.photo-btns { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.photo-btns .btn { justify-content: flex-start; }

.zoom { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: calc(env(safe-area-inset-top, 0px) + 56px) 16px calc(24px + var(--safe-b)); background: rgba(3,7,15,.94); animation: fadeIn .18s; }
.zoom img { max-width: 100%; max-height: 68vh; border-radius: 16px; background: #fff; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.6); animation: zoomIn .25s cubic-bezier(.2,1.2,.4,1); }
.zoom-x { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); right: 14px; width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 18px; }
.zoom-cap { text-align: center; }
.zoom-cap .code { margin: 0 0 4px; }
.zoom-cap b { display: block; font-size: 17px; }
.zoom-cap small { display: block; color: var(--muted); }
.zoom-cap em { display: block; font-style: normal; font-weight: 700; font-size: 20px; color: var(--gold2); margin-top: 4px; }

/* Stickers page: keep install button clear of the print bar */
body[data-page="labels"] .install-fab { bottom: calc(150px + var(--safe-b)); }

/* ---------- Scanner v2: camera in a box, list below, manual entry at bottom ---------- */
.scanner { gap: 10px; background: var(--bg); padding: calc(env(safe-area-inset-top, 0px) + 12px) 16px calc(12px + var(--safe-b)); }
.scan-top { margin: 0; align-items: flex-start; }
.scan-top b { display: block; font: bold 18px Georgia, serif; color: var(--gold2); }
.scan-top small { color: var(--muted); font-size: 12px; }
.scan-close { width: 38px; height: 38px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-size: 16px; }
.scan-view { flex: none; width: 100%; max-width: 420px; margin: 0 auto; aspect-ratio: 4 / 3; max-height: 38vh; border-radius: 20px;
  border: 2px solid rgba(214,178,94,.45); box-shadow: 0 14px 34px -14px rgba(0,0,0,.8); background: #05080f; }
.scan-frame i { width: 78%; height: 52%; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
.scan-off { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 16px; text-align: center; color: var(--muted); background: radial-gradient(circle at 50% 40%, #16213a, #070b14); }
.scan-off svg { color: var(--gold); opacity: .8; }
.scan-off b { color: var(--ink); }
.scan-off small { font-size: 12px; line-height: 1.4; }
.scan-status { min-height: 38px; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; font-size: 13px; color: var(--muted);
  padding: 8px 12px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); }
.scan-status.ok { color: var(--green); background: rgba(62,207,142,.1); border-color: rgba(62,207,142,.35); animation: zoomIn .25s; }
.scan-status.bad { color: var(--red); background: rgba(255,122,122,.08); border-color: rgba(255,122,122,.3); }
.scan-status b { color: var(--ink); }
.loader.inline { flex-direction: row; padding: 0; gap: 8px; }
.loader.inline .spin-watch { width: 20px; height: 20px; border-width: 1.5px; }
.loader.inline .spin-watch i { height: 7px; } .loader.inline .spin-watch b { height: 5px; }
.scan-list-head { display: flex; justify-content: space-between; align-items: center; padding: 0 2px; }
.scan-list-head b { font-size: 14px; }
.scan-list-head span { font-size: 12px; font-weight: 700; color: #1a1406; background: var(--gold-grad); padding: 2px 10px; border-radius: 99px; }
.scan-list { flex: 1; min-height: 0; overflow-y: auto; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.scan-empty { text-align: center; color: var(--muted); font-size: 13px; padding: 22px 10px; margin: 0; }
.scan-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--line); animation: rise .3s both; }
.scan-row:last-child { border-bottom: 0; }
.scan-row .main { flex: 1; min-width: 0; }
.scan-row .main b { display: block; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scan-row .main small { color: var(--muted); font-size: 12px; }
.scan-row .code { margin: 0 4px 0 0; }
.scan-n { font-weight: 700; color: var(--gold2); }
.scan-manual { display: flex; gap: 8px; }
.scan-manual input { flex: 1; min-width: 0; margin: 0; }
.scan-manual .btn { flex: none; }
.scan-status.ok { flex-wrap: wrap; justify-content: space-between; text-align: left; }
.scan-status .st-tot { white-space: nowrap; padding: 2px 10px; border-radius: 99px; background: rgba(62,207,142,.15); }
.scan-status .st-tot b { color: var(--gold2); }
.scan-total { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-radius: 14px;
  background: linear-gradient(135deg, #22345c, #16213a); border: 1px solid #2c3d62; }
.scan-total span { color: #a9b5cf; font-size: 13px; }
.scan-total b { font-size: 20px; color: var(--gold2); }
.ask-prod { display: flex; gap: 12px; align-items: center; text-align: left; margin: 12px 0 10px; padding: 10px; border-radius: 14px;
  background: #0e1626; border: 1px solid rgba(255,122,122,.3); }
.ask-prod img, .ask-prod .p-pic { width: 64px; height: 64px; flex: none; border-radius: 12px; object-fit: cover; background: #fff; }
.ask-prod .p-pic { background: none; }
.ask-prod > div { min-width: 0; }
.ask-prod .code { margin: 0 0 3px; }
.ask-prod b { display: block; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ask-prod small { display: block; color: var(--muted); font-size: 12px; }
.ask-prod em { display: block; font-style: normal; font-weight: 700; color: var(--gold2); margin-top: 2px; font-size: 14px; }
.ask-box .ask-prod ~ p { margin-top: 0; }

/* Install button: home page only */
body[data-page]:not([data-page="home"]) .install-fab { display: none !important; }

/* ---------- Bill view ---------- */
.inv-sum { display: grid; grid-template-columns: repeat(3, 1fr); border-radius: 16px; overflow: hidden; margin-bottom: 8px;
  background: linear-gradient(135deg, #22345c, #16213a 70%); border: 1px solid #2c3d62; }
.inv-sum > div { padding: 10px 8px; text-align: center; }
.inv-sum > div + div { border-left: 1px solid rgba(255,255,255,.07); }
.inv-sum small { display: block; color: #a9b5cf; font-size: 11.5px; }
.inv-sum b { font-size: 17px; }
.inv-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 2px 12px; }
.inv-meta small { color: var(--muted); font-size: 12px; }
.inv-meta small b { color: var(--ink); }
.inv-prev { border-radius: 14px; overflow: hidden; background: #fff; box-shadow: 0 16px 40px -16px rgba(0,0,0,.8); }
.inv-prev .loader { background: var(--card); }
.inv-prev .inv-img { border-radius: 0; }
.share-bar { position: sticky; bottom: calc(66px + var(--safe-b)); z-index: 4; display: flex; gap: 8px; margin-top: 14px; padding: 10px;
  border-radius: 16px; background: rgba(19,28,46,.96); border: 1px solid var(--line); box-shadow: 0 -8px 24px -10px rgba(0,0,0,.7);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.share-bar .btn { flex: 1; padding: 12px 10px; white-space: nowrap; }
.share-bar .btn.wa { flex: 1.6; }
.share-bar .btn.sq { flex: none; width: 46px; }

/* Bill preview: fits on screen, tap for full view */
.inv-prev { max-width: 100%; display: flex; justify-content: center; background: transparent; box-shadow: none; cursor: zoom-in; }
.inv-prev .inv-img { width: auto; max-width: 100%; max-height: 50vh; border-radius: 10px; background: #fff; box-shadow: 0 16px 40px -16px rgba(0,0,0,.85); }
.inv-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.inv-nav span { color: var(--muted); font-size: 13px; }
.inv-nav .btn:disabled, .iv-bot .btn:disabled { opacity: .35; }
.inv-hint { text-align: center; color: var(--muted); font-size: 11.5px; margin: 8px 0 0; }
.inv-view { position: fixed; inset: 0; z-index: 85; display: flex; flex-direction: column; gap: 10px; background: rgba(3,7,15,.97);
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(12px + var(--safe-b)); animation: fadeIn .18s; }
.iv-top { display: flex; justify-content: space-between; align-items: center; }
.iv-top b { display: block; color: var(--gold2); font-size: 17px; }
.iv-top small { color: var(--muted); font-size: 12px; }
.iv-scroll { flex: 1; min-height: 0; overflow: auto; border-radius: 12px; -webkit-overflow-scrolling: touch; touch-action: pan-y pinch-zoom; }
.iv-scroll img { display: block; width: 100%; height: auto; background: #fff; border-radius: 12px; animation: zoomIn .22s; }
.iv-bot { display: flex; gap: 10px; } .iv-bot .btn { flex: 1; }

/* Full-screen bill viewer: light backdrop so the white bill stands out */
.inv-view { background: linear-gradient(180deg, #eef1f7 0%, #dde3ee 100%); color: #14203a; }
.inv-view .iv-top b { color: #14203a; }
.inv-view .iv-top small { color: #5b6680; }
.inv-view .scan-close { background: #fff; border-color: #cfd6e4; color: #14203a; box-shadow: 0 4px 12px -6px rgba(20,32,58,.4); }
.inv-view .iv-scroll img { box-shadow: 0 18px 40px -18px rgba(20,32,58,.55), 0 0 0 1px rgba(20,32,58,.06); }
.inv-view .iv-bot .btn { background: #fff; color: #14203a; border-color: #cfd6e4; box-shadow: 0 4px 12px -8px rgba(20,32,58,.4); }
.inv-view .iv-bot .btn:not(:disabled):active { background: #f3f5fa; }

/* Bill page preview: soft light panel behind the bill */
.inv-prev { padding: 14px; border-radius: 16px; background: linear-gradient(180deg, #eef1f7, #dde3ee); }
.inv-prev .inv-img { box-shadow: 0 12px 30px -14px rgba(20,32,58,.55); }

/* Customer page: compact WhatsApp / Call icons + action row */
.c-acts { display: flex; gap: 8px; flex: none; }
.c-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; }
.c-ic.wa { background: #25d366; color: #06210f; box-shadow: 0 6px 14px -6px rgba(37,211,102,.7); }
.c-ic.call { background: #2a3d66; color: #fff; border: 1px solid #36507f; }
.c-ic:active { transform: scale(.92); }
.c-row .btn.gold { flex: 2; }
.c-row .btn.sm { flex: 1; padding: 11px 10px; font-size: 14px; }
