/* The view fills its frame, and the dashboard fills the view. It does NOT
 * scroll: a home screen you have to scroll is a home screen with something
 * hidden below the fold, and the whole point of this one is that everything
 * on it can be seen at once. Anything that would not fit is not put here. */
#view-home { flex: 1; min-height: 0; display: flex; }

.homepage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #fff;
}
/* A pale wallpaper cannot carry white type. */
.homepage.onlight { color: #0f172a; }

/* Three soft discs of colour, well outside the edges. Without them a flat
 * gradient reads as a screen that has not finished loading. */
.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.orb.a { width: 420px; height: 420px; left: -130px; top: -120px; background: rgba(64, 160, 255, .20); }
.orb.b { width: 380px; height: 380px; right: -150px; top: 20px; background: rgba(34, 211, 238, .16); }
.orb.c { width: 460px; height: 460px; right: 110px; bottom: -190px; background: rgba(167, 139, 250, .13); }

/* Right padding reserves the column the figures float in, so a long shop name
 * never runs under the card. */
.homeflow {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding: 20px 336px 74px 26px;
  display: flex;
  flex-direction: column;
}

/* ── The shortcuts, across the top ───────────────────────────────── */
.qrow { display: flex; flex-wrap: wrap; gap: 9px; max-width: 820px; }

.qbtn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  font: var(--font);
  font-size: 13px;
  font-weight: 600;
  color: inherit;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 9px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.qbtn:hover { background: rgba(255, 255, 255, .26); }
.qbtn .ico { opacity: .85; }
/* The key that does the same thing, printed on the button that does it. Quiet
 * enough to ignore while you are still clicking, and there to be read on the
 * day you stop. */
.qk {
  padding: 1px 6px;
  font: 10.5px/1.5 var(--font);
  font-weight: 700;
  letter-spacing: .02em;
  opacity: .68;
  border: 1px solid currentColor;
  border-radius: 4px;
}
.homepage.onlight .qbtn {
  background: rgba(15, 23, 42, .07);
  border-color: rgba(15, 23, 42, .14);
}
.homepage.onlight .qbtn:hover { background: rgba(15, 23, 42, .13); }

/* ── Whose shop this is ──────────────────────────────────────────── */
/* Centred in whatever room is left under the shortcuts, so the page looks
 * settled on a tall screen and merely tight on a short one — never cut off. */
.hello {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: auto 0;
  min-height: 0;
}
.hwho { min-width: 0; }

.hmark {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: 800;
  color: #0f2a2a;
  background: rgba(255, 255, 255, .92);
  border-radius: 15px;
}
.homepage.onlight .hmark { color: #fff; background: rgba(15, 23, 42, .85); }

.hello h1 {
  margin: 0 0 4px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -.4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hsub { font-size: 14px; opacity: .82; }
.hline { margin-top: 6px; font-size: 12.5px; opacity: .62; }

/* Shown only when the shop has not named itself. That name is printed on
 * every bill, so an unnamed shop is a real problem and not a cosmetic one —
 * and this is the one screen certain to be looked at. */
.namebtn {
  margin-top: 10px;
  padding: 7px 13px;
  font: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  color: inherit;
  background: rgba(255, 255, 255, .16);
  border: 1px dashed rgba(255, 255, 255, .45);
  border-radius: 8px;
  cursor: pointer;
}
.namebtn:hover { background: rgba(255, 255, 255, .28); }
.homepage.onlight .namebtn {
  background: rgba(15, 23, 42, .07);
  border-color: rgba(15, 23, 42, .3);
}

/* ── The figures, floating on the right ──────────────────────────── */
.snap {
  position: absolute;
  top: 20px;
  right: 24px;
  width: 296px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.glass {
  padding: 5px;
  background: rgba(255, 255, 255, .13);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 14px;
  backdrop-filter: blur(14px);
}
.homepage.onlight .glass {
  background: rgba(255, 255, 255, .72);
  border-color: rgba(15, 23, 42, .1);
}

.snap-big {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 12px 13px 11px;
  font: var(--font);
  text-align: left;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}
.snap-big:hover { background: rgba(255, 255, 255, .12); }
.s-cap { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; opacity: .7; }
.s-fig { font-size: 27px; font-weight: 800; font-variant-numeric: tabular-nums; }
.s-sub { font-size: 12px; opacity: .7; }

.snap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 8px 13px;
  font: var(--font);
  font-size: 13px;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
}
.snap-row:hover { background: rgba(255, 255, 255, .12); }
.snap-row b { font-weight: 700; font-variant-numeric: tabular-nums; }
/* Money already lost, and money about to be. */
.snap-row.bad b { color: #fecaca; }
.snap-row.warn b { color: #fde68a; }
.homepage.onlight .snap-row.bad b { color: var(--danger); }
.homepage.onlight .snap-row.warn b { color: #b45309; }
/* Until the bills land. A dash would read as "nothing sold today". */
.waiting { opacity: .55; }

/* ── The two pills in the corner ─────────────────────────────────── */
.homepills {
  position: absolute;
  right: 24px;
  bottom: 18px;
  display: flex;
  gap: 8px;
}

.pill {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  font: var(--font);
  font-size: 12.5px;
  font-weight: 600;
  color: inherit;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 20px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}
.pill:hover { background: rgba(255, 255, 255, .26); }
.pill .ico { width: 15px; height: 15px; flex: 0 0 15px; opacity: .85; }
/* Logging out loses nothing, but it is still the one button here that ends
 * the session, and it should not look like the one beside it. */
.pill.danger { color: #fecaca; }
.homepage.onlight .pill { background: rgba(15, 23, 42, .07); border-color: rgba(15, 23, 42, .14); }
.homepage.onlight .pill:hover { background: rgba(15, 23, 42, .13); }
.homepage.onlight .pill.danger { color: #b91c1c; }

/* Narrower screens give room back rather than starting to scroll: the card
 * shrinks, then the shop's address line goes, then the heading. Nothing here
 * is ever pushed below the fold, because there is no fold. */
@media (max-width: 1180px) {
  .homeflow { padding-right: 296px; }
  .snap { width: 262px; right: 18px; }
  .qrow { max-width: 100%; }
}
@media (max-width: 980px) {
  .homeflow { padding-right: 26px; padding-bottom: 62px; }
  .snap { position: static; width: auto; max-width: 560px; margin-top: 18px; }
  .hello { margin: 20px 0 0; }
  .hello h1 { font-size: 24px; }
  .hline { display: none; }
}
/* A short window loses the decoration before it loses a figure. */
@media (max-height: 620px) {
  .hello h1 { font-size: 23px; }
  .hmark { flex-basis: 44px; width: 44px; height: 44px; font-size: 20px; }
  .hline { display: none; }
  .s-fig { font-size: 23px; }
}

/* ── Choosing a wallpaper ───────────────────────────────────────── */
.wallmodal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, .45);
}

.wallcard {
  width: min(560px, 92vw);
  padding: 20px 22px 16px;
  background: var(--surface);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .3);
}
.wallcard h3 { margin: 0 0 4px; font-size: 16px; }
.wallnote { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }

.wallgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }

.wallopt {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px;
  font: var(--font);
  font-size: 12px;
  color: var(--ink);
  text-align: left;
  background: none;
  border: 2px solid transparent;
  border-radius: 9px;
  cursor: pointer;
}
.wallopt:hover { background: #f1f5f9; }
.wallopt.on { border-color: var(--accent); }

.wallswatch {
  height: 58px;
  border-radius: 6px;
  border: 1px solid var(--line);
}
.wallswatch.own {
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--muted);
  background: #f1f5f9;
  border-style: dashed;
}

.wallsay {
  margin: 12px 0 0;
  padding: 8px 10px;
  font-size: 12.5px;
  color: var(--ink);
  background: #f1f5f9;
  border-radius: 7px;
}
/* A picture that could not be kept has to SAY so. It used to fail in silence,
 * which looked exactly like a picture that had been applied and then forgotten
 * by the next morning. */
.wallsay.bad { color: #7f1d1d; background: #fef2f2; }

.wallfoot { display: flex; justify-content: flex-end; margin-top: 14px; }

/* ── Plan & billing ─────────────────────────────────────────────── */
.planwrap { padding: 20px 26px 34px; max-width: 980px; }

/* What is running now, and whether it covers THIS machine — the one question
 * the screen exists to answer, so it is answered before anything is sold. */
.plan-now {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--line);
  border-radius: 10px;
}
.plan-now h2 { margin: 0 0 4px; font-size: 16px; }
.plan-now.good { border-left-color: #0d9488; }
.plan-now.part { border-left-color: #d97706; }
.plan-now.off { border-left-color: var(--danger); }
.plan-now.waiting { border-left-color: var(--muted); }
.plan-now p { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.plan-when { font-variant-numeric: tabular-nums; }
.plan-apps { color: var(--ink); }
.plan-verdict { margin-top: 8px; font-weight: 600; }
.plan-verdict.ok { color: #0f766e; }
.plan-verdict.no { color: var(--danger); }

.plan-head {
  margin: 26px 0 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
}

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }

.plan-card {
  position: relative;
  padding: 16px 17px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}
/* The plans that open this app are the ones worth looking at from this app. */
.plan-card.covers { border-color: #99f6e4; background: #f7fffd; }
.plan-card.mine { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(13, 148, 136, .12); }
.plan-tag {
  position: absolute;
  top: -9px;
  right: 12px;
  padding: 2px 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  border-radius: 20px;
}
.plan-card h3 { margin: 0 0 8px; font-size: 13.5px; font-weight: 600; }
.plan-price { font-size: 26px; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.plan-term { font-size: 12px; color: var(--muted); }
.plan-what { margin: 11px 0 0; padding-left: 17px; font-size: 12.5px; color: var(--ink); }
.plan-what li { margin-bottom: 2px; }
.plan-what li.no { color: var(--muted); }

.plan-how { margin-top: 4px; }
.plan-how ol { margin: 0; padding-left: 20px; font-size: 13px; line-height: 1.75; }
.plan-note { margin: 12px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

/* Buying a plan from the counter PC.
 *
 * By QR, not by card. Two reasons, and both matter more than convenience:
 * a Windows program that otherwise runs offline should not be loading a
 * remote checkout script, and a card number should not be typed on a machine
 * the whole shop stands around. The chemist scans with his own phone. */
.plan-buy {
  width: 100%;
  margin-top: 12px;
  padding: 10px;
  font: var(--font);
  font-size: 13.5px;
  font-weight: 700;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}
.plan-buy:hover { filter: brightness(1.07); }
.plan-card:not(.covers) .plan-buy { color: var(--ink); background: var(--bg); border: 1px solid var(--line); }

.pay-back {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(11, 16, 32, .55);
}
.pay-box {
  width: min(420px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 22px 24px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .25);
}
.pay-box h3 { margin: 0 0 4px; font-size: 17px; }
.pay-box .sub { margin: 0 0 14px; font-size: 12.5px; color: var(--muted); }
.pay-qr img {
  width: 230px;
  height: 230px;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.pay-tell { margin: 12px 0 4px; font-size: 13px; }
.pay-link {
  margin: 0 0 10px;
  font-size: 11.5px;
  color: var(--muted);
  word-break: break-all;
}
.pay-state {
  margin: 0 0 14px;
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: #b45309;
  background: #fff7ed;
  border-radius: 7px;
}
.pay-state.ok { color: #15803d; background: #f0fdf4; }
.pay-acts { display: flex; gap: 8px; justify-content: center; }

@media (max-width: 520px) {
  .pay-box { padding: 16px; }
  .pay-qr img { width: 190px; height: 190px; }
}

/* The number to ring about money.
 *
 * A shop whose plan lapsed mid-morning wants a person, not a form: a support
 * ticket read tomorrow is no use to a counter with customers standing at it. */
.plan-help {
  margin: 14px 0 0;
  padding: 11px 14px;
  font-size: 13px;
  color: var(--ink);
  background: #f1faf8;
  border: 1px solid #cfe9e4;
  border-radius: 8px;
}
.plan-help b { font-size: 14.5px; letter-spacing: .01em; }
.pay-help {
  margin: 12px 0 0;
  padding-top: 10px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.pay-help b { color: var(--ink); font-size: 13px; }

/* The paywall.
 *
 * It replaced a toast — an orange line for four seconds with nowhere to go,
 * shown at the exact moment a shop is most willing to pay: standing at the
 * counter with a bill they want to save. What a plan opens, side by side with
 * what free gives, and a button that takes the money. */
.up-back {
  position: fixed;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(11, 16, 32, .58);
}
.up-box {
  position: relative;
  width: min(760px, 100%);
  max-height: 92vh;
  overflow: auto;
  padding: 24px 26px 18px;
  background: var(--surface);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, .3);
}
.up-load { padding: 40px; color: var(--muted); text-align: center; }
.up-x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 30px;
  height: 30px;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.up-x:hover { color: var(--ink); background: var(--bg); }
.up-head h2 { margin: 0 0 5px; font-size: 20px; letter-spacing: -.01em; }
.up-head p { margin: 0 0 16px; font-size: 13px; color: var(--muted); }

.up-cols { overflow-x: auto; }
.up-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.up-tbl th {
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .5px;
  border-bottom: 1px solid var(--line);
}
.up-tbl th:first-child { text-align: left; }
.up-tbl th.paid { color: var(--accent); }
.up-tbl td { padding: 8px 12px; text-align: center; border-bottom: 1px solid var(--line); }
.up-tbl td:first-child { text-align: left; color: var(--ink); }
.up-tbl td.no { color: #cbd5e1; }
.up-tbl td.paid { font-weight: 600; }
.up-tbl td.paid.yes { color: #15803d; font-size: 15px; }
/* A tinted column, so the eye reads down the side being sold rather than
 * across eleven rows one at a time. */
.up-tbl th.paid, .up-tbl td.paid { background: #f1faf8; }

.up-plans {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 18px;
}
.up-plan {
  position: relative;
  padding: 14px 14px 12px;
  font: var(--font);
  text-align: left;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.up-plan:hover { border-color: var(--accent); box-shadow: 0 2px 10px rgba(15, 118, 110, .1); }
.up-plan.pick { border-color: var(--accent); background: #f1faf8; }
.up-plan b { display: block; font-size: 13px; }
.up-plan .up-amt { display: block; margin-top: 4px; font-size: 24px; font-weight: 800; }
.up-plan small { display: block; margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.up-tag {
  position: absolute;
  top: -9px;
  right: 10px;
  padding: 2px 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .04em;
  color: #fff;
  background: var(--accent);
  border-radius: 9px;
  text-transform: uppercase;
}
.up-none { margin-top: 16px; color: var(--muted); font-size: 13px; text-align: center; }

.up-foot {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.up-help { flex: 1; font-size: 12px; color: var(--muted); text-align: center; }
.up-help b { color: var(--ink); font-size: 13px; }

/* Pay on the computer instead of on a phone. Razorpay's own hosted page —
 * card, UPI, netbanking, wallets — opened in the browser rather than pulled
 * into this app as a remote script. */
.pay-open { width: 100%; margin-bottom: 10px; }

@media (max-width: 620px) {
  .up-box { padding: 18px 16px 14px; }
  .up-tbl { font-size: 12px; }
  .up-tbl th, .up-tbl td { padding: 7px 8px; }
  .up-foot { flex-wrap: wrap; }
  .up-help { flex-basis: 100%; order: 3; }
}
