/* OxiSeller: the shop's counter and back office. Oxi platform palette; palm-oil gold marks money and the main action.
   The counter total and the receipt slip carry the personality; everything else stays quiet. */
:root {
  --bg: #F5F3EC;
  --paper: #FFFFFF;
  --ink: #0C1410;
  --muted: #56615B;
  --line: #E0DCD0;
  --palm: #C2401E;
  --palm-ink: #8F2E14;
  --palm-wash: #FFE6DE;
  --adire: #2F4BFF;
  --adire-wash: #E3E8FF;
  --laterite: #237A42;
  --laterite-wash: #F7E7DF;
  --leaf: #0F3D2E;
  --leaf-wash: #E2F0E6;
  --radius: 12px;
  --tab-h: 62px;
  font-size: 16px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A0F0C; --paper: #121A16; --ink: #EEF2EC; --muted: #9DA8A2; --line: #24302A;
    --palm: #FF7656; --palm-ink: #FF9A80; --palm-wash: #3A1A12; --adire: #7D8FFF; --adire-wash: #141C3A;
    --laterite: #4CC27A; --laterite-wash: #33201A; --leaf: #9FD9B8; --leaf-wash: #18301F;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: "Inter Tight", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; line-height: 1.45; }
a { color: var(--adire); }
:focus-visible { outline: 3px solid var(--palm); outline-offset: 2px; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5rem; font-stretch: 87.5%; }
h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.2rem; font-weight: 750; }
h3 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 .75rem; max-width: 68ch; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.num, .money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Frame: a side rail on wide screens, a tab bar on phones ---------- */
.frame { min-height: 100vh; display: grid; grid-template-columns: 220px 1fr; }
.rail { background: var(--paper); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; }
.mark { display: block; padding: 4px 10px 14px; text-decoration: none; color: var(--ink); }
.mark b { display: block; font-weight: 800; font-stretch: 75%; font-size: 1.45rem; color: var(--palm); letter-spacing: -.01em; }
.mark span { font-size: .8rem; color: var(--muted); }
.tab { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--radius); color: var(--ink); text-decoration: none; font-weight: 600; border: 0; background: none; text-align: left; cursor: pointer; width: 100%; }
.tab svg { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; }
.tab:hover { background: var(--bg); }
.tab[aria-current="page"] { background: var(--palm-wash); color: var(--palm-ink); }
.tab .badge { margin-left: auto; }
.rail .spacer { flex: 1; }
.main { padding: 20px 24px 40px; min-width: 0; }
.topline { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.topline h1 { margin: 0 auto 0 0; }
.shopname { font-weight: 700; }
@media (max-width: 760px) {
  .frame { display: block; }
  .rail { position: fixed; z-index: 30; inset: auto 0 0 0; height: var(--tab-h); flex-direction: row; padding: 4px 6px calc(4px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); justify-content: space-around; }
  .rail .mark, .rail .spacer, .rail .wide-only { display: none; }
  .tab { flex-direction: column; gap: 2px; font-size: .7rem; padding: 6px 4px; width: auto; flex: 1; justify-content: center; text-align: center; }
  .tab .badge { position: absolute; margin: -4px 0 0 18px; }
  .main { padding: 14px 16px calc(var(--tab-h) + 24px); }
  /* Keep the Oxi Support button above the bottom tab bar instead of over its last tab. */
  :root { --oxs-lift: var(--tab-h); }
  h1 { font-size: 1.35rem; }
}

/* ---------- Controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; padding: 0 16px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--paper); color: var(--ink); font-weight: 650; cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--palm); border-color: var(--palm); color: #fff; }
.btn.primary:hover { background: var(--palm-ink); }
.btn.quiet { border-color: transparent; background: none; color: var(--adire); padding: 0 8px; }
.btn.danger { color: var(--laterite); border-color: var(--laterite); }
.btn.big { min-height: 56px; font-size: 1.1rem; width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 4px; }
label.f > small { display: block; color: var(--muted); font-size: .8rem; margin-top: 3px; }
input[type=text], input[type=tel], input[type=email], input[type=number], input[type=date], input[type=search], input[type=password], select, textarea {
  width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper);
}
textarea { min-height: 80px; }
input:focus, select:focus, textarea:focus { border-color: var(--palm); outline: none; box-shadow: 0 0 0 3px var(--palm-wash); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
@media (max-width: 560px) { .grid2, .grid3 { grid-template-columns: 1fr; } }
.check { display: flex; gap: 8px; align-items: flex-start; margin-bottom: 10px; }
.check input { width: 18px; height: 18px; margin-top: 2px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 999px; padding: 6px 12px; cursor: pointer; font-size: .875rem; font-weight: 600; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
a.chip { color: var(--ink); text-decoration: none; }
a.chip[aria-pressed="true"] { color: var(--paper); }

/* ---------- Surfaces ---------- */
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.panel > h2:first-child, .panel > h3:first-child { margin-top: 0; }
.cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 960px) { .cols { grid-template-columns: 1fr; } }
.list { list-style: none; margin: 0; padding: 0; }
.list > li { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid var(--line); }
.list > li:last-child { border-bottom: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; }
.list button.row { all: unset; display: flex; gap: 12px; align-items: center; width: 100%; cursor: pointer; }
.list button.row:focus-visible { outline: 3px solid var(--palm); outline-offset: 2px; }
table.t { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.t th { text-align: left; font-weight: 650; color: var(--muted); font-size: .8rem; padding: 6px 8px; border-bottom: 1px solid var(--line); }
table.t td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t td.num, table.t th.num { text-align: right; }
.scroll { overflow-x: auto; }
.badge { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: var(--bg); color: var(--muted); white-space: nowrap; }
.badge.gold { background: var(--palm-wash); color: var(--palm-ink); }
.badge.blue { background: var(--adire-wash); color: var(--adire); }
.badge.red { background: var(--laterite-wash); color: var(--laterite); }
.badge.green { background: var(--leaf-wash); color: var(--leaf); }
.note { border-left: 3px solid var(--adire); background: var(--adire-wash); padding: 10px 12px; border-radius: 0 var(--radius) var(--radius) 0; margin-bottom: 14px; }
.note.warn { border-color: var(--laterite); background: var(--laterite-wash); }
.note.good { border-color: var(--leaf); background: var(--leaf-wash); }
.empty { text-align: center; color: var(--muted); padding: 32px 12px; }
.empty .btn { margin-top: 10px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.kpi b { display: block; font-size: 1.35rem; font-stretch: 87.5%; font-variant-numeric: tabular-nums; }
.kpi span { font-size: .82rem; color: var(--muted); }

/* ---------- The counter ---------- */
.counter { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
@media (max-width: 960px) { .counter { grid-template-columns: 1fr; } }
.scanbar { display: flex; gap: 8px; margin-bottom: 12px; }
.scanbar input { font-size: 1.05rem; min-height: 48px; }
.scanbar .btn { min-height: 48px; }
.results { margin-bottom: 14px; }
.cart { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); position: sticky; top: 16px; }
.cart-lines { list-style: none; margin: 0; padding: 4px 14px; max-height: 46vh; overflow: auto; }
.cart-lines li { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cart-lines li:last-child { border-bottom: 0; }
.cart-lines .qty { display: flex; gap: 4px; align-items: center; grid-column: 1 / -1; flex-wrap: wrap; }
.cart-lines .qty .btn { min-height: 30px; padding: 0 6px; font-size: .85rem; }
.cart-lines .qty button:not(.btn) { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); cursor: pointer; }
.total { padding: 14px; border-top: 2px solid var(--ink); }
.total .label { font-size: .85rem; color: var(--muted); display: flex; justify-content: space-between; }
.grand { font-size: 2.6rem; font-weight: 800; font-stretch: 75%; letter-spacing: -.02em; color: var(--palm-ink); font-variant-numeric: tabular-nums; line-height: 1; margin: 6px 0 12px; }
.tenders { display: grid; gap: 8px; margin-bottom: 12px; }
.tender { display: grid; grid-template-columns: 110px 1fr; gap: 8px; align-items: center; }
.change { font-weight: 700; color: var(--leaf); }

/* ---------- The receipt slip (documents and receipts) ---------- */
.slip { background: #fff; color: #0C1410; max-width: 420px; margin: 0 auto 16px; padding: 22px 20px 26px; border: 1px solid var(--line); font-variant-numeric: tabular-nums;
  -webkit-mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 14px 100% repeat-x; mask: radial-gradient(circle 6px at 50% 100%, transparent 98%, #000) 0 0 / 14px 100% repeat-x; }
.slip h2 { text-align: center; font-stretch: 75%; font-size: 1.4rem; margin-bottom: 2px; }
.slip .center { text-align: center; }
.slip .line-pic { float: left; width: 64px; height: 64px; object-fit: cover; border-radius: 6px; margin: 2px 10px 4px 0; background: #EEF1EE; }
.slip td::after { content: ''; display: block; clear: both; }
.slip hr { border: 0; border-top: 1px dashed #9AA59E; margin: 12px 0; }
.slip table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.slip td { padding: 3px 0; vertical-align: top; }
.slip td.num { text-align: right; padding-left: 8px; }
.slip .big td { font-size: 1.3rem; font-weight: 800; padding-top: 8px; }
.slip .meta { font-size: .82rem; color: #56615B; }

/* ---------- Dialog ---------- */
dialog { border: 0; border-radius: var(--radius); padding: 0; width: min(520px, calc(100vw - 24px)); background: var(--paper); color: var(--ink); box-shadow: 0 18px 50px rgba(15, 30, 20, .25); }
dialog::backdrop { background: rgba(18, 26, 21, .45); }
dialog form, dialog .body { padding: 18px; }
.scandlg > h2, .scandlg > video, .scandlg > p, .scandlg > .scan-photo { margin-left: 18px; margin-right: 18px; }
.scandlg > h2 { margin-top: 18px; }
.scandlg > video.scanner { width: calc(100% - 36px); }
dialog .foot { display: flex; gap: 8px; justify-content: flex-end; padding: 12px 18px; border-top: 1px solid var(--line); }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 18px); transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius); z-index: 50; max-width: calc(100vw - 32px); }
.toast.bad { background: var(--laterite); color: #fff; }
.offline { background: var(--laterite); color: #fff; text-align: center; padding: 6px; font-size: .875rem; font-weight: 600; }
video.scanner { width: 100%; max-height: 320px; object-fit: cover; background: #000; border-radius: var(--radius); }
.scan-last { min-height: 1.4em; margin: 8px 0 0; font-weight: 700; }
.scandlg { width: min(520px, calc(100vw - 24px)); }

/* ---------- Landing and sign-in ---------- */
.landing { max-width: 1040px; margin: 0 auto; padding: 32px 20px 60px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 820px) { .landing { grid-template-columns: 1fr; gap: 24px; } }
.landing h1 { font-size: clamp(2rem, 5vw, 3.2rem); font-stretch: 75%; font-weight: 800; letter-spacing: -.02em; line-height: 1.02; margin-bottom: 16px; }
.landing .lede { font-size: 1.1rem; color: var(--muted); }
.landing ul.facts { padding-left: 18px; margin: 18px 0; }
.landing ul.facts li { margin-bottom: 6px; }
.signin-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.signin-box .flash { display: block; margin: 8px 0; font-size: .9rem; }
.signin-box .flash.bad, .signin-box .flash.error { color: var(--laterite); }
.signin-box input { margin-bottom: 10px; }
.signin-box button { min-height: 44px; padding: 0 16px; border-radius: var(--radius); border: 0; background: var(--palm); color: #fff; font-weight: 700; cursor: pointer; }
.hidden { display: none !important; }

@media print {
  .rail, .topline .btns, .no-print, .toast { display: none !important; }
  .frame { display: block; } .main { padding: 0; }
  body { background: #fff; }
  .slip { border: 0; -webkit-mask: none; mask: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* The picture sent with an item on a quote, proforma or invoice */
.pic-btn { flex: none; width: 52px; height: 52px; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); overflow: hidden; cursor: pointer; font-size: .65rem; line-height: 1.1; color: var(--muted, #5b675f); }
.pic-btn img, .pic-sm { width: 52px; height: 52px; object-fit: cover; display: block; border-radius: 8px; }
.pic-sm.empty { display: grid; place-items: center; font-size: .7rem; border: 1px dashed var(--line); }
.pic-choose { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; }
.pic-opt { display: grid; gap: 4px; padding: 4px; border: 2px solid var(--line); border-radius: 10px; background: var(--paper); cursor: pointer; text-align: center; }
.pic-opt img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.pic-opt.on { border-color: var(--gold, #C2401E); }
.pic-opt.none { place-items: center; min-height: 96px; }

/* A product picture from the barcode databases, before the seller uses it */
.barcode-pic { display: block; max-width: 180px; max-height: 180px; object-fit: contain; border-radius: 8px; border: 1px solid var(--line); margin: 8px 0; background: #fff; }

/* A chat with a buyer: the buyer on the left, the shop on the right, the reply box always in view */
.chat-log { display: flex; flex-direction: column; gap: 10px; padding: 4px 0 12px; }
.chat-log .msg { scroll-margin-bottom: 290px; max-width: min(82%, 560px); padding: 10px 12px; border-radius: 14px; background: var(--paper); border: 1px solid var(--line); }
.chat-log .msg.them { align-self: flex-start; border-bottom-left-radius: 4px; cursor: pointer; }
.chat-log .msg.them:hover, .chat-log .msg.them:focus-visible { border-color: var(--gold, #C2401E); }
.chat-log .msg.bot { align-self: flex-end; background: #F3F1EA; border-bottom-right-radius: 4px; }
.chat-log .msg.me { align-self: flex-end; background: #E7F2EA; border-color: #BFD9C6; border-bottom-right-radius: 4px; }
.chat-log .msg-meta { font-size: .78rem; color: var(--muted, #5b675f); margin-bottom: 2px; }
.chat-log .msg-body { white-space: pre-wrap; overflow-wrap: anywhere; }
.reply-bar { position: sticky; bottom: 0; z-index: 5; background: var(--bg, #F4F5F0); padding: 10px 0 12px; border-top: 1px solid var(--line); }
.reply-bar textarea { width: 100%; min-height: 64px; margin-bottom: 8px; font: inherit; padding: 10px; border: 1px solid var(--line); border-radius: 10px; }
@media (max-width: 760px) { .reply-bar { bottom: var(--tab-h); } }

/* The shop's logo, and paying an invoice (transfer / card) */
.shop-logo { max-height: 64px; max-width: 200px; object-fit: contain; display: inline-block; }
.slip .slip-logo { max-height: 72px; max-width: 220px; object-fit: contain; margin: 0 auto 6px; display: block; }
.paybox .payway { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.paybox .payway > summary { font-weight: 700; cursor: pointer; }
.paybox .bank { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0; }
.paybox .bank dt { color: var(--muted, #5b675f); }
.paybox .bank dd { margin: 0; }
.paybox .bank .acct { font-size: 1.2rem; letter-spacing: 1px; }

/* Oxi-Pay escrow on an invoice */
.paybox .escrow-box { border: 1px dashed var(--palm, #1f6b3a); border-radius: 10px; padding: 10px 12px; margin: 10px 0; background: #F2F8F3; }
.paybox .escrow-box p { margin: 0 0 8px; }

/* Menus: meal times and the Oxi menu library */
.meal-times { display: grid; gap: 8px; }
.meal-row { display: grid; grid-template-columns: minmax(120px, 1fr) minmax(0, 9rem) auto minmax(0, 9rem); gap: 8px; align-items: center; }
.meal-row input[type=time] { min-height: 40px; min-width: 0; width: 100%; }
@media (max-width: 560px) { .meal-row { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); } .meal-row .check { grid-column: 1 / -1; } }
.meal-times .btn { justify-self: start; margin-top: 4px; }
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.dish-card { display: grid; gap: 4px; align-content: start; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.dish-card img, .dish-nopic { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 8px; background: #EEF1EE; }
.dish-nopic { display: grid; place-items: center; font-size: .8rem; color: var(--muted, #5b675f); }
.dish-card .btn { justify-self: start; margin-top: 4px; }
/* A restaurant closed now (menu, basket): red and bold, with when it opens. */
.closed-banner { background: #fdecea; border: 2px solid #b3261e; color: #7a1712; border-radius: var(--radius); padding: 12px 14px; margin: 0 0 12px; font-size: 1rem; line-height: 1.4; }
.closed-banner b { color: #b3261e; font-weight: 800; font-size: 1.15rem; margin-right: 4px; }
/* The sign-up page's demo picker, and the ribbon on a demo shop's pages. */
.landing .demo-pick { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 28px; }
.landing .demo-pick h2 { font-size: 1.6rem; margin: 0 0 6px; }
.demo-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 14px; }
.demo-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); text-decoration: none; }
.demo-card:hover, .demo-card:focus-visible { border-color: var(--palm); box-shadow: 0 4px 16px rgba(0, 0, 0, .08); }
.demo-card b { font-size: 1.05rem; }
.demo-card span { color: var(--muted); font-size: .92rem; }
.demo-card em { font-style: normal; font-weight: 700; color: var(--palm-ink); margin-top: auto; padding-top: 6px; }
.demo-ribbon { background: #1d1d1b; color: #fff; padding: 8px 16px; font-size: .9rem; text-align: center; }
.demo-ribbon a { color: #ffd27a; }
.meal-times .all-day { align-items: flex-start; margin-bottom: 10px; } .meal-times .all-day > span { display: block; }
.meal-rows { display: grid; gap: 8px; } .meal-rows[hidden] { display: none; }
