:root { --green: #1e40af; --green-d: #172f80; --on: #fff; --accent: #dc2626; --bg: #f5f7fb; --card: #fff; --line: #dfe5e0; --text: #17201b; --muted: #5f6b64; --red: #b3261e; --amber: #a15c00; }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 16px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); -webkit-text-size-adjust: 100%; }
h1, h2, h3 { margin: 0 0 8px; line-height: 1.2; } h2 { font-size: 20px; } h3 { font-size: 16px; }
small { display: block; color: var(--muted); font-size: 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 9px 14px; cursor: pointer; min-height: 40px; }
button:hover { border-color: #b9c4bc; }
button.primary { background: var(--green); border-color: var(--green); color: var(--on); font-weight: 600; }
button.primary:hover { background: var(--green-d); }
button.big { width: 100%; padding: 14px; font-size: 18px; }
button.danger { color: var(--red); border-color: #e7c2bf; }
button.link { border: 0; background: none; text-decoration: underline; padding: 6px; min-height: 0; }
input, select, textarea { width: 100%; border: 1px solid #c3cdc6; border-radius: 8px; padding: 10px; background: #fff; min-height: 42px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 3px solid #9db8f5; outline-offset: 1px; }
label { display: block; font-size: 14px; color: var(--muted); margin: 10px 0; }
label input, label select, label textarea { margin-top: 4px; color: var(--text); }
label.check { display: flex; align-items: center; gap: 8px; color: var(--text); }
label.check input { width: 20px; height: 20px; min-height: 0; margin: 0; }
.muted { color: var(--muted); font-size: 14px; } .empty { color: var(--muted); padding: 18px; text-align: center; }
.note { background: #fff6e0; border: 1px solid #f0d58a; border-radius: 8px; padding: 8px 10px; font-size: 14px; }

.auth { max-width: 380px; margin: 8vh auto; background: var(--card); padding: 24px; border-radius: 14px; border: 1px solid var(--line); }
.top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--green); color: var(--on); padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); border-bottom: 4px solid var(--accent); }
.top .brand { font-weight: 700; font-size: 18px; margin-right: auto; display: flex; align-items: center; gap: 8px; }
.top .link { color: var(--on); font-size: 14px; }
.branchpick { width: auto; min-height: 34px; padding: 4px 8px; color: var(--text); } .branchname { font-size: 14px; opacity: .9; }
.pill { font-size: 12px; padding: 4px 10px; border-radius: 99px; background: #fff; color: var(--text); white-space: nowrap; }
.pill.ok::before, .pill.warn::before, .pill.off::before { content: "●"; margin-right: 5px; }
.pill.ok::before { color: #1a9d5f; } .pill.warn::before { color: #d98a00; } .pill.off::before { color: var(--red); }
.tabs { display: flex; gap: 2px; overflow-x: auto; background: #fff; border-bottom: 1px solid var(--line); padding: 0 8px; position: sticky; top: 0; z-index: 5; }
.tabs button { border: 0; border-radius: 0; border-bottom: 3px solid transparent; padding: 12px 14px; white-space: nowrap; background: none; }
.tabs button.on { border-bottom-color: var(--accent); color: var(--green); font-weight: 700; }
main { padding: 14px; max-width: 1400px; margin: 0 auto; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.bar h2 { margin: 0 auto 0 0; } .bar input[type=search] { width: 220px; } .bar label { margin: 0; display: flex; align-items: center; gap: 6px; } .bar input[type=date], .bar select { width: auto; }

.sell { display: grid; grid-template-columns: 1fr 380px; gap: 14px; align-items: start; }
.searchrow { display: flex; gap: 8px; } .searchrow input { font-size: 18px; padding: 12px; } .searchrow button { white-space: nowrap; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 10px 0; } .chips:empty { padding: 6px 0; }
.chips button { border-radius: 99px; padding: 6px 14px; min-height: 34px; white-space: nowrap; } .chips button.on { background: var(--green); color: var(--on); border-color: var(--green); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.pcard { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 10px; min-height: 92px; background: var(--card); }
.pname { font-weight: 600; font-size: 14px; flex: 1; overflow-wrap: anywhere; } .pprice { color: var(--green); font-weight: 700; } .pstock { font-size: 12px; color: var(--muted); }
.pstock.low, .qty.low { color: var(--amber); font-weight: 700; } .pstock.out, .qty.out { color: var(--red); font-weight: 700; }
.cart { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px; position: sticky; top: 56px; }
.line { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.lname { grid-column: 1 / -1; font-weight: 600; } .lamt { text-align: right; font-weight: 600; align-self: center; }
.stepper { display: flex; gap: 4px; } .stepper button { width: 40px; padding: 0; font-size: 20px; } .stepper input { width: 64px; text-align: center; padding: 6px; }
.sum { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; } .sum label { margin: 0; } .sum input { width: 110px; text-align: right; }
.sum.total { font-size: 22px; border-top: 2px solid var(--accent); margin: 6px 0 10px; padding-top: 10px; }
.cartbar { display: none; }

.tablewrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: #f8faf8; white-space: nowrap; }
tr:last-child td { border-bottom: 0; } .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
tr.click { cursor: pointer; } tr.click:hover { background: #f1f5fd; }
.neg { color: var(--red); } .pos { color: var(--green); }
.rowbtns { white-space: nowrap; text-align: right; } .rowbtns button { padding: 5px 10px; min-height: 32px; margin-left: 4px; }
.tag { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: #e9ede9; white-space: nowrap; } .tag.warn { background: #fff0cc; color: var(--amber); } .tag.bad { background: #fbe3e1; color: var(--red); }
input.short { width: 96px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px; } .tile span { font-size: 13px; color: var(--muted); } .tile b { display: block; font-size: 22px; margin: 2px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px; margin-bottom: 14px; } .card .tablewrap { border: 0; margin-bottom: 10px; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.barrow { display: grid; grid-template-columns: 52px 1fr 130px; gap: 8px; align-items: center; font-size: 13px; padding: 3px 0; } .barrow b { text-align: right; }
.track { background: #e9ede9; border-radius: 4px; height: 14px; } .track div { background: var(--green); height: 100%; border-radius: 4px; min-width: 2px; }
form.inline { display: flex; gap: 8px; }

.backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); display: flex; align-items: flex-start; justify-content: center; padding: 4vh 12px; overflow-y: auto; z-index: 20; }
.dialog { background: #fff; border-radius: 14px; padding: 18px; width: 100%; max-width: 480px; } .dialog.wide { max-width: 760px; } .dialog.narrow { max-width: 360px; }
.actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; margin-top: 14px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; } .methods button.on { background: var(--green); color: var(--on); border-color: var(--green); font-weight: 600; }
.change { font-size: 20px; font-weight: 700; margin: 4px 0; } .done { color: var(--green); font-weight: 700; font-size: 18px; text-align: center; margin: 0 0 8px; }
.results { display: flex; flex-direction: column; gap: 4px; } .results button { text-align: left; } .results small { display: inline; margin-left: 6px; }
video { width: 100%; border-radius: 10px; background: #000; }
.receipt { font: 13px/1.35 ui-monospace, Menlo, Consolas, monospace; text-align: center; } .receipt h3 { font-size: 16px; } .receipt p { margin: 4px 0; } .receipt hr { border: 0; border-top: 1px dashed #000; }
.rline { display: flex; justify-content: space-between; gap: 10px; text-align: left; padding: 2px 0; } .rline small { font-size: 12px; color: inherit; } .rline.tot { font-weight: 700; font-size: 16px; }
.stamp { font-weight: 700; color: var(--red); border: 2px solid var(--red); display: inline-block; padding: 2px 10px; } .thanks { margin-top: 10px !important; }
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: #17201b; color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 40; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translateX(-50%); } #toast.err { background: var(--red); }

@media (max-width: 860px) {
  .sell { grid-template-columns: 1fr; } .cart { position: static; margin-bottom: 70px; }
  .cartbar { display: block; position: fixed; left: 12px; right: 12px; bottom: max(12px, env(safe-area-inset-bottom)); background: var(--green); color: var(--on); border: 0; font-weight: 700; padding: 14px; border-radius: 12px; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); z-index: 6; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); } .bar input[type=search] { width: 100%; } main { padding: 10px; }
}
/* Receipt printing: fits 58mm and 80mm till-roll printers */
@media print {
  @page { margin: 3mm; }
  body { background: #fff; } #app, #toast, .noprint, .done { display: none !important; }
  .backdrop { position: static; background: none; padding: 0; display: block; } .dialog { padding: 0; max-width: 72mm; border-radius: 0; }
}
/* Branding: logo and colour picker */
img.logo { height: 32px; max-width: 120px; object-fit: contain; border-radius: 4px; }
img.logo-big { display: block; max-height: 96px; max-width: 200px; margin: 0 auto 12px; object-fit: contain; }
.receipt img.logo-big { max-height: 60px; max-width: 150px; margin-bottom: 4px; }
.lbl { font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatches button { width: 40px; height: 40px; min-height: 0; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatches button.on { box-shadow: 0 0 0 3px var(--text); }
.swatches input[type=color] { width: 56px; height: 40px; min-height: 0; padding: 2px; }
.logorow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.logorow input[type=file] { width: auto; flex: 1; min-width: 180px; }
#logoprev img { height: 56px; max-width: 140px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; padding: 4px; background: #fff; }
/* Customer-facing second screen */
@media (max-width: 860px) { .dispbtn { display: none; } }
body.display { background: #fff; overflow: hidden; }
.dwrap { height: 100vh; display: flex; flex-direction: column; }
.dhead { background: var(--green); color: var(--on); border-bottom: 6px solid var(--accent); padding: 2vh 3vw; display: flex; align-items: center; gap: 2vw; font-size: clamp(22px, 4vw, 48px); font-weight: 700; }
img.dlogo { height: clamp(36px, 8vh, 90px); max-width: 30vw; object-fit: contain; }
img.dlogo-big { max-height: 35vh; max-width: 60vw; object-fit: contain; margin-bottom: 3vh; }
.dmain { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 2vh 3vw 3vh; width: 100%; max-width: none; margin: 0; }
.ditems { flex: 1; min-height: 0; overflow-y: auto; }
.ditem { display: flex; justify-content: space-between; align-items: center; gap: 2vw; padding: 1.2vh 0; border-bottom: 1px solid var(--line); font-size: clamp(18px, 2.8vw, 34px); }
.ditem small { font-size: .65em; } .ditem b { white-space: nowrap; }
.dtotal { display: flex; justify-content: space-between; align-items: baseline; gap: 2vw; border-top: 4px solid var(--accent); padding-top: 2vh; font-size: clamp(28px, 5vw, 64px); font-weight: 700; color: var(--green); }
.dtotal.solo { flex: 1; flex-direction: column; align-items: center; justify-content: center; border: 0; font-size: clamp(40px, 10vw, 130px); }
.dtotal.solo span { font-size: .35em; color: var(--muted); font-weight: 600; }
.dcenter { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.dcenter .dtotal.solo { flex: 0; }
.dbig { font-size: clamp(30px, 6vw, 80px); font-weight: 700; color: var(--green); margin: 0 0 2vh; }
.dchange { font-size: clamp(24px, 4.5vw, 60px); font-weight: 700; color: var(--accent); margin: 2vh 0 0; }
.hint { color: var(--muted); font-size: 14px; }
/* Varieties of one item */
.ptabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 8px 0 12px; }
.ptabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; padding: 8px 14px; }
.ptabs button.on { border-bottom-color: var(--accent); color: var(--green); font-weight: 700; }
.ptabs button:disabled { color: var(--muted); cursor: not-allowed; }
.pcard.fam { border-left: 4px solid var(--accent); }
.famopt { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px; font-size: 17px; }
.famopt small { grid-column: 1 / -1; margin: 0; }
/* Expiry dates */
input.dateinp { width: 160px; min-height: 36px; padding: 6px 8px; }
.note .tag { margin-left: 2px; }
/* Product pictures and the import check list */
img.pimg { width: 100%; height: 84px; object-fit: cover; border-radius: 6px; background: #eef1f5; }
.pcell { display: flex; gap: 10px; align-items: center; } .pcell img.pimg { width: 40px; height: 40px; flex: none; }
#pimgprev img { height: 64px; width: 64px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; }
.dialog.xwide { max-width: 1040px; }
.tablewrap.imp { max-height: 48vh; overflow: auto; } .tablewrap.imp th { position: sticky; top: 0; }
tr.off td { opacity: .45; } td input[type=checkbox], th input[type=checkbox] { width: 20px; height: 20px; min-height: 0; }
.tag.ok { background: #dcf5e6; color: #0f6b43; }
.tplrow { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
/* Activity and delete-data */
.badge { background: var(--accent); color: #fff; border-radius: 99px; padding: 1px 7px; font-size: 12px; font-weight: 700; margin-left: 4px; }
tr.new td { background: #fff6e0; }
.card.danger { border-color: #e7c2bf; } .card.danger h3, h2.neg { color: var(--red); }
button.dangerbtn { background: var(--red); border-color: var(--red); } button.dangerbtn:hover { background: #8f1d17; }
.dialog ul { margin: 6px 0 10px; padding-left: 22px; }

/* ================= Friendly look: raised buttons you can press, colour and icons ================= */
body { background: linear-gradient(180deg, #eef3fb 0%, #f7f9fc 240px); background-attachment: fixed; }
button { border-radius: 12px; font-weight: 600; border: 1px solid #cfd7e3; border-bottom-width: 4px; border-bottom-color: #b4bfd0; background: linear-gradient(180deg, #fff, #f1f4f9);
  box-shadow: 0 1px 2px rgba(20, 30, 60, .08); transition: transform .06s ease, box-shadow .06s ease, filter .12s; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button:hover { filter: brightness(1.03); }
button:active:not(:disabled) { transform: translateY(3px); border-bottom-width: 1px; margin-bottom: 3px; box-shadow: none; }
button:disabled { opacity: .5; cursor: not-allowed; }
button.link, .tabs button, .ptabs button, .results button, .rowbtns button, .swatches button { margin-bottom: 0; }
button.link { background: none; border: 0; box-shadow: none; font-weight: 500; } button.link:active { transform: none; margin: 0; }
button.primary { border: 0; border-bottom: 5px solid var(--green-d); background: linear-gradient(180deg, color-mix(in srgb, var(--green) 82%, #fff), var(--green)); color: var(--on);
  text-shadow: 0 1px 1px rgba(0, 0, 0, .25); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35), 0 3px 8px rgba(20, 30, 60, .18); letter-spacing: .01em; }
button.primary:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 82%, #fff), var(--green)); }
button.primary:active:not(:disabled) { border-bottom-width: 1px; margin-bottom: 4px; transform: translateY(4px); }
button.danger { color: var(--red); border-color: #f0c4c0; border-bottom-color: #dd9a94; background: linear-gradient(180deg, #fff, #fdeeee); }
button.dangerbtn { background: linear-gradient(180deg, #e0463c, var(--red)); border-bottom-color: #7c1712; color: #fff; }
button.big { padding: 16px; font-size: 20px; border-radius: 16px; }
/* the pay button: green means go */
button.chargebtn { background: linear-gradient(180deg, #34c466, #16a34a); border-bottom-color: #0d7a35; color: #fff; font-size: 22px; }
button.chargebtn:hover { background: linear-gradient(180deg, #34c466, #16a34a); }

.top { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 85%, #fff), var(--green)); box-shadow: 0 2px 8px rgba(20, 30, 60, .2); }
.soundbtn { border: 0; background: rgba(255, 255, 255, .18); box-shadow: none; min-height: 34px; padding: 4px 10px; border-radius: 99px; font-size: 16px; } .soundbtn:active { margin: 0 !important; transform: scale(.92) !important; }
.tabs { gap: 6px; padding: 8px; background: #fff; border-bottom: 1px solid var(--line); }
.tabs button { border: 1px solid #d5dce8; border-bottom-width: 3px; border-radius: 12px; padding: 8px 14px; background: linear-gradient(180deg, #fff, #f1f4f9); display: flex; align-items: center; gap: 6px; }
.tabs button .ti { font-size: 18px; line-height: 1; }
.tabs button.on { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 82%, #fff), var(--green)); color: var(--on); border-color: var(--green-d); border-bottom-color: var(--accent); font-weight: 700; }
.tabs button:active { transform: translateY(2px); border-bottom-width: 1px; margin-bottom: 2px; }

/* product tiles */
.grid { gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.pcard { --tile: var(--green); padding: 10px; border-radius: 16px; border: 1px solid #d5dce8; border-top: 6px solid var(--tile); border-bottom: 5px solid #b4bfd0; background: #fff; min-height: 120px; box-shadow: 0 2px 6px rgba(20, 30, 60, .08); }
.pcard:active { transform: translateY(4px) scale(.98) !important; border-bottom-width: 1px; margin-bottom: 4px !important; }
.pcard.fam { border-left: 1px solid #d5dce8; background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--tile) 8%, #fff)); }
.pletter { display: flex; align-items: center; justify-content: center; width: 100%; height: 64px; border-radius: 10px; font-size: 34px; font-weight: 800; color: #fff; background: linear-gradient(135deg, color-mix(in srgb, var(--tile) 75%, #fff), var(--tile)); text-shadow: 0 2px 2px rgba(0, 0, 0, .2); }
img.pimg { border-radius: 10px; } .pname { font-size: 15px; } .pprice { color: var(--tile); font-size: 17px; filter: brightness(.85); }
.chips { gap: 8px; }
.chips button { --tile: var(--green); border-radius: 99px; border: 2px solid var(--tile); border-bottom-width: 4px; color: var(--tile); background: #fff; font-weight: 700; padding: 6px 16px; min-height: 38px; }
.chips button.on { background: var(--tile); color: #fff; border-color: var(--tile); text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
.searchrow input { border-radius: 14px; border: 2px solid #c9d3e3; box-shadow: inset 0 2px 4px rgba(20, 30, 60, .06); }

/* cart */
.cart { border-radius: 18px; box-shadow: 0 4px 14px rgba(20, 30, 60, .1); }
.stepper button { border-radius: 50%; width: 42px; height: 42px; min-height: 0; font-size: 22px; font-weight: 800; color: #fff; border: 0; border-bottom: 4px solid rgba(0, 0, 0, .25); }
.stepper button:first-child { background: linear-gradient(180deg, #f2665c, #dc2626); } .stepper button:last-child { background: linear-gradient(180deg, #34c466, #16a34a); }
.stepper button:active { border-bottom-width: 1px !important; margin-bottom: 3px !important; }
.stepper input { border-radius: 10px; font-weight: 700; font-size: 17px; }
.sum.total b { color: #16a34a; font-size: 26px; }
.cartbar { background: linear-gradient(180deg, #34c466, #16a34a); border-bottom: 5px solid #0d7a35; }

/* paying */
.methods button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 8px; border-radius: 14px; }
.methods .mi { font-size: 26px; line-height: 1; }
.methods button.on { color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); border-color: transparent; border-bottom-color: rgba(0, 0, 0, .3); }
.methods button[data-m=cash].on { background: linear-gradient(180deg, #34c466, #16a34a); }
.methods button[data-m=orange_money].on { background: linear-gradient(180deg, #ff9a3d, #ea580c); }
.methods button[data-m=afrimoney].on { background: linear-gradient(180deg, #e2559b, #be185d); }
.methods button[data-m=credit].on { background: linear-gradient(180deg, #6b7fa3, #475569); }
.change { color: #16a34a; }
.done { font-size: 22px; animation: pop .45s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { 0% { transform: scale(.5); } 100% { transform: scale(1); } }
.dialog { border-radius: 20px; box-shadow: 0 20px 50px rgba(10, 20, 50, .35); animation: rise .18s ease-out; }
@keyframes rise { from { transform: translateY(14px); } to { transform: none; } }
input, select, textarea { border-radius: 10px; }
.card, .tile, .tablewrap { border-radius: 14px; box-shadow: 0 2px 6px rgba(20, 30, 60, .06); }
.tile b { color: var(--green); }
#toast { border-radius: 14px; font-weight: 600; padding: 12px 20px; box-shadow: 0 8px 20px rgba(0, 0, 0, .3); }
@media (prefers-reduced-motion: reduce) { .done, .dialog { animation: none; } button { transition: none; } }
@media print { .dialog { box-shadow: none; animation: none; } }
button.link.danger { background: none; border: 0; }
details { margin: 8px 0; } details summary { cursor: pointer; color: var(--green); font-weight: 600; }
/* Photo mode */
.photoname { font-size: 22px; font-weight: 800; text-align: center; margin: 6px 0 10px; }
.photoprev { height: 230px; display: flex; align-items: center; justify-content: center; background: #f1f4f9; border: 2px dashed #c9d3e3; border-radius: 16px; margin-bottom: 12px; overflow: hidden; }
.photoprev img { max-width: 100%; max-height: 100%; object-fit: contain; }
.btnlike { display: block; text-align: center; cursor: pointer; margin: 0 0 10px; padding: 16px; font-size: 20px; font-weight: 700; color: #fff; border-radius: 16px; border-bottom: 5px solid #0d7a35;
  background: linear-gradient(180deg, #34c466, #16a34a); text-shadow: 0 1px 1px rgba(0, 0, 0, .25); box-shadow: 0 3px 8px rgba(20, 30, 60, .18); }
.btnlike:active { transform: translateY(4px); border-bottom-width: 1px; margin-bottom: 14px; }
/* Receipt settings, paper sizes, QR codes */
.receipt.f-small { font-size: 11px; } .receipt.f-large { font-size: 15.5px; } .receipt.f-small h3 { font-size: 14px; } .receipt.f-large h3 { font-size: 19px; }
.papersel { margin: 10px 0 0; font-size: 13px; } .papersel label { margin: 0; } .papersel select { min-height: 34px; padding: 4px 8px; }
.rcprev { border: 1px dashed #b4bfd0; border-radius: 10px; padding: 12px; background: #fff; margin: 0 auto; }
.qrbtn { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 10px; margin: 6px 0; border-radius: 14px; border: 2px solid var(--green); border-bottom-width: 5px; }
.qrbtn img { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: #fff; } .qrbtn span { font-weight: 700; } .qrbtn small { font-weight: 500; margin-top: 2px; }
.qrover { position: fixed; inset: 0; z-index: 60; background: #fff; display: flex; align-items: center; justify-content: center; padding: 16px; overflow-y: auto; }
.qrcard { width: 100%; max-width: 460px; text-align: center; }
.qrcard img { width: min(86vw, 62vh, 440px); height: auto; border: 1px solid var(--line); border-radius: 12px; }
.qrtitle { font-size: 24px; font-weight: 800; margin: 0 0 10px; } .qramt { font-size: 38px; font-weight: 800; color: #16a34a; margin: 10px 0 4px; } .qrnote { font-size: 18px; margin: 0 0 14px; }
.qrsetup { text-align: center; margin-bottom: 10px; } .qrsetup img { max-width: 220px; max-height: 220px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 10px; }
.qrrow { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); } .qrrow:last-child { border-bottom: 0; } .qrrow div { flex: 1; }
.qrrow img, .qrnone { width: 56px; height: 56px; object-fit: contain; border: 1px solid var(--line); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 12px; }
img.dqr { max-height: 52vh; max-width: 70vw; border-radius: 12px; } .dnote { font-size: clamp(16px, 2.6vw, 30px); }
@media print { .qrover { display: none; } }
.rline span:last-child { white-space: nowrap; }
/* Fixed category tabs on the Sell screen */
.catalog .chips { position: sticky; top: 56px; z-index: 4; background: #f1f5fb; padding: 10px 2px; margin: 0 -2px; flex-wrap: nowrap; }
.chips button .ci { font-size: 18px; margin-right: 5px; line-height: 1; }
.chips button { display: flex; align-items: center; padding: 8px 14px; min-height: 44px; font-size: 15px; }
button.star { border: 0; background: none; box-shadow: none; font-size: 20px; padding: 2px 6px; min-height: 0; color: #9aa6b8; } button.star.on { color: #ca8a04; } button.star:active { margin: 0 !important; transform: scale(.85) !important; }
/* Coloured receipts, matching the shop's colours */
.receipt .rhead { background: var(--green); color: var(--on); margin: -2px -6px 8px; padding: 12px 8px 10px; border-bottom: 5px solid var(--accent); border-radius: 10px 10px 0 0; }
.receipt .rhead h3 { margin: 0; color: var(--on); } .receipt .rhead img.logo-big { background: #fff; border-radius: 10px; padding: 4px; margin-bottom: 8px; }
.receipt hr { border-top: 2px dashed var(--accent); }
.receipt .rline.tot { background: var(--green); color: var(--on); padding: 6px 8px; margin: 4px -4px; border-radius: 6px; }
.receipt .thanks { color: var(--green); font-weight: 700; } .receipt .stamp { color: var(--accent); border-color: var(--accent); }
.sell > .catalog { min-width: 0; } .catalog .chips { overflow-x: auto; scrollbar-width: thin; }
/* Arranging Favourites and tabs */
#arrbtn.on { background: linear-gradient(180deg, #34c466, #16a34a); color: #fff; border-color: #0d7a35; }
.arrnote { margin: 0 0 10px; }
.pcard { position: relative; }
.grid.arranging .pcard { outline: 2px dashed var(--accent); outline-offset: -2px; }
.abadge { position: absolute; top: 4px; right: 4px; z-index: 1; background: #fff; border-radius: 99px; padding: 2px 7px; font-size: 12px; font-weight: 700; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.arrbtns, .arrtabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 14px; }
.arrtabs button { --tile: #475569; border-radius: 99px; border: 2px solid var(--tile); border-bottom-width: 4px; color: var(--tile); font-weight: 700; display: flex; align-items: center; padding: 8px 14px; }
.arrtabs button.on { background: var(--tile); color: #fff; } .arrtabs .ci { font-size: 18px; margin-right: 5px; }
.searchrow { flex-wrap: wrap; } .searchrow input { flex: 1 1 220px; min-width: 0; }
/* Editing the tabs */
.arrnote button { margin-left: 8px; padding: 5px 10px; min-height: 32px; }
.tbrow { display: flex; align-items: center; gap: 6px; padding: 6px; border: 2px solid transparent; border-radius: 12px; }
.tbrow.sel { border-color: var(--green); background: #f1f5fd; }
.tbrow .tbicon { width: 58px; text-align: center; font-size: 22px; padding: 4px; } .tbrow .tbname { flex: 1; min-width: 0; }
.tbrow small { width: 64px; text-align: right; } .tbrow button { padding: 0 10px; min-height: 38px; }
.tbicons { display: flex; flex-wrap: wrap; gap: 4px; } .tbicons button { font-size: 20px; padding: 2px 8px; min-height: 38px; }
/* Camera barcode scanner */
.scanover { position: fixed; inset: 0; z-index: 80; background: #0b1220; display: flex; align-items: center; justify-content: center; padding: 12px; }
.scanbox { width: 100%; max-width: 560px; text-align: center; color: #fff; }
.scantitle { font-size: 20px; font-weight: 700; margin: 0 0 10px; }
.scanview { position: relative; border-radius: 16px; overflow: hidden; background: #000; }
.scanview video { display: block; width: 100%; max-height: 62vh; object-fit: cover; border-radius: 0; }
.scanframe { position: absolute; left: 8%; right: 8%; top: 28%; bottom: 28%; border: 3px solid #34c466; border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35); pointer-events: none; }
.scanmsg { font-size: 18px; font-weight: 600; min-height: 26px; margin: 12px 0; }
.scanover .actions { justify-content: center; } .scanover .actions .big { max-width: 320px; }
.withscan { display: flex; gap: 8px; align-items: flex-end; } .withscan label { flex: 1; } .withscan button { margin-bottom: 10px; white-space: nowrap; }
/* Item menu by right-click or long press; Add tile; Edit tabs button */
.pcard { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.pcard.addcard { border-style: dashed; border-top-style: dashed; --tile: #94a3b8; } .pcard.addcard .pletter { background: #e8edf5; color: #475569; text-shadow: none; }
.tip { margin: 0 0 8px; font-size: 13px; }
.chips button.tabedit { --tile: #64748b; border-style: dashed; white-space: nowrap; }
.fplist { max-height: 46vh; overflow-y: auto; margin: 10px 0; }
/* Photo studio */
.studio { position: fixed; inset: 0; z-index: 75; background: rgba(11, 18, 32, .92); display: flex; align-items: flex-start; justify-content: center; padding: 12px; overflow-y: auto; }
.stbox { width: 100%; max-width: 460px; background: #fff; border-radius: 20px; padding: 16px; margin: auto; }
.sttitle { font-size: 20px; font-weight: 800; margin: 0 0 10px; text-align: center; }
.stview canvas { display: block; width: 100%; max-width: 360px; height: auto; margin: 0 auto; border-radius: 14px; border: 1px solid var(--line); }
.checker { background-image: linear-gradient(45deg, #d7dde6 25%, transparent 25%), linear-gradient(-45deg, #d7dde6 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #d7dde6 75%), linear-gradient(-45deg, transparent 75%, #d7dde6 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; background-color: #fff; }
.stmsg { text-align: center; font-weight: 600; margin: 10px 0 4px; min-height: 22px; }
.stbg { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.stbg button { width: 44px; height: 44px; min-height: 0; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px #b4bfd0; font-size: 18px; }
.stbg button.on { box-shadow: 0 0 0 3px var(--text); } .stbg button:active { margin: 0 !important; transform: scale(.9) !important; }
.stbgname { font-size: 14px; color: var(--muted); margin-left: 4px; }
/* Square studio pictures are shown whole, never cropped */
img.pimg { object-fit: contain; background: #fff; } .pcell img.pimg { object-fit: contain; }
/* GST option and item refunds */
.gstrow { justify-content: flex-start; padding: 6px 0; margin: 0; font-size: 16px; } .gstrow b { margin-left: auto; }
.refamt { font-size: 22px; margin: 12px 0 2px; } .refamt b { color: var(--red); }
form.inline { align-items: flex-end; } form.inline label { flex: 1; margin: 0; }
/* Accounts (money trail) and damaged / expired items */
.mt-week { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.mt-sums { margin-top: 6px; gap: 0 24px; } .mt-wait { border: 2px solid var(--accent); }
.lo-why { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 6px; }
.lo-why button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 6px; border-radius: 14px; font-size: 14px; } .lo-why .mi { font-size: 26px; line-height: 1; }
.lo-why button.on { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 82%, #fff), var(--green)); color: var(--on); border-color: var(--green-d); }
.note button { padding: 5px 10px; min-height: 32px; margin-left: 6px; }
.rowacts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; } .rowacts button { padding: 6px 12px; min-height: 36px; } .rowacts button.primary { border-bottom-width: 3px; }
.auth { position: relative; } .auth .themebtn { position: absolute; top: 10px; right: 10px; background: var(--bg); }

/* ================= Dark mode =================
   Switched on by <html data-theme="dark">. ":where" keeps each rule exactly as strong as the light rule it replaces. */
:root[data-theme=dark] { color-scheme: dark; --bg: #0f1420; --card: #1a2130; --line: #2e394d; --text: #e6eaf2; --muted: #9ba8bd; --red: #f87171; --amber: #f5b74a;
  --ink: color-mix(in srgb, var(--green) 45%, #fff); /* the shop colour, light enough to read as text on dark */ }
:where([data-theme=dark]) body { background: var(--bg); }
:where([data-theme=dark]) button { background: linear-gradient(180deg, #2b3447, #232b3b); border-color: #3b475d; border-bottom-color: #121723; box-shadow: none; }
:where([data-theme=dark]) button.link, :where([data-theme=dark]) button.star, :where([data-theme=dark]) button.link.danger { background: none; }
:where([data-theme=dark]) button.primary, :where([data-theme=dark]) button.primary:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 82%, #fff), var(--green)); border-bottom-color: var(--green-d); }
:where([data-theme=dark]) button.danger { color: var(--red); border-color: #6b3036; border-bottom-color: #3d1a1e; background: linear-gradient(180deg, #3a2226, #2e1b1f); }
:where([data-theme=dark]) button.dangerbtn { background: linear-gradient(180deg, #e0463c, #b3261e); border-bottom-color: #7c1712; color: #fff; }
:where([data-theme=dark]) button.chargebtn, :where([data-theme=dark]) button.chargebtn:hover { background: linear-gradient(180deg, #34c466, #16a34a); border-bottom-color: #0d7a35; }
:where([data-theme=dark]) .cartbar { background: linear-gradient(180deg, #34c466, #16a34a); border-bottom-color: #0d7a35; }
:where([data-theme=dark]) .soundbtn { background: rgba(255, 255, 255, .18); }
:where([data-theme=dark]) input, :where([data-theme=dark]) select, :where([data-theme=dark]) textarea { background: #111725; border-color: #3b475d; }
:where([data-theme=dark]) .searchrow input { border-color: #3b475d; box-shadow: none; }
:where([data-theme=dark]) .note { background: #3a2f12; border-color: #6b5620; }
:where([data-theme=dark]) .pill { background: #111725; }
:where([data-theme=dark]) .tabs { background: var(--card); }
:where([data-theme=dark]) .tabs button { background: linear-gradient(180deg, #2b3447, #232b3b); border-color: #3b475d; border-bottom-color: #121723; }
:where([data-theme=dark]) .tabs button.on { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 82%, #fff), var(--green)); border-color: var(--green-d); border-bottom-color: var(--accent); }
:where([data-theme=dark]) th { background: #212a3b; }
:where([data-theme=dark]) tr.click:hover, :where([data-theme=dark]) .tbrow.sel { background: #242e41; }
:where([data-theme=dark]) tr.new td { background: #3a2f12; }
:where([data-theme=dark]) .pos, :where([data-theme=dark]) .done, :where([data-theme=dark]) .tile b, :where([data-theme=dark]) details summary, :where([data-theme=dark]) .ptabs button.on { color: var(--ink); }
:where([data-theme=dark]) .tag { background: #2e394d; } :where([data-theme=dark]) .tag.warn { background: #4a3a12; color: var(--amber); } :where([data-theme=dark]) .tag.bad { background: #4a1f1f; color: var(--red); } :where([data-theme=dark]) .tag.ok { background: #153d2a; color: #6fdc9f; }
:where([data-theme=dark]) .track { background: #2e394d; } :where([data-theme=dark]) .track div { background: var(--ink); }
:where([data-theme=dark]) .dialog, :where([data-theme=dark]) .stbox { background: var(--card); }
:where([data-theme=dark]) .backdrop { background: rgba(0, 0, 0, .65); }
:where([data-theme=dark]) #toast { background: #36425c; } :where([data-theme=dark]) #toast.err { background: #b3261e; }
:where([data-theme=dark]) .swatches button, :where([data-theme=dark]) .stbg button { border-color: var(--card); }
:where([data-theme=dark]) .card.danger { border-color: #6b3036; }
:where([data-theme=dark]) .pcard { background: var(--card); border-color: #3b475d; border-top-color: var(--tile); border-bottom-color: #121723; box-shadow: none; }
:where([data-theme=dark]) .pcard.fam { border-left-color: #3b475d; background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--tile) 16%, var(--card))); }
:where([data-theme=dark]) .pcard.addcard .pletter { background: #2e394d; color: #c3cde0; }
:where([data-theme=dark]) .pprice { color: color-mix(in srgb, var(--tile) 60%, #fff); filter: none; }
:where([data-theme=dark]) .chips button, :where([data-theme=dark]) .arrtabs button { background: var(--card); color: color-mix(in srgb, var(--tile) 55%, #fff); }
:where([data-theme=dark]) .chips button.on, :where([data-theme=dark]) .arrtabs button.on { background: var(--tile); color: #fff; }
:where([data-theme=dark]) .catalog .chips { background: var(--bg); }
:where([data-theme=dark]) .sum.total b, :where([data-theme=dark]) .change, :where([data-theme=dark]) .qramt { color: #4ade80; }
:where([data-theme=dark]) .photoprev { background: #111725; border-color: #3b475d; }
:where([data-theme=dark]) .abadge { color: #17201b; }
:where([data-theme=dark]) .methods button.on, :where([data-theme=dark]) #arrbtn.on { color: #fff; }
:where([data-theme=dark]) #arrbtn.on { background: linear-gradient(180deg, #34c466, #16a34a); }
:where([data-theme=dark]) .methods button[data-m=cash].on { background: linear-gradient(180deg, #34c466, #16a34a); }
:where([data-theme=dark]) .methods button[data-m=orange_money].on { background: linear-gradient(180deg, #ff9a3d, #ea580c); }
:where([data-theme=dark]) .methods button[data-m=afrimoney].on { background: linear-gradient(180deg, #e2559b, #be185d); }
:where([data-theme=dark]) .methods button[data-m=credit].on { background: linear-gradient(180deg, #6b7fa3, #475569); }
:where([data-theme=dark]) .stepper button:first-child { background: linear-gradient(180deg, #f2665c, #dc2626); } :where([data-theme=dark]) .stepper button:last-child { background: linear-gradient(180deg, #34c466, #16a34a); }
:where([data-theme=dark]) .lo-why button.on { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 82%, #fff), var(--green)); }
:where([data-theme=dark]) .btnlike { color: #fff; }
/* Receipts and QR codes stay on white "paper", so they look the same as the print and scan properly */
:where([data-theme=dark]) .receipt, :where([data-theme=dark]) .qrover { --text: #17201b; --muted: #5f6b64; --line: #dfe5e0; --red: #b3261e; color: #17201b; }
:where([data-theme=dark]) .receipt { background: #fff; border-radius: 10px; padding: 2px 6px 10px; }
@media print { :where([data-theme=dark]) body, :where([data-theme=dark]) .dialog { background: #fff; color: #000; } }
