/* Material look in the style of the Loyverse back office. The shop theme
   (Appearance page, appearance.js) overrides --accent, --bar, --on-bar,
   --brand, --brand-dark, --bg, --card, --font and --font-size. */
:root {
  --bg: #f5f5f5; --card: #ffffff; --ink: #212121; --muted: #616161; --line: #e0e0e0;
  --accent: #4caf50; --bar: #48a64c; --on-bar: #ffffff; --brand: #39833c; --brand-dark: #285c2a;
  --brand-blue: #008ad2;
  --good: #1a7f4b; --good-bg: #e3f5ec;
  --bad: #b42323; --bad-bg: #fce9e9; --warn: #8a5a00; --warn-bg: #fff3d6; --info: #1c5fa8; --info-bg: #e6f0fb;
  --neutral-bg: #eeeeee;
  --shadow: 0 1px 3px rgba(0,0,0,.2), 0 1px 1px rgba(0,0,0,.14);
  --font: Roboto, "Segoe UI", system-ui, -apple-system, Arial, sans-serif; --font-size: 14px;
  font-family: var(--font); font-size: var(--font-size); color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); font-size: 1rem; line-height: 1.45; }
.hidden { display: none !important; }
.muted { color: var(--muted); } .small { font-size: .85rem; }
h1, h2, h3 { margin: 0; }

.login { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(var(--bar) 0 220px, var(--bg) 220px); padding: 20px; }
.login-card { background: var(--card); border-top: 4px solid var(--accent); border-radius: 2px; padding: 32px; width: 100%; max-width: 380px; display: grid; gap: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.25); }
.reveal { position: relative; display: block; }
/* PINs show as dots without being password boxes, so the browser never offers saved passwords for them. */
.pos-online { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 50; width: min(640px, calc(100% - 24px)); display: grid; gap: 8px; }
.pos-online-order { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: #fff8e1; color: #3e2723; border-left: 5px solid #ff8f00; border-radius: 4px; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.pos-online-order > .pos-svg { flex: none; width: 28px; height: 28px; fill: #ff8f00; }
.pos-online-order > span { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pos-online-sub { font-size: .85rem; opacity: .8; }
.pos-online-seen { flex: none; border: 0; border-radius: 3px; padding: 10px 16px; background: #ff8f00; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.pin-dots { -webkit-text-security: disc; text-security: disc; }
.reveal input { width: 100%; padding-right: 64px; }
.reveal-btn { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); border: 0; background: none; color: var(--accent); font: inherit; font-size: .8rem; font-weight: 600; text-transform: uppercase; padding: 6px 8px; cursor: pointer; }
.login-card h1 { font-size: 1.5rem; } .login-card p { margin: 0; }
.login-logo { display: block; width: 100%; max-width: 280px; height: auto; max-height: 160px; object-fit: contain; margin: 0 auto 8px; }
.sidebar-logo { background: #fff; border-radius: 2px; padding: 4px 8px; width: 138px; flex: none; }
/* An uploaded logo of any shape fits the space the Liquid Lye one had. */
.brand-logo { display: block; width: 100%; height: auto; max-height: 64px; object-fit: contain; }
.brand-icon { display: none; width: 32px; height: 36px; object-fit: contain; }
.app.collapsed .sidebar-logo { width: 42px; padding: 4px 8px; }
.app.collapsed .brand-logo { display: none; }
.app.collapsed .brand-icon { display: block; }
.form-error { color: var(--bad); min-height: 1.2em; font-size: .9rem; }
label { display: grid; gap: 5px; font-weight: 600; font-size: .85rem; }
input, select { padding: 9px 10px; border: 1px solid #bdbdbd; border-radius: 2px; font: inherit; background: #fff; color: var(--ink); }
input:focus, select:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Green top bar across the page, a white menu below it on the left (an icon
   rail when collapsed, as in the Loyverse back office). */
.app { display: grid; grid-template-columns: 220px 1fr; grid-template-rows: 48px 1fr; min-height: 100vh; transition: grid-template-columns .2s ease; }
.app.collapsed { grid-template-columns: 64px 1fr; }
.topbar { grid-column: 1 / -1; position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 8px; background: var(--bar); color: var(--on-bar); box-shadow: 0 1px 5px rgba(0,0,0,.4); }
.topbar h2 { font-size: 20px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.collapse-btn { flex: none; background: transparent; color: inherit; border: 0; border-radius: 50%; width: 40px; height: 40px; cursor: pointer; font-size: 1.4rem; line-height: 1; }
.collapse-btn:hover { background: rgba(255,255,255,.15); }
.ico-out { display: none; }
.app.collapsed .sidebar { padding: 12px 0; overflow: visible; }
.app.collapsed .lbl, .app.collapsed #who { display: none; }
.app.collapsed .brand { justify-content: center; padding: 0; }
.app.collapsed nav a { justify-content: center; padding: 12px 0; }
.app.collapsed .sidebar-foot { padding: 0 6px; }
.app.collapsed #logout .ico-out { display: inline; }
.app.collapsed #logout { padding: 6px 0; }
.sidebar { background: var(--card); color: var(--ink); border-right: 1px solid var(--line); padding: 12px 0; display: flex; flex-direction: column; gap: 12px; position: sticky; top: 48px; height: calc(100vh - 48px); }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 0 12px; }
nav { display: grid; gap: 0; overflow-y: auto; min-height: 0; }
.nav-group { min-width: 0; border-top: 1px solid var(--line); }
.nav-group summary { display: flex; align-items: center; gap: 14px; padding: 12px 16px; font-size: .95rem; font-weight: 500; color: var(--ink); cursor: pointer; list-style: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary::after { content: '+'; margin-left: auto; color: var(--muted); }
.nav-group[open] summary::after { content: '-'; }
.nav-group summary:hover, nav a:hover { background: rgba(0,0,0,.05); }
.nav-group summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.app.collapsed .nav-group summary { justify-content: center; padding: 14px 0; }
.app.collapsed .nav-group summary::after { content: none; }
nav a { color: var(--ink); text-decoration: none; padding: 10px 16px; display: flex; gap: 14px; align-items: center; }
nav a.active { background: rgba(0,0,0,.06); color: var(--brand); font-weight: 500; box-shadow: inset 3px 0 var(--accent); }
.ico { width: 24px; flex: none; text-align: center; color: var(--muted); }
/* Material icons (Apache 2.0) in the Loyverse colours, one per menu group. */
.nav-icon { width: 24px; height: 24px; flex: none; fill: currentColor; }
.nav-icon.overview { color: #3f51b5; } .nav-icon.sales { color: #4caf50; }
.nav-icon.operations { color: #e91e63; } .nav-icon.administration { color: #607d8b; }
.nav-icon.inventory { color: #2196f3; }
.nav-icon.customers { color: #9c27b0; } .nav-icon.buying { color: #e91e63; }
.nav-icon.staff { color: #795548; } .nav-icon.me { color: #009688; }
.sidebar-foot { margin-top: auto; display: grid; gap: 8px; padding: 0 12px; color: var(--muted); }
.app.collapsed #mode-toggle .ico-out { display: inline; }
.app.collapsed #mode-toggle { padding: 6px 0; }
.main { min-width: 0; }
@media (min-width: 861px) {
  .app.collapsed .sidebar { z-index: 10; }
  .app.collapsed .main { position: relative; z-index: 0; }
  .app.collapsed nav { overflow: visible; }
  .app.collapsed .nav-group { position: relative; }
  .app.collapsed .nav-group-links { position: absolute; left: 100%; top: 0; width: 260px; max-height: min(60vh, 420px); overflow-y: auto; padding: 8px 0; background: var(--card); border-radius: 2px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
  .app.collapsed .nav-group-links .lbl { display: inline; }
  .app.collapsed .nav-group-links a { justify-content: flex-start; padding: 10px 12px; }
}
/* The sales totals sit in one card as a strip of figures, as in Loyverse. */
.cards.sales-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; gap: 0; background: var(--card); box-shadow: var(--shadow); border-radius: 2px; }
.sales-cards .card { box-shadow: none; border-radius: 0; border-right: 1px solid var(--line); }
.sales-cards .card:last-child { border-right: 0; }
.sales-cards .card:first-child { box-shadow: inset 0 -2px var(--accent); }
#sales-results { min-width: 0; }
.sales-chart { margin-bottom: 18px; min-width: 0; max-width: 100%; }
.sales-svg { display: block; width: 100%; height: auto; }
.sales-chart-head, .sales-chart-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.sales-chart-head { justify-content: space-between; margin-bottom: 12px; }
.sales-chart-controls label { min-width: 100px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.sales-change { margin-top: 10px; font-size: .9rem; }
.sales-change.good { color: var(--good); }
.sales-change.bad { color: var(--bad); }
.sales-change.warn { color: var(--warn); }
.stock-controls, .stock-item { display: grid; gap: 12px; min-width: 0; }
.stock-search { display: flex; align-items: end; gap: 12px; }
.stock-search label { flex: 1; min-width: 0; }
.stock-results { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.stock-item input, .stock-item select, .stock-controls select, .stock-search input { width: 100%; min-width: 0; }
.stock-cart-line { display: grid; grid-template-columns: minmax(0, 1fr) 140px auto auto; gap: 12px; align-items: end; border-bottom: 1px solid var(--line); padding: 14px 0; }
.stock-cart-line input { width: 100%; }
.stock-cart-line strong, #stock-review li { overflow-wrap: anywhere; }
.stock-notification { overflow-wrap: anywhere; }
#stock-review form { display: grid; gap: 12px; margin: 14px 0; }
#stock-review textarea, #stock-review select { width: 100%; min-width: 0; font: inherit; }
.stock-cart .btn, .stock-item .btn, .stock-controls .btn { min-height: 44px; }
.stock-cart-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 16px; position: sticky; bottom: 0; background: var(--card); padding: 12px 0; }
@media (max-width: 600px) {
  .stock-search { flex-direction: column; align-items: stretch; }
  .stock-cart-line { grid-template-columns: 1fr 1fr; }
  .stock-cart-line > div { grid-column: 1 / -1; }
  .stock-cart input, .stock-item input, .stock-item select, .stock-controls select, .stock-search input { font-size: 16px; min-height: 44px; }
}
.sales-cards .stat { font-size: clamp(1rem, 2vw, 1.75rem); overflow-wrap: anywhere; }
.sales-net { background: var(--accent); }
/* Net sales bars and lines follow the theme colour (CSS beats the fill attribute). */
.sales-svg .series-sales { fill: var(--accent); }
.sales-svg polyline.series-sales { fill: none; stroke: var(--accent); }
.sales-actual { background: var(--brand-blue); }
.sales-refunds { background: var(--bad); }
.sales-discounts { background: #c88817; }
@media (max-width: 600px) {
  .cards.sales-cards { grid-template-columns: 1fr; }
  .sales-cards .card { border-right: 0; border-bottom: 1px solid var(--line); }
}
.page-head { display: flex; justify-content: flex-end; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 24px 0; }
.page-head:has(#page-actions:empty):has(#page-tabs.hidden) { display: none; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* Tabs for pages that share one menu entry (Payroll | Pay run). */
.page-tabs { display: flex; margin-right: auto; border-bottom: 1px solid var(--line); }
.page-tab { padding: 8px 16px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 500; text-decoration: none; }
.page-tab:hover { color: var(--ink); }
.page-tab.active { color: var(--ink); border-bottom-color: var(--brand); }
@media (max-width: 860px) { .page-tabs { order: -1; width: 100%; margin-right: 0; } .page-tab { flex: 1; text-align: center; } }
/* One column the width of the screen: a wide table scrolls inside its own box
   instead of widening the page (on a phone the whole page slid sideways). */
.view { padding: 16px 24px 40px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; max-width: 1300px; }
.banner { padding: 12px 28px; font-weight: 600; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner.bad { background: var(--bad-bg); color: var(--bad); }

.btn { border: 1px solid transparent; border-radius: 2px; padding: 8px 16px; font: inherit; font-size: .93rem; font-weight: 500; letter-spacing: .02em; text-transform: uppercase; cursor: pointer; background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.btn:hover { filter: brightness(.96); } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--brand); color: #fff; } .btn.danger { background: var(--bad); color: #fff; }
.btn.good { background: var(--good); color: #fff; }
.btn.ghost { background: transparent; border-color: rgba(0,0,0,.2); color: inherit; box-shadow: none; }
.btn.wide { width: 100%; } .small-btn { padding: 5px 10px; font-size: .82rem; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: 2px; box-shadow: var(--shadow); padding: 16px 20px; }
.card h3 { font-size: 1rem; font-weight: 400; color: var(--ink); margin-bottom: 6px; }
.stat { font-size: 1.75rem; font-weight: 400; line-height: 1.15; }
.stat.good { color: var(--good); } .stat.bad { color: var(--bad); } .stat.warn { color: var(--warn); }
.card .sub { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.card.link { cursor: pointer; } .card.link:hover { box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.grid-2 { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; }

.table-card { background: var(--card); border-radius: 2px; box-shadow: var(--shadow); overflow: hidden; }
.table-card > h3 { padding: 16px 20px 4px; font-size: 1rem; font-weight: 500; }
/* Tables scroll inside their own box, capped to the screen height, so the
   horizontal scrollbar stays in view instead of below the last row. */
.table-wrap { overflow: auto; max-height: calc(100vh - 140px); max-height: calc(100dvh - 140px); }
.table-wrap thead th { position: sticky; top: 0; z-index: 1; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--card); font-size: .9rem; font-weight: 400; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: rgba(0,0,0,.03); }
td.empty { text-align: center; color: var(--muted); padding: 30px; }
.nowrap { white-space: nowrap; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.pill.good { background: var(--good-bg); color: var(--good); } .pill.bad { background: var(--bad-bg); color: var(--bad); }
.pill.warn { background: var(--warn-bg); color: var(--warn); } .pill.info { background: var(--info-bg); color: var(--info); }
.pill.neutral { background: var(--neutral-bg); color: var(--muted); }

.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; background: var(--card); border-radius: 2px; box-shadow: var(--shadow); padding: 12px 16px; }
.toolbar label { min-width: 150px; } .toolbar .grow { flex: 1; min-width: 200px; }
.pager { display: flex; gap: 10px; align-items: center; justify-content: flex-end; padding: 10px 14px; }

.chart { width: 100%; height: 180px; display: block; }
.legend { display: flex; gap: 14px; font-size: .8rem; color: var(--muted); margin-top: 6px; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; }
.list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.list li { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.check:last-child { border-bottom: 0; }
.check .mark { font-weight: 700; width: 22px; flex: none; }
.check .mark.ok { color: var(--good); } .check .mark.no { color: var(--bad); } .check .mark.na { color: var(--muted); }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: 6px 12px; font-size: .92rem; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }

.switch-row { display: flex; justify-content: space-between; gap: 14px; align-items: center; flex-wrap: wrap; }
.form-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; }
.form-row label { flex: 1; min-width: 180px; }
.notice { background: var(--info-bg); color: var(--info); padding: 10px 12px; border-radius: 2px; font-size: .9rem; }
.notice.bad { background: var(--bad-bg); color: var(--bad); }

.log { display: grid; gap: 0; background: var(--card); border-radius: 2px; box-shadow: var(--shadow); overflow: hidden; }
.log-row { padding: 9px 14px; border-bottom: 1px solid var(--line); font-family: Consolas, monospace; font-size: .82rem; }
.log-row:last-child { border-bottom: 0; }
.log-row summary { cursor: pointer; display: flex; gap: 10px; }
.log-row .t { color: var(--muted); flex: none; } .log-row .m { word-break: break-word; }
.log-row.error { background: #fff7f7; } .log-row.warn { background: #fffaf0; }
.log-row pre { margin: 8px 0 0; white-space: pre-wrap; word-break: break-word; max-height: 300px; overflow: auto; background: #f4f7f9; padding: 8px; border-radius: 2px; }

.drawer { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; justify-content: flex-end; z-index: 20; }
.drawer-panel { background: var(--card); width: min(460px, 100%); height: 100%; overflow-y: auto; padding: 24px; position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.drawer-panel:has(.sales-import) { width: min(920px, 100%); }
.import-user { display: grid; gap: 10px; padding: 14px; }
#sales-import-commit { display: grid; gap: 12px; }
.drawer-panel .close { position: absolute; top: 12px; right: 12px; font-size: 1.2rem; }
.receipt-timeline { display: grid; gap: 12px; padding-left: 22px; }
.receipt-timeline li { padding-left: 4px; }
.receipt-timeline time { display: block; margin-top: 4px; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: grid; gap: 8px; z-index: 30; }
.toast { background: #323232; color: #fff; padding: 12px 16px; border-radius: 2px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 360px; }
.toast.bad { background: var(--bad); } .toast.good { background: var(--good); }
.spinner { color: var(--muted); padding: 30px; text-align: center; }

@media (max-width: 860px) {
  .app, .app.collapsed { grid-template-columns: 1fr; grid-template-rows: 48px auto 1fr; }
  .collapse-btn, .ico-out { display: none !important; }
  .topbar { padding: 0 14px; }
  .brand, .app.collapsed .brand { flex-direction: row; padding: 0 4px; gap: 8px; }
  .sidebar-logo, .app.collapsed .sidebar-logo { width: 128px; padding: 6px; }
  .app.collapsed .brand-logo { display: block; }
  .app.collapsed .brand-icon { display: none; }
  .app.collapsed .lbl { display: inline; }
  .app.collapsed nav a { justify-content: flex-start; padding: 8px 10px; }
  .nav-icon { display: none; }
  .nav-group summary::after, .app.collapsed .nav-group summary::after { content: '▾'; margin-left: 2px; }
  .sidebar, .app.collapsed .sidebar { position: relative; top: 0; z-index: 10; overflow: visible; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 8px 10px; gap: 8px; border-right: 0; box-shadow: var(--shadow); }
  .main { position: relative; z-index: 0; }
  /* The top-level items share the row equally, like tabs. */
  nav { width: 100%; order: 3; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; position: relative; overflow: visible; z-index: 10; }
  /* The ? button at the top opens the help centre on a phone. */
  nav > a[data-page="help"] { display: none; }
  nav > .hidden { display: none; }
  nav a, .app.collapsed nav a { padding: 8px 6px; } .ico { display: none; }
  nav > a, .nav-group { flex: 1 1 0; min-width: 0; }
  .nav-group { border: 0; margin: 0; padding: 0; }
  .nav-group summary, .app.collapsed .nav-group summary { justify-content: center; padding: 8px 4px; gap: 4px; font-size: .8rem; white-space: nowrap; min-height: 44px; }
  nav > a, .app.collapsed nav > a { justify-content: center; font-size: .8rem; min-height: 44px; }
  nav > a.active { box-shadow: inset 0 -2px var(--accent); }
  .nav-group-links { position: absolute; top: 100%; right: 0; width: min(280px, 100%); max-height: min(60vh, 420px); overflow-y: auto; padding: 8px 0; background: var(--card); border-radius: 2px; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
  .nav-group-links { left: 0; right: auto; width: 100%; }
  .nav-group-links a, .app.collapsed .nav-group-links a { padding: 10px 12px; }
  .sidebar-foot { margin: 0 0 0 auto; display: flex; align-items: center; padding: 0; }
  .page-head, .view, .banner { padding-left: 14px; padding-right: 14px; }
  .grid-2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  nav { gap: 0; }
  nav > a, .app.collapsed nav > a { padding: 8px 4px; font-size: .75rem; }
  .nav-group summary, .app.collapsed .nav-group summary { padding: 8px 2px; gap: 2px; font-size: .75rem; }
}

.bars { display: flex; gap: 6px; align-items: flex-end; height: 190px; }
.bar-col { flex: 1; display: flex; flex-direction: column; height: 100%; min-width: 0; }
.bar-stack { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.seg { width: 100%; min-height: 0; }
.seg.delivered, .dot.d-delivered { background: var(--good); }
.seg.other, .dot.d-other { background: #8fb7d9; }
.seg.failed, .dot.d-failed { background: var(--bad); }
.seg:first-child { border-radius: 4px 4px 0 0; }
.bar-label { text-align: center; font-size: .72rem; color: var(--muted); padding-top: 4px; }
.small-stat { font-size: 1.4rem; }
.gap-top { margin-top: 18px; }
label.inline { display: flex; align-items: center; gap: 6px; min-width: 0; font-weight: 500; }
label.inline input { padding: 0; }
.permission-table { min-width: 680px; }
.permission-table td:not(:first-child), .permission-table th:not(:first-child) { text-align: center; }
.permission-table input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); }
.permission-table input[type="checkbox"]:disabled { accent-color: #87949a; cursor: not-allowed; }
.access-section { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.card.my-pin { max-width: 420px; display: grid; gap: 12px; }
.pos-pin-change { display: grid; gap: 12px; padding: 16px 24px; }
.access-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* A toolbar button kept at the right end, such as Save on the access rights page. */
.toolbar .toolbar-end { margin-left: auto; }
.access-actions .btn { min-height: 38px; }
.muted-row { opacity: .7; }
.daily-sales-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
/* The Shift box shows only for a branch on two shifts a day (labels are grids, which would override hidden). */
.daily-sales-form label[hidden] { display: none; }
.daily-sales-page, .daily-sales-page > *, #daily-sales-records { min-width: 0; }
.daily-sales-form input, .daily-sales-form select { width: 100%; min-width: 0; }
.daily-sales-date label { width: 100%; max-width: 280px; }
.daily-sales-form input[readonly] { background: var(--bg); }
.sales-full, .daily-sales-date { grid-column: 1 / -1; }
.daily-sales-date { display: grid; grid-template-columns: repeat(2, minmax(0, 280px)); gap: 10px; }
.daily-sales-date > p { grid-column: 1 / -1; }
.daily-sales-form .btn { min-height: 44px; }
/* Empty error lines take no room, so Save sits right under Name. */
.daily-sales-form .form-error:empty { display: none; }
@media (max-width: 600px) {
  .daily-sales-form, .daily-sales-date { grid-template-columns: minmax(0, 1fr); }
  .daily-sales-date label { max-width: none; }
}

.field { display: flex; flex-direction: column; font-size: .85rem; color: var(--muted); font-weight: 600; min-width: 220px; position: relative; }
.datepick { position: relative; margin-top: 4px; }
.datebtn { width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 2px; background: #fff; padding: 9px 12px; font: inherit; font-weight: 400; color: var(--ink); cursor: pointer; }
.datebtn::after { content: '▾'; float: right; color: var(--muted); }
.datepick.has-steps { display: flex; gap: 6px; align-items: stretch; }
.datepick.has-steps .datebtn { flex: 1; min-width: 0; }
.dp-step { flex: none; width: 40px; border: 1px solid var(--line); border-radius: 2px; background: #fff; color: var(--ink); font: inherit; font-size: 1.2rem; line-height: 1; cursor: pointer; }
.dp-step:hover:not(:disabled) { background: var(--bg); }
.dp-step:disabled { color: var(--muted); opacity: .45; cursor: default; }
.dp-pop { position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; background: #fff; border: 1px solid var(--line); border-radius: 2px; box-shadow: 0 12px 32px rgba(0,0,0,.22); width: 560px; max-width: calc(100vw - 32px); color: var(--ink); font-weight: 400; }
.dp-pop.hidden { display: none; }
.dp-body { display: flex; }
.dp-cal { flex: 1; padding: 14px 16px; border-right: 1px solid var(--line); min-width: 0; }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-nav { border: 0; background: none; font-size: 1.4rem; cursor: pointer; padding: 0 10px; color: var(--ink); } .dp-nav:disabled { color: #c4cdd2; cursor: default; }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 2px; text-align: center; }
.dp-dow span { font-size: .8rem; padding: 4px 0; color: var(--ink); border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.dp-day { border: 0; background: none; height: 34px; font: inherit; font-size: .9rem; cursor: pointer; color: var(--ink); border-radius: 0; }
.dp-day.other { color: #8a99a3; } .dp-day.future { color: #c4cdd2; cursor: default; }
.dp-day.in { background: color-mix(in srgb, var(--accent) 18%, #fff); }
.dp-day span { display: inline-block; width: 34px; line-height: 34px; border-radius: 50%; }
.dp-day.end { color: #fff; } .dp-day.end span { background: var(--brand); }
.dp-inputs { display: flex; gap: 12px; margin-top: 10px; }
.dp-inputs label { flex: 1; min-width: 0; font-size: .75rem; color: var(--muted); } .dp-inputs input { width: 100%; margin-top: 2px; }
.dp-presets { display: flex; flex-direction: column; padding: 8px 0; width: 150px; }
.dp-presets button { border: 0; background: none; text-align: left; padding: 9px 18px; font: inherit; cursor: pointer; color: var(--ink); } .dp-presets button:hover { background: var(--bg); }
.dp-foot { display: flex; justify-content: flex-end; gap: 22px; padding: 10px 18px; border-top: 1px solid var(--line); }
.dp-link { border: 0; background: none; font: inherit; font-weight: 700; letter-spacing: .03em; cursor: pointer; color: var(--ink); } .dp-link.done { color: var(--brand); }
@media (max-width: 600px) { .dp-body { flex-direction: column; } .dp-cal { border-right: 0; border-bottom: 1px solid var(--line); } .dp-presets { flex-direction: row; flex-wrap: wrap; width: auto; } .dp-pop { width: calc(100vw - 32px); } }
.employee-details { margin-top: 16px; display: grid; gap: 12px; }
.employee-details h4 { margin: 8px 0 0; }
.employee-branches { border: 1px solid var(--line); border-radius: 2px; padding: 8px 12px; display: grid; gap: 6px; }
.employee-branches legend { font-weight: 600; font-size: .85rem; padding: 0 4px; }
/* Items page */
td.num, th.num, .items-table th:nth-child(n+3) { text-align: right; white-space: nowrap; }
.bad-text { color: var(--bad); font-weight: 500; } .warn-text { color: var(--warn); font-weight: 500; }
.history-table th:nth-child(5), .history-table th:nth-child(6) { text-align: right; }
.adjust-results { display: grid; gap: 2px; }
.adjust-lines { display: grid; gap: 8px; }
.adjust-line { display: grid; grid-template-columns: minmax(0, 1fr) 130px auto; gap: 8px; align-items: center; }
.adjust-line input { width: 100%; }
/* Item editor */
.drawer-panel:has(.ie-panel) { width: min(980px, 100%); }
.ie-panel { display: grid; gap: 14px; }
.ie-section { display: grid; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
/* Item photo (item editor) and its thumbnail on the Items list. */
.ie-photo { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-start; }
.ie-photo-img { width: 160px; height: 160px; border-radius: 8px; object-fit: cover; border: 1px solid var(--line); background: var(--card); }
.ie-photo-empty { display: grid; place-items: center; color: var(--muted); font-size: .85rem; }
.ie-photo-actions { display: grid; gap: 8px; align-content: start; flex: 1 1 200px; }
.ie-photo-actions .btn { justify-self: start; cursor: pointer; }
.item-cell { display: flex; gap: 10px; align-items: center; }
.item-thumb { flex: none; width: 40px; height: 40px; border-radius: 6px; object-fit: cover; border: 1px solid var(--line); }
.ie-section h4 { margin: 0; }
.ie-checks { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.ie-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ie-variant { border: 1px solid var(--line); border-radius: 2px; padding: 10px; display: grid; gap: 8px; }
.ie-variant-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; align-items: end; }
.ie-variant-main input, .ie-variant-main select, .ie-stores input, .ie-stores select { width: 100%; min-width: 0; }
.ie-variant-actions { display: flex; gap: 6px; }
.ie-stores td, .ie-stores th { padding: 6px 8px; }
@media (max-width: 600px) { .ie-options { grid-template-columns: 1fr; } }
.po-line { display: grid; grid-template-columns: minmax(0, 1fr) 100px 110px auto; gap: 8px; align-items: center; }
.si-head { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px 14px; }
.si-supplier { display: flex; gap: 6px; } .si-supplier select { flex: 1; min-width: 0; }
.si-line { border-top: 1px solid var(--line); padding: 10px 0; } .si-line:first-child { border-top: 0; }
.si-line-head { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; } .si-line-head .btn { margin-left: auto; }
.si-line-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 8px 0; }
.si-months { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.si-month { display: inline-flex; gap: 4px; align-items: center; } .si-month input { width: 90px; }
.si-sum { margin: 6px 0 0; }
.si-waiting { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; border-left: 4px solid var(--warn); }
.si-price { width: 100px; } .si-pack td:first-child { padding-left: 18px; }
.si-totals { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.si-totals div { display: flex; flex-direction: column; gap: 2px; } .si-totals strong { font-size: 1.15rem; }
.ex-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 12px; }
.ex-stat { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.ex-stat strong { font-size: 1.25rem; }
.ex-stat.bad strong { color: var(--bad); } .ex-stat.warn strong { color: var(--warn); }
.wo-photo { max-width: 100%; max-height: 360px; border-radius: 8px; }
.wh-storages { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.po-line input, .po-receive { width: 100%; max-width: 110px; }
.sc-packs { display: flex; align-items: center; justify-content: flex-end; gap: 4px; margin-top: 4px; white-space: nowrap; }
.sc-pack-input { width: 52px; padding: 4px 6px; }
.po-table th:nth-child(n+5):not(:last-child) { text-align: right; }
@media (max-width: 600px) { .po-line { grid-template-columns: 1fr 1fr; } .po-line > span { grid-column: 1 / -1; } }
/* Till */
.till-refund-card { display: grid; gap: 4px; padding: 10px; margin-top: 8px; }
/* The shift report rows also show in the back office's shift drawer. */
.pos-report-head { margin: 18px 0 4px; font-size: .9rem; font-weight: 500; color: var(--pos-accent-ink, var(--brand)); }
.pos-report-row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--pos-line, var(--line)); }
.pos-report-row.strong { font-weight: 600; }
.pos-moves { padding: 6px 0; font-size: .85rem; }

/* ---------- The till, laid out like the Loyverse POS tablet app ----------
   It fills the screen (body.pos-mode hides the dashboard's bars) and is light
   or dark with the rest of the app (mode.js). */
body.pos-mode .topbar, body.pos-mode .sidebar, body.pos-mode .page-head, body.pos-mode #banner { display: none !important; }
body.pos-mode .app { display: block; }
/* No pull-down-to-refresh on the till (Android Chrome): a stray swipe would reload the page mid-order. */
html:has(body.pos-mode), body.pos-mode { overscroll-behavior-y: none; }
body.pos-mode .view { padding: 0; max-width: none; display: block; }
.pos, .pos-dialog-scrim {
  --pos-bg: #fafafa; --pos-panel: #ffffff; --pos-raised: #ffffff; --pos-bar: #ffffff; --pos-line: #e0e0e0; --pos-ink: #212121; --pos-muted: #757575;
  --pos-green: #4caf50; --pos-green-dark: #43a047; --pos-accent-ink: #388e3c; --pos-hover: rgba(0,0,0,.05); --pos-scrim: rgba(0,0,0,.45);
  --pos-shadow: 0 1px 3px rgba(0,0,0,.2); --pos-danger: #e53935;
}
html[data-mode="dark"] .pos, html[data-mode="dark"] .pos-dialog-scrim { --pos-bg: #2b2b2b; --pos-panel: #303030; --pos-raised: #383838; --pos-bar: #303030; --pos-line: #444; --pos-ink: #e8e8e8; --pos-muted: #a0a0a0;
  --pos-accent-ink: #66bb6a; --pos-hover: rgba(255,255,255,.06); --pos-scrim: rgba(0,0,0,.6); --pos-shadow: 0 1px 3px rgba(0,0,0,.5); --pos-danger: #ef5350; }

.pos { position: relative; height: 100vh; height: 100dvh; overflow: hidden; background: var(--pos-bg); color: var(--pos-ink); font-family: Roboto, "Segoe UI", system-ui, sans-serif; font-size: 15px; }
.pos button { font: inherit; color: inherit; }
.pos input { background: transparent; color: var(--pos-ink); border: 0; border-bottom: 1px solid var(--pos-line); border-radius: 0; padding: 8px 0; font: inherit; font-size: 1.05rem; width: 100%; }
.pos input:focus { outline: none; border-bottom: 2px solid var(--pos-green); }
.pos h2, .pos h3, .pos h4 { margin: 0; }
.pos-svg { width: 24px; height: 24px; fill: currentColor; flex: none; }
.pos-muted { color: var(--pos-muted); }
.pos-grow { flex: 1; }
.pos-num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.pos-error { color: var(--pos-danger); min-height: 1.2em; margin: 4px 0; font-size: .9rem; }
.pos-error:empty { min-height: 0; margin: 0; }
.pos-pad-text { padding: 16px; }

/* Bars and icon buttons */
.pos-bar { display: flex; align-items: center; gap: 4px; height: 56px; padding: 0 8px; background: var(--pos-bar); border-bottom: 1px solid var(--pos-line); position: relative; }
.pos-title { font-size: 1.25rem; font-weight: 500; margin: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pos-icon { display: inline-grid; place-items: center; width: 48px; height: 48px; border: 0; border-radius: 50%; background: transparent; cursor: pointer; color: var(--pos-muted) !important; flex: none; }
.pos-icon:hover { background: var(--pos-hover); color: var(--pos-ink) !important; }
.pos-icon:disabled { opacity: .35; cursor: default; background: none; }
.pos-icon.small { width: 36px; height: 36px; } .pos-icon.small .pos-svg { width: 20px; height: 20px; }
.pos-icon.round { background: var(--pos-hover); }
.pos-select { display: inline-flex; align-items: center; gap: 2px; border: 0; background: transparent; font-size: 1.15rem; color: var(--pos-muted) !important; padding: 8px 6px 8px 10px; cursor: pointer; border-radius: 2px; white-space: nowrap; }
.pos-select:hover:not(:disabled) { background: var(--pos-hover); }
.pos-search { display: flex; align-items: center; gap: 6px; margin-left: auto; color: var(--pos-muted); width: 200px; }
.pos .pos-search input { border-bottom-color: transparent; padding: 6px 0; }
.pos-search.open { flex: 1; width: auto; margin-left: 8px; }
.pos .pos-search.open input, .pos .pos-search input:focus { border-bottom-color: var(--pos-green); }
.pos-text-btn { border: 0; background: transparent; color: var(--pos-accent-ink) !important; font-weight: 500; text-transform: uppercase; letter-spacing: .03em; padding: 10px 12px; border-radius: 2px; cursor: pointer; }
.pos-text-btn:hover:not(:disabled) { background: var(--pos-hover); }
.pos-text-btn:disabled { opacity: .4; cursor: default; }
.pos-text-btn.danger { color: var(--pos-danger) !important; } .pos-text-btn.strong { font-weight: 700; }
.pos-link { border: 0; background: none; padding: 0; color: var(--pos-accent-ink) !important; cursor: pointer; text-decoration: underline; }
.pos-btn { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 48px; padding: 0 24px; border: 0; border-radius: 2px; background: var(--pos-green); color: #fff !important;
  font-weight: 500; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; box-shadow: var(--pos-shadow); }
.pos-btn:hover:not(:disabled) { background: var(--pos-green-dark); }
.pos-btn:disabled { opacity: .45; cursor: default; }
.pos-btn.outline { background: transparent; color: var(--pos-accent-ink) !important; border: 1px solid var(--pos-green); box-shadow: none; }
.pos-btn.outline:hover:not(:disabled) { background: var(--pos-hover); }
.pos-btn.wide { width: 100%; }
.pos-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.pos-field { display: grid; gap: 2px; font-weight: 400; font-size: .8rem; color: var(--pos-muted); }
.pos-field:has(> .pos-svg) { grid-template-columns: auto 1fr; align-items: center; gap: 8px; }

/* In light mode Loyverse draws the items bar, the page bars and the phone's top bar green with white text;
   the tablet's ticket bar and the phone's category bar stay plain. */
html:not([data-mode="dark"]) :is(.pos-bar:not(.pos-bar-ticket, .pos-bar-cats), .pos-bar-main) { background: var(--pos-green); border-bottom-color: var(--pos-green); color: #fff; }
html:not([data-mode="dark"]) :is(.pos-bar:not(.pos-bar-ticket, .pos-bar-cats), .pos-bar-main) :is(.pos-icon, .pos-select, .pos-ticket-title),
html:not([data-mode="dark"]) :is(.pos-bar:not(.pos-bar-ticket, .pos-bar-cats), .pos-bar-main) .pos-search, html:not([data-mode="dark"]) :is(.pos-bar:not(.pos-bar-ticket, .pos-bar-cats), .pos-bar-main) .pos-text-btn { color: #fff !important; }
html:not([data-mode="dark"]) :is(.pos-bar:not(.pos-bar-ticket, .pos-bar-cats), .pos-bar-main) .pos-icon:hover, html:not([data-mode="dark"]) :is(.pos-bar:not(.pos-bar-ticket, .pos-bar-cats), .pos-bar-main) .pos-select:hover:not(:disabled) { background: rgba(255,255,255,.15); }
html:not([data-mode="dark"]) .pos .pos-bar:not(.pos-bar-ticket, .pos-bar-cats) .pos-search input { color: #fff; }
html:not([data-mode="dark"]) .pos .pos-bar:not(.pos-bar-ticket, .pos-bar-cats) .pos-search input::placeholder { color: rgba(255,255,255,.8); }
html:not([data-mode="dark"]) .pos .pos-bar:not(.pos-bar-ticket, .pos-bar-cats) .pos-search.open input, html:not([data-mode="dark"]) .pos .pos-bar:not(.pos-bar-ticket, .pos-bar-cats) .pos-search input:focus { border-bottom-color: #fff; }
html:not([data-mode="dark"]) .pos-bar .pos-menu, html:not([data-mode="dark"]) .pos-bar .pos-menu-item:not(.active) { color: var(--pos-ink) !important; }
/* Popup menus */
.pos-menu { position: absolute; top: 6px; right: 6px; z-index: 6; min-width: 230px; padding: 8px 0; background: var(--pos-raised); border-radius: 2px; box-shadow: 0 6px 24px rgba(0,0,0,.35); max-height: 70vh; overflow-y: auto; }
.pos-menu-left { left: 56px; right: auto; }
.pos-menu-item { display: flex; align-items: center; gap: 20px; width: 100%; padding: 12px 20px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 1rem; }
.pos-menu-item .pos-svg { color: var(--pos-muted); width: 22px; height: 22px; }
.pos-menu-item:hover:not(:disabled), .pos-menu-item.active { background: var(--pos-hover); }
.pos-menu-item.active { color: var(--pos-accent-ink) !important; }
.pos-menu-item:disabled { opacity: .4; cursor: default; }

/* The sales screen: items and their category tabs | the ticket, with Open tickets / Save and Charge at its foot */
.pos-sales { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 34%); grid-template-rows: 56px minmax(0, 1fr) 72px; }
.pos-bar-ticket { border-left: 1px solid var(--pos-line); }
.pos-items { overflow-y: auto; padding: 12px; }
.pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.pos-tile { display: grid; grid-template-rows: 1fr auto; aspect-ratio: 1 / 1; padding: 0; border: 0; border-radius: 2px; overflow: hidden; background: var(--pos-raised); box-shadow: var(--pos-shadow); cursor: pointer; text-align: left; }
.pos-tile:active { transform: scale(.97); }
.pos-tile-face { position: relative; display: grid; place-items: center; background: var(--tile, #757575); color: #fff; }
.pos-c0 { --tile: #d32f2f; } .pos-c1 { --tile: #c2185b; } .pos-c2 { --tile: #ef6c00; } .pos-c3 { --tile: #afb42b; } .pos-c4 { --tile: #43a047; } .pos-c5 { --tile: #1e88e5; } .pos-c6 { --tile: #7b1fa2; }
.pos-tile-initials { font-size: 1.9rem; font-weight: 300; opacity: .9; }
.pos-tile-price { position: absolute; left: 6px; bottom: 4px; font-size: .78rem; opacity: .95; }
.pos-tile-stock { position: absolute; right: 6px; top: 4px; font-size: .72rem; background: rgba(0,0,0,.25); border-radius: 8px; padding: 0 6px; }
.pos-tile-stock.out { background: rgba(0,0,0,.55); }
/* A tile with the item's photo: the photo fills the square, the price and stock sit on dark labels. */
.pos-tile-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pos-tile-face.has-photo { background: #fff; }
.pos-tile-face.has-photo .pos-tile-price { background: rgba(0,0,0,.6); border-radius: 8px; padding: 0 6px; }
.pos-tile-face.has-photo .pos-tile-stock { background: rgba(0,0,0,.6); }
.pos-tile-face.has-photo .pos-tile-stock.out { background: rgba(160,0,0,.8); }
.pos-row-photo { width: 100%; height: 100%; border-radius: 2px; object-fit: cover; }
.pos-tile-name { padding: 6px 8px; font-size: .85rem; line-height: 1.2; min-height: 2.9em; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; background: var(--pos-raised); }
.pos-tile-discount .pos-tile-face { --tile: #616161; display: flex; gap: 6px; justify-content: center; align-items: center; }
.pos-tile-discount.chosen { outline: 3px solid var(--pos-green); }
.pos-tile-big { font-size: 1.4rem; }
/* The list layout (Settings → General → Home screen item layout). */
.pos-rows { display: grid; margin: -12px; }
.pos-row { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 6px 16px 6px 8px; border: 0; text-align: left; cursor: pointer;
  background: linear-gradient(var(--pos-line), var(--pos-line)) no-repeat 54px 100% / calc(100% - 54px) 1px; }
.pos-row:hover { background-color: var(--pos-hover); }
.pos-row:active { background-color: var(--pos-line); }
.pos-row.chosen { color: var(--pos-accent-ink) !important; }
.pos-row-swatch { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 2px; background: var(--tile, var(--pos-line)); color: var(--pos-muted); }
.pos-row-tag { background: var(--pos-line); } .pos-row-tag .pos-svg { width: 18px; height: 18px; }
.pos-row-name { flex: 1; min-width: 0; display: grid; }
.pos-row-stock { font-size: .78rem; color: var(--pos-muted); } .pos-row-stock.out { color: var(--pos-danger); }
.pos-take { display: block; font-weight: 700; color: var(--pos-accent-ink); } .pos-expired { display: block; font-weight: 700; color: var(--pos-danger); }
.pos-tile-expiry { position: absolute; left: 6px; bottom: 4px; font-size: .72rem; background: rgba(0,0,0,.35); border-radius: 8px; padding: 0 6px; }
.pos-setting-btn { width: 100%; border: 0; border-bottom: 1px solid var(--pos-line); background: none; text-align: left; cursor: pointer; }
.pos-setting-btn:hover { background: var(--pos-hover); }
.pos-empty { display: grid; justify-items: center; align-content: center; gap: 6px; min-height: 100%; text-align: center; color: var(--pos-muted); padding: 24px; }
.pos-empty > .pos-svg { width: 84px; height: 84px; opacity: .55; }
.pos-empty h3 { color: var(--pos-ink); font-weight: 400; font-size: 1.15rem; margin-top: 10px; }
.pos-empty p { margin: 0 0 14px; }
.pos-ticket { grid-column: 2; grid-row: 2 / 4; display: flex; flex-direction: column; min-height: 0; background: var(--pos-panel); border-left: 1px solid var(--pos-line); }
.pos-ticket-body { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; }
.pos-ticket-customer { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 0; border-bottom: 1px solid var(--pos-line); background: var(--pos-hover); text-align: left; cursor: pointer; }
.pos-ticket-customer .pos-svg { color: var(--pos-muted); }
.pos-ticket-customer span:first-of-type { flex: 1; }
.pos-lines { display: grid; }
.pos-line { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 0; border-bottom: 1px solid var(--pos-line); background: none; text-align: left; cursor: pointer; }
.pos-line:hover { background: var(--pos-hover); }
.pos-line-name { min-width: 0; overflow-wrap: anywhere; }
.pos-line-note { display: block; font-size: .85rem; }
.pos-price-changed { color: #b26a00; font-weight: 600; }
html[data-mode="dark"] .pos-price-changed { color: #ffb74d; }
.pos-sums { border-top: 1px solid var(--pos-line); margin-top: -1px; }
.pos-sum-row { display: flex; justify-content: space-between; gap: 12px; width: 100%; padding: 12px 16px; border: 0; background: none; text-align: left; }
.pos-discount { cursor: pointer; } .pos-discount span:first-of-type { flex: 1; }
.pos-discount .pos-svg { width: 18px; height: 18px; color: var(--pos-muted); }
.pos-sum-total { font-weight: 600; font-size: 1.05rem; border-top: 1px solid var(--pos-line); }
.pos-ticket .pos-error { padding: 0 16px; }
.pos-tabs { grid-column: 1; grid-row: 3; display: flex; min-width: 0; position: relative; align-items: stretch; overflow-x: auto; background: var(--pos-bar); border-top: 1px solid var(--pos-line); scrollbar-width: none; }
/* Arrange sale screen: the bottom bar holds All items and the store's pages; Item layout setup arranges them. */
.pos-tab-all { min-width: 72px; display: grid; place-items: center; }
.pos-tab-add { display: flex; align-items: center; gap: 4px; margin-left: auto; color: var(--pos-accent-ink) !important; text-transform: uppercase; font-weight: 500; }
.pos-tab-add .pos-svg { width: 18px; height: 18px; }
.pos-menu-up { position: fixed; top: auto; bottom: 80px; right: auto; left: 16px; }
.pos-bar-arrange .pos-title { margin-left: 8px; }
.pos-bar-btn { margin-right: 8px; }
.pos-page .pos-cell, .pos-page .pos-cell-add, .pos-page .pos-cell-empty { position: relative; aspect-ratio: 1 / 1; }
.pos-page .pos-cell > .pos-tile { width: 100%; height: 100%; }
.pos-arranging .pos-cell { touch-action: none; cursor: grab; }
.pos-arranging .pos-cell.dragging { opacity: .5; }
.pos-arranging .drop { outline: 3px dashed var(--pos-green); outline-offset: 2px; }
.pos-cell-add { display: grid; place-items: center; border: 2px dashed var(--pos-line); border-radius: 2px; background: none; color: var(--pos-muted); cursor: pointer; }
.pos-cell-add .pos-svg { width: 32px; height: 32px; }
.pos-cell-remove { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: var(--pos-danger, #d32f2f); color: #fff; cursor: pointer; box-shadow: var(--pos-shadow); }
.pos-cell-remove .pos-svg { width: 16px; height: 16px; fill: #fff; }
.pos-tile-gone .pos-tile-face { --tile: var(--pos-line); }
.pos-tile-category .pos-tile-face .pos-svg { width: 40px; height: 40px; fill: #fff; opacity: .85; }
.pos-pick { width: min(520px, 100%); }
.pos-pick-kinds { display: flex; gap: 4px; }
.pos-pick-kinds .pos-text-btn { color: var(--pos-muted) !important; } .pos-pick-kinds .pos-text-btn.strong { color: var(--pos-accent-ink) !important; box-shadow: inset 0 -2px var(--pos-green); }
.pos-pick-list { display: grid; max-height: 46vh; overflow-y: auto; }
.pos-pick-list .pos-row { background: none; justify-content: space-between; }
.pos-tab { flex: none; min-width: 96px; max-width: 140px; padding: 0 12px; border: 0; border-top: 3px solid transparent; background: none; color: var(--pos-muted) !important; cursor: pointer; line-height: 1.2; }
.pos-tab.active { color: var(--pos-accent-ink) !important; border-top-color: var(--pos-green); }
.pos-tab:hover { background: var(--pos-hover); }
.pos-tab-icon { display: grid; place-items: center; min-width: 72px; margin-left: auto; cursor: default; }
.pos-tab-icon:hover { background: none; }
.pos-actions { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 1px; height: 72px; padding: 8px; border-top: 1px solid var(--pos-line); }
.pos-big { display: grid; place-content: center; gap: 2px; border: 0; background: var(--pos-green); color: #fff !important; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; cursor: pointer; line-height: 1.15; }
.pos-big:first-child { border-radius: 2px 0 0 2px; } .pos-big:last-child { border-radius: 0 2px 2px 0; }
.pos-big:hover:not(:disabled) { background: var(--pos-green-dark); }
.pos-big:disabled { opacity: .5; cursor: default; }
.pos-big small { font-size: 1rem; text-transform: none; letter-spacing: 0; }

/* Side menu */
.pos-scrim { position: absolute; inset: 0; z-index: 8; background: var(--pos-scrim); }
.pos-drawer { position: absolute; z-index: 9; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); display: flex; flex-direction: column; background: var(--pos-raised); box-shadow: 4px 0 16px rgba(0,0,0,.35); overflow-y: auto; animation: pos-slide .18s ease-out; }
@keyframes pos-slide { from { transform: translateX(-100%); } }
.pos-drawer-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 24px 20px; border-bottom: 1px solid var(--pos-line); line-height: 1.5; }
.pos-drawer-head strong { font-size: 1.15rem; font-weight: 500; }
.pos-drawer hr { border: 0; border-top: 1px solid var(--pos-line); margin: 8px 0; width: 100%; }
.pos-nav { display: flex; align-items: center; gap: 28px; padding: 13px 20px; border: 0; background: none; text-align: left; cursor: pointer; font-size: 1rem; font-weight: 500; color: var(--pos-ink) !important; text-decoration: none; }
.pos-nav .pos-svg { color: var(--pos-muted); }
.pos-nav:hover { background: var(--pos-hover); }
.pos-nav.active { background: var(--pos-hover); color: var(--pos-accent-ink) !important; } .pos-nav.active .pos-svg { color: var(--pos-accent-ink); }

/* Full-screen pages: Receipts, Shift, Settings, Charge */
.pos-screen { display: grid; grid-template-rows: 56px minmax(0, 1fr); }
.pos-body { overflow-y: auto; min-height: 0; }
.pos-card { background: var(--pos-raised); box-shadow: var(--pos-shadow); border-radius: 2px; padding: 20px 24px; margin: 24px auto; display: grid; gap: 12px; }
.pos-card h3 { font-weight: 500; font-size: 1.1rem; }
.pos-card p { margin: 0; }
.pos-narrow { max-width: 560px; } .pos-wide { max-width: 860px; }
.pos-split { display: grid; grid-template-columns: minmax(260px, 34%) minmax(0, 1fr); height: 100%; min-height: 0; }
.pos-list { overflow-y: auto; border-right: 1px solid var(--pos-line); background: var(--pos-panel); display: flex; flex-direction: column; min-height: 0; }
.pos-list-search { display: flex; align-items: center; gap: 10px; padding: 4px 16px; border-bottom: 1px solid var(--pos-line); color: var(--pos-muted); }
.pos .pos-list-search input { border-bottom-color: transparent; }
.pos-list-day { padding: 12px 16px 6px; color: var(--pos-accent-ink); font-size: .85rem; font-weight: 500; }
.pos-list-row { display: flex; align-items: center; gap: 16px; width: 100%; padding: 13px 16px; border: 0; border-bottom: 1px solid var(--pos-line); background: none; text-align: left; cursor: pointer; }
.pos-list-row .pos-svg { color: var(--pos-muted); }
.pos-list-row > span:not(.pos-muted) { flex: 1; display: grid; }
.pos-list-row:hover { background: var(--pos-hover); }
.pos-list-row.active { background: var(--pos-hover); color: var(--pos-accent-ink) !important; } .pos-list-row.active .pos-svg { color: var(--pos-accent-ink); }
.pos-receipt-row strong { font-weight: 400; }
.pos-list-foot { margin-top: auto; padding: 16px; display: grid; gap: 10px; text-align: center; }
.pos-pane { overflow-y: auto; min-height: 0; padding: 0 0 24px; }
.pos-pane-bar { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 16px 0 24px; border-bottom: 1px solid var(--pos-line); position: sticky; top: 0; background: var(--pos-bg); z-index: 1; }
.pos-pane-title { font-size: 1.15rem; font-weight: 500; padding: 18px 24px 6px; }
.pos-pane > .pos-error { padding: 0 24px; }
.pos-receipt { max-width: 440px; margin: 20px auto; padding: 8px 24px 20px; background: var(--pos-raised); box-shadow: var(--pos-shadow); border-radius: 2px; }
.pos-receipt-total { text-align: center; padding: 16px 0; border-bottom: 1px solid var(--pos-line); }
.pos-receipt-block { padding: 12px 0; border-bottom: 1px solid var(--pos-line); line-height: 1.6; }
.pos-receipt-line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.pos-receipt-line > span:first-child { display: grid; }
.pos-receipt-line .pos-muted { font-size: .85rem; }
.pos-receipt-line.strong { font-weight: 600; }
.pos-receipt > .pos-receipt-line:last-child { padding-top: 12px; font-size: .9rem; }
.pos-refund-form { display: grid; gap: 14px; padding-top: 16px; }
.pos-refund-line { display: grid; grid-template-columns: minmax(0, 1fr) 70px auto; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--pos-line); }
.pos-refund-line > span:first-child { display: grid; }
.pos .pos-refund-line input { text-align: center; }
.pos-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.pos-chip { padding: 8px 14px; border: 1px solid var(--pos-line); border-radius: 18px; background: none; cursor: pointer; color: var(--pos-ink) !important; }
.pos-chip.active { border-color: var(--pos-green); background: var(--pos-green); color: #fff !important; }
.pos-switch-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 24px; border-bottom: 1px solid var(--pos-line); font-weight: 400; font-size: 1rem; }
.pos-switch-row > span { display: grid; gap: 2px; } .pos-switch-row .pos-muted { font-size: .85rem; }
.pos-paper { font: inherit; padding: 8px 12px; border: 1px solid var(--pos-line); border-radius: 4px; background: var(--pos-raised); color: inherit; }
.pos .pos-switch { appearance: none; width: 36px; height: 14px; padding: 0; border: 0; border-radius: 7px; background: var(--pos-line); position: relative; cursor: pointer; flex: none; }
.pos .pos-switch::after { content: ''; position: absolute; top: -3px; left: -2px; width: 20px; height: 20px; border-radius: 50%; background: #bdbdbd; box-shadow: var(--pos-shadow); transition: left .15s; }
.pos .pos-switch:checked { background: #a5d6a7; } .pos .pos-switch:checked::after { left: 18px; background: var(--pos-green); }
.pos .pos-switch:focus { border: 0; outline: 2px solid var(--pos-green); outline-offset: 4px; }
.pos-charge, .pos-done { max-width: 560px; margin: 0 auto; padding: 32px 24px; display: grid; gap: 16px; }
.pos-charge-sum { text-align: center; padding-bottom: 8px; }
.pos-charge-amount { font-size: 2.6rem; font-weight: 300; }
.pos-cash-row { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: end; }
.pos-pay { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 56px; padding: 0 20px; border: 1px solid var(--pos-line); border-radius: 2px; background: var(--pos-raised);
  text-transform: uppercase; letter-spacing: .04em; font-weight: 500; cursor: pointer; box-shadow: var(--pos-shadow); }
.pos-pay:hover { border-color: var(--pos-green); }
.pos-pay .pos-svg { color: var(--pos-muted); }
.pos-pay-cash { background: var(--pos-green); color: #fff !important; border-color: var(--pos-green); } .pos-pay-cash .pos-svg { color: #fff; }
.pos-quick-cash { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pos-pay-list { display: grid; gap: 10px; }
.pos-paid { display: grid; border-top: 1px solid var(--pos-line); }
.pos-paid-row { display: flex; align-items: center; gap: 14px; padding: 6px 0; border-bottom: 1px solid var(--pos-line); }
.pos-paid-row span:nth-of-type(1) { flex: 1; } .pos-paid-row > .pos-svg { color: var(--pos-muted); }
.pos-charge-ready { text-align: center; font-size: 1.1rem; color: var(--pos-accent-ink); margin: 0; }
.pos-done { text-align: center; }
.pos-done p { margin: 0; }
.pos-done-figures { display: flex; justify-content: center; gap: 48px; padding: 16px 0 8px; }
.pos-ticket-list { display: grid; }
.pos-ticket-row { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--pos-line); }
.pos-ticket-open { flex: 1; display: grid; gap: 2px; padding: 14px 4px; border: 0; background: none; text-align: left; cursor: pointer; }
.pos-ticket-open:hover { background: var(--pos-hover); }

/* Lock screen, store and till choice */
.pos-gate { display: grid; place-items: center; overflow-y: auto; padding: 24px 16px; }
.pos-gate-card { width: min(380px, 100%); display: grid; gap: 12px; justify-items: center; text-align: center; }
.pos-gate-card h3 { font-weight: 400; font-size: 1.4rem; }
.pos-gate-card p { margin: 0; }
.pos-gate-icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--pos-green); color: #fff; }
.pos-gate-icon .pos-svg { width: 36px; height: 36px; }
.pos .pos-pin { font-size: 2rem; text-align: center; letter-spacing: .5em; width: 220px; }
.pos-pad { display: grid; grid-template-columns: repeat(3, 76px); gap: 12px; margin-top: 8px; }
.pos-key { height: 76px; border-radius: 50%; border: 0; background: var(--pos-hover); font-size: 1.6rem !important; font-weight: 300; cursor: pointer; }
.pos-key:hover { background: var(--pos-line); }
.pos-key:nth-child(10) { font-size: .95rem !important; }
.pos-key.ok { background: var(--pos-green); color: #fff !important; font-size: 1.1rem !important; font-weight: 500; }
.pos-choices { display: grid; gap: 10px; width: 100%; }
.pos-choice { min-height: 52px; border: 1px solid var(--pos-line); border-radius: 2px; background: var(--pos-raised); font-size: 1.05rem; cursor: pointer; box-shadow: var(--pos-shadow); }
.pos-choice:hover { border-color: var(--pos-green); }
.pos-inline-form { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: end; width: 100%; text-align: left; }

/* Dialogs (in place of the browser's prompt and confirm) */
.pos-dialog-scrim { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 16px; background: var(--pos-scrim); font-family: Roboto, "Segoe UI", system-ui, sans-serif; font-size: 15px; }
.pos-dialog { width: min(420px, 100%); max-height: 90vh; overflow-y: auto; display: grid; gap: 14px; padding: 22px 24px 10px; background: var(--pos-raised); color: var(--pos-ink); border-radius: 2px; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.pos-dialog h3 { font-weight: 500; font-size: 1.2rem; margin: 0; }
.pos-dialog p { margin: 0; color: var(--pos-muted); }
.pos-dialog button { font: inherit; }
.pos-dialog input { background: transparent; color: var(--pos-ink); border: 0; border-bottom: 1px solid var(--pos-line); border-radius: 0; padding: 8px 0; font: inherit; font-size: 1.1rem; width: 100%; }
.pos-dialog input:focus { outline: none; border-bottom: 2px solid var(--pos-green); }
.pos-dialog .pos-svg { width: 22px; height: 22px; fill: currentColor; color: var(--pos-muted); }
.pos-dialog .pos-text-btn { font-size: .95rem; }
.pos-dialog .pos-list-row { color: var(--pos-ink); } .pos-dialog .pos-list-row > span { display: grid; flex: 1; }
.pos-dialog-actions { display: flex; justify-content: flex-end; gap: 4px; padding-top: 4px; }
.pos-stepper { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 8px; }
.pos-dialog .pos-stepper input { text-align: center; font-size: 1.3rem; }
.pos-step { height: 48px; border: 1px solid var(--pos-line); border-radius: 2px; background: none; color: var(--pos-ink); font-size: 1.4rem; cursor: pointer; }
.pos-customer-list { display: grid; max-height: 40vh; overflow-y: auto; }
.pos-customer-list .pos-list-heading { margin: 4px 0 2px; font-size: .8rem; }
.pos-field.pos-customer-field { grid-template-columns: auto 1fr auto; }
.pos-key-toggle { min-width: 52px; font-weight: 600; letter-spacing: .04em; }
.pos-purchases-dialog { width: min(520px, 100%); }
.pos-purchases { max-height: 60vh; overflow-y: auto; }
.pos-purchase { padding: 10px 0; border-bottom: 1px solid var(--pos-line); }
.pos-purchase-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.pos-purchase-head > span:first-child { display: grid; }

/* Phones, as in the Loyverse phone app: the Ticket bar and Open tickets / Charge on top, then the
   category bar and the items; the ticket, a receipt and a setting each open on a screen of their own. */
.pos-phone { display: flex; flex-direction: column; }
.pos-phone .pos-items { flex: 1; min-height: 0; }
.pos-phone .pos-ticket { flex: 1; min-height: 0; border-left: 0; }
.pos-phone .pos-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.pos-ticket-title { display: inline-flex; align-items: center; border: 0; background: none; padding: 8px; font-size: 1.25rem !important; font-weight: 500; cursor: pointer; border-radius: 2px; }
.pos-count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 4px; margin-left: 10px; border: 1.5px solid currentColor; border-radius: 3px; font-size: .78rem; font-weight: 500; }
.pos-actions-top { height: 84px; padding: 12px; border-top: 0; border-bottom: 1px solid var(--pos-line); background: var(--pos-bg); }
.pos-bar-cats { padding: 0; gap: 0; }
.pos-cat-select { flex: 1; height: 100%; justify-content: space-between; padding: 0 12px 0 16px; border-radius: 0; color: var(--pos-ink) !important; font-size: 1.05rem; }
.pos-cat-search { width: 56px; height: 100%; border-radius: 0; border-left: 1px solid var(--pos-line); }
.pos-bar-cats .pos-search { margin: 0 4px 0 16px; width: auto; flex: 1; }
.pos-bar-cats .pos-menu-left { left: 0; top: 0; right: 56px; }
.pos-phone-back { display: none; }
@media (max-width: 760px) {
  .pos-split { grid-template-columns: 1fr; }
  .pos-split .pos-list { border-right: 0; }
  .pos-split.chosen .pos-list, .pos-split:not(.chosen) .pos-pane { display: none; }
  .pos-phone-back { display: inline-grid; margin-left: -12px; }
  .pos-pane-title { display: flex; align-items: center; gap: 4px; }
  .pos-pane-title .pos-phone-back { margin-left: -16px; }
  .pos-pane-bar { padding-left: 16px; }
  .pos-receipt { margin: 0; box-shadow: none; max-width: none; background: none; }
  /* A chosen receipt or setting takes the whole screen, with its own bar (back arrow, title, actions). */
  .pos-screen:has(.pos-split.chosen) { grid-template-rows: minmax(0, 1fr); }
  .pos-screen:has(.pos-split.chosen) > .pos-bar { display: none; }
  .pos-split.chosen .pos-pane-bar { background: var(--pos-bar); height: 56px; }
  .pos-split.chosen .pos-pane-title { height: 56px; margin: 0 0 4px; padding: 0 16px; font-size: 1.25rem; background: var(--pos-bar); border-bottom: 1px solid var(--pos-line); }
  html:not([data-mode="dark"]) .pos-split.chosen .pos-pane-title { background: var(--pos-green); border-bottom-color: var(--pos-green); color: #fff; }
  html:not([data-mode="dark"]) .pos-split.chosen .pos-pane-title .pos-icon { color: #fff !important; }
  html:not([data-mode="dark"]) .pos-split.chosen .pos-pane-bar { background: var(--pos-green); border-bottom-color: var(--pos-green); color: #fff; }
  html:not([data-mode="dark"]) .pos-split.chosen .pos-pane-bar :is(.pos-icon, .pos-text-btn) { color: #fff !important; }
  .pos-pad { grid-template-columns: repeat(3, 68px); } .pos-key { height: 68px; }
  .pos-done-figures { gap: 24px; }
  .pos-charge-amount { font-size: 2.2rem; }
}
}
/* Appearance page */
.appearance-form { display: grid; gap: 16px; max-width: 560px; }
.appearance-form p { margin: 0; }
.appearance-form .muted.small { font-weight: 400; }
.appearance-form input[type="color"] { width: 72px; height: 40px; padding: 2px; cursor: pointer; }
.appearance-form select { max-width: 280px; }
.appearance-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.appearance-sample { display: grid; gap: 8px; justify-items: start; max-width: 560px; }
.appearance-sample p { margin: 0; }
.appearance-actions.start { justify-content: flex-start; margin-top: 8px; }
.brand-row { display: flex; gap: 16px; align-items: flex-start; padding-top: 12px; border-top: 1px solid var(--line); }
.brand-preview { flex: none; width: 140px; height: 64px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 2px; padding: 4px; }
.brand-preview.icon { width: 64px; }
.file-btn { display: inline-flex; align-items: center; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
@media (max-width: 600px) { .brand-row { flex-direction: column; } }
/* Wix SKU matching */
.match-page { position: relative; min-width: 0; max-width: 100%; }
.wo-page { min-width: 0; max-width: 100%; }
.wo-summary { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 12px; font-size: .92rem; }
.wo-detail h4 { margin: 18px 0 6px; }
.wo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.wo-grid p { margin: 4px 0 8px; }
.wo-totals { max-width: 360px; margin-top: 10px; }
.wo-totals dd { text-align: right; }
.wo-list { list-style: none; padding: 0; margin: 0; }
.wo-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.wo-action { margin-top: 16px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 2px; background: var(--card); }
.wo-action h4 { margin: 0 0 4px; }
.wo-action textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 2px; }
.wo-action label { display: block; margin: 8px 0; }
.wo-action input[name=reason] { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; }
.wo-check { display: flex !important; gap: 8px; align-items: center; }
.wo-danger summary { cursor: pointer; color: var(--bad); font-weight: 600; }
.wo-branch select { padding: 2px 6px; }
.wo-refund select, .wo-refund input[name=amount], .wo-refund input[name=reason] { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; }
.wo-refund fieldset { border: 0; padding: 0; margin: 8px 0; }
.wo-refund-items { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: .92rem; }
.wo-refund-items th, .wo-refund-items td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--line); }
.wo-refund-items input { width: 70px; }
@media (max-width: 700px) { .wo-grid { grid-template-columns: 1fr; } }
.match-tabs { display: inline-flex; gap: 0; margin-bottom: 12px; background: var(--card); box-shadow: var(--shadow); border-radius: 2px; max-width: 100%; overflow-x: auto; }
.match-tab { border: 0; border-radius: 0; background: transparent; color: var(--muted); font: inherit; font-weight: 500; padding: 12px 18px; cursor: pointer; }
.match-tab[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px var(--accent); }
.match-tab-count { margin-left: 4px; color: var(--muted); font-weight: 400; }
.match-table td { vertical-align: top; }
.match-table tr.match-pending td { background: #f4fbe7; }
.match-cell { min-width: 300px; }
.match-pick { display: flex; gap: 6px; align-items: center; }
.match-pick .lv-pick { flex: 1; min-width: 0; }
.match-suggest { display: block; margin-top: 6px; border: 1px dashed var(--good); border-radius: 2px; background: var(--good-bg); color: var(--ink); font: inherit; font-size: .85rem; padding: 5px 9px; text-align: left; cursor: pointer; }
.match-note { margin-top: 5px; font-size: .85rem; } .match-note.bad { color: var(--bad); } .match-note.good { color: var(--good); } .match-note.warn { color: var(--warn); }
.lv-menu { position: absolute; z-index: 40; max-height: 320px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 2px; box-shadow: 0 12px 28px rgba(0,0,0,.2); padding: 4px; }
.lv-menu.hidden { display: none; }
.lv-option { display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; font: inherit; text-align: left; padding: 8px 10px; border-radius: 2px; cursor: pointer; color: var(--ink); }
.lv-option.active, .lv-option:hover { background: var(--bg); }
.lv-sku { font-weight: 700; font-variant-numeric: tabular-nums; min-width: 64px; }
.lv-name { flex: 1; min-width: 0; }
.lv-empty { padding: 10px; color: var(--muted); }
.match-save-bar { display: flex; gap: 10px; align-items: center; justify-content: flex-end; margin-top: 10px; padding: 10px 14px; background: var(--card); border-radius: 2px; box-shadow: var(--shadow); }
.match-save-bar.hidden { display: none; }
.match-save-bar span { margin-right: auto; font-weight: 600; }
/* Narrow screens: each Wix row becomes a stacked card instead of a wide table row. */
@media (max-width: 700px) {
  .match-table thead { display: none; }
  .match-table, .match-table tbody, .match-table tr, .match-table td { display: block; width: 100%; box-sizing: border-box; }
  .match-table tr { border-bottom: 1px solid var(--line); padding: 10px 4px; }
  .match-table td { border: 0; padding: 4px 8px; }
  .match-table td.match-cell { min-width: 0; }
  .match-save-bar { flex-wrap: wrap; }
}

/* ---------- Dark mode (mode.js), for the whole app ----------
   The shop's main colour, font and size stay; pages and cards turn dark
   (appearance.js swaps --bg and --card), and so does everything drawn on them. */
html[data-mode="dark"] {
  --bg: #121212; --card: #1e1e1e; --ink: #e6e6e6; --muted: #a8a8a8; --line: #3a3a3a; --neutral-bg: #2c2c2c;
  --good: #66bb6a; --good-bg: #1d3323; --bad: #ef6b6b; --bad-bg: #3a1e1e; --warn: #f0b955; --warn-bg: #3a2e14; --info: #79aef0; --info-bg: #182a40;
  --shadow: 0 1px 3px rgba(0,0,0,.6), 0 1px 1px rgba(0,0,0,.4);
  color-scheme: dark;
}
html[data-mode="dark"] input, html[data-mode="dark"] select, html[data-mode="dark"] textarea, html[data-mode="dark"] .datebtn, html[data-mode="dark"] .dp-step, html[data-mode="dark"] .dp-pop, html[data-mode="dark"] .lv-menu { background: #262626; color: var(--ink); border-color: #4a4a4a; }
/* Plain and outlined buttons get a light edge in dark mode: their fill is the card's colour. */
html[data-mode="dark"] .btn:not(.primary):not(.danger):not(.good) { border-color: rgba(255,255,255,.22); }
html[data-mode="dark"] .nav-group summary:hover, html[data-mode="dark"] nav a:hover, html[data-mode="dark"] tr.clickable:hover td { background: rgba(255,255,255,.05); }
html[data-mode="dark"] nav a.active { background: rgba(255,255,255,.07); }
html[data-mode="dark"] .btn:hover { filter: brightness(1.12); }
html[data-mode="dark"] .log-row.error { background: #2e1a1a; }
html[data-mode="dark"] .log-row.warn { background: #2e2714; }
html[data-mode="dark"] .log-row pre { background: #161616; }
html[data-mode="dark"] .dp-day.in { background: color-mix(in srgb, var(--accent) 30%, #1e1e1e); }
html[data-mode="dark"] .dp-day.other { color: #7d8a92; }
html[data-mode="dark"] .dp-day.future, html[data-mode="dark"] .dp-nav:disabled { color: #555; }
html[data-mode="dark"] .match-table tr.match-pending td { background: #1f2a14; }
html[data-mode="dark"] .toast { background: #3a3a3a; }
html[data-mode="dark"] .drawer { background: rgba(0,0,0,.6); }
/* The till draws its own fields (an underline, no box) in both modes. */
html[data-mode="dark"] .pos input:not(.pos-switch), html[data-mode="dark"] .pos-dialog input { background: transparent; }
/* Businesses: the switcher at the foot of the menu and the add form. */
.business { margin-bottom: 4px; }
.business-switch select { width: 100%; }
.card.business-add { margin-top: 16px; display: grid; gap: 10px; }
.app.collapsed .business { display: none; }
/* Shops, categories and business details. */
.card.setup-form { margin-top: 16px; display: grid; gap: 10px; max-width: 760px; }
.copy-from select { margin-top: 4px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; background: #9e9e9e; }
.swatch-red { background: #e53935; } .swatch-pink { background: #ec407a; } .swatch-orange { background: #fb8c00; }
.swatch-yellow { background: #fdd835; } .swatch-green { background: #43a047; } .swatch-blue { background: #1e88e5; }
.swatch-purple { background: #8e24aa; }

/* Staff Wi-Fi (wifi.js) */
.wifi-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.wifi-meter { height: 8px; background: var(--neutral-bg); border-radius: 4px; overflow: hidden; min-width: 120px; margin: 2px 0; }
.wifi-meter span { display: block; height: 100%; width: 0; background: var(--good); }
.wifi-meter.warn span { background: #e0a100; } .wifi-meter.bad span { background: var(--bad); }
.wifi-branch + .wifi-branch { margin-top: 8px; }
.wifi-usage { min-width: 180px; }
.wifi-password { font-size: 1.4rem; letter-spacing: .08em; user-select: all; }
.wifi-script { width: 100%; font-family: Consolas, "Courier New", monospace; font-size: .8rem; white-space: pre; }
.stack { display: grid; gap: 10px; }
.stack label { display: grid; gap: 4px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; font-weight: inherit; color: inherit; cursor: pointer; }

/* LiquidLye Assistant (assistant.js): a round button at the bottom right and a chat panel.
   On the till (pos-mode) the button hides; the till's side menu opens the panel instead. */
/* The button: sparkles (the usual sign for AI) on a slowly shifting brand-to-teal gradient, a soft glow
   that breathes out every few seconds, and stars that twinkle in turn. Still for reduced motion. */
.liquidy-fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 24px; padding: 10px 18px 10px 12px; color: #fff; font: inherit; font-weight: 600; letter-spacing: .2px; cursor: pointer;
  background: linear-gradient(120deg, var(--brand-dark), var(--accent) 35%, #26a69a 65%, #5c6bc0 100%); background-size: 250% 250%;
  box-shadow: 0 4px 14px rgba(38,166,154,.45), 0 2px 6px rgba(0,0,0,.25); animation: liquidy-flow 8s ease-in-out infinite; transition: transform .2s ease, box-shadow .2s ease; isolation: isolate; }
.liquidy-fab::before { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; box-shadow: 0 0 0 0 rgba(38,166,154,.55); animation: liquidy-breathe 3.2s ease-out infinite; }
/* A soft shine sweeps across now and then; it sits under the text and is clipped to the pill. */
.liquidy-fab::after { content: ''; position: absolute; inset: 0; border-radius: inherit; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 35%, rgba(255,255,255,.45) 50%, transparent 65%) no-repeat; background-size: 250% 100%; animation: liquidy-shine 4.5s ease-in-out infinite; }
.liquidy-fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 8px 22px rgba(38,166,154,.55), 0 3px 8px rgba(0,0,0,.25); }
.liquidy-fab:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
/* Draggable (assistant.js liquidyMovable): no page scroll or text selection while dragging it. */
.liquidy-fab { touch-action: none; user-select: none; -webkit-user-select: none; }
.liquidy-fab.dragging { cursor: grabbing; transition: none; transform: scale(1.08); box-shadow: 0 10px 26px rgba(0,0,0,.35); }
.liquidy-fab svg { width: 26px; height: 26px; fill: currentColor; overflow: visible; filter: drop-shadow(0 0 3px rgba(255,255,255,.6)); }
.liquidy-fab .spark { transform-box: fill-box; transform-origin: center; animation: liquidy-twinkle 2.4s ease-in-out infinite; }
.liquidy-fab .spark.top { animation-delay: .8s; }
.liquidy-fab .spark.low { animation-delay: 1.6s; }
@keyframes liquidy-flow { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes liquidy-breathe { 0% { box-shadow: 0 0 0 0 rgba(38,166,154,.55); } 70%, 100% { box-shadow: 0 0 0 14px rgba(38,166,154,0); } }
@keyframes liquidy-shine { 0% { background-position: 150% 0; } 35%, 100% { background-position: -50% 0; } }
@keyframes liquidy-twinkle { 0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; } 50% { transform: scale(.55) rotate(45deg); opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .liquidy-fab, .liquidy-fab::before, .liquidy-fab::after, .liquidy-fab .spark { animation: none; } .liquidy-fab:hover { transform: none; } }
body.pos-mode .liquidy-fab, body.liquidy-open .liquidy-fab { display: none; }
.liquidy-panel { position: fixed; right: 16px; bottom: 16px; z-index: 70; width: min(400px, calc(100vw - 32px)); height: min(620px, calc(100vh - 32px)); display: flex; flex-direction: column; background: var(--card); color: var(--ink); border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.35); overflow: hidden; }
.liquidy-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-bottom: 1px solid var(--line); border-top: 4px solid var(--accent); }
.liquidy-head > div { flex: 1; }
.liquidy-messages { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); }
.liquidy-msg { max-width: 85%; padding: 8px 12px; border-radius: 12px; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.liquidy-msg.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.liquidy-msg.assistant, .liquidy-msg.notice { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.liquidy-msg.notice { color: var(--muted); }
.liquidy-msg.error { align-self: center; color: #c62828; font-size: .9rem; }
.liquidy-msg.thinking { color: var(--muted); font-style: italic; }
.liquidy-empty { display: grid; gap: 8px; color: var(--muted); }
.liquidy-empty .btn { justify-self: start; text-align: left; white-space: normal; text-transform: none; letter-spacing: normal; }
.liquidy-form { display: flex; gap: 8px; padding: 10px 12px 4px; border-top: 1px solid var(--line); }
.liquidy-form textarea { flex: 1; resize: none; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--ink); }
.liquidy-foot { padding: 0 12px 8px; }
.liquidy-answer { margin-top: 6px; }
@media (max-width: 600px) {
  /* Sized by liquidyFit() to the part of the screen the keyboard leaves free (assistant.js). */
  .liquidy-panel { top: var(--liquidy-top, 0); left: var(--liquidy-left, 0); right: auto; bottom: auto; width: var(--liquidy-width, 100%); height: var(--liquidy-height, 100dvh); max-width: none; border-radius: 0; }
  .liquidy-messages { min-height: 0; overscroll-behavior: contain; }
  /* 16px keeps phones from zooming in when the box is tapped. */
  .liquidy-form textarea { font-size: 16px; }
  body.liquidy-open { overflow: hidden; }
  .liquidy-fab span { display: none; }
  .liquidy-fab { padding: 12px; }
}

/* Staff messages (staffMessages.js): a Messages button in the top bar, a panel with chats,
   announcements and price notices, and a notice for each new message. On the till the
   side menu opens the panel and a dot on the menu button shows unread messages. */
.staff-msg-btn { position: relative; margin-left: auto; display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.staff-msg-btn:hover, .staff-msg-btn[aria-expanded="true"] { background: rgba(255,255,255,.14); }
.staff-msg-btn svg { width: 22px; height: 22px; fill: currentColor; }
.staff-msg-badge { position: absolute; top: 2px; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e53935; color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.staff-msg-panel { position: fixed; top: 56px; right: 16px; z-index: 72; width: min(420px, calc(100vw - 32px)); height: min(640px, calc(100vh - 72px)); display: flex; flex-direction: column; background: var(--card); color: var(--ink); border-radius: 6px; box-shadow: 0 6px 24px rgba(0,0,0,.35); overflow: hidden; }
body.pos-mode .staff-msg-panel { top: 16px; height: min(640px, calc(100vh - 32px)); }
.staff-msg-head { display: flex; align-items: center; gap: 6px; padding: 10px 12px; border-top: 4px solid var(--accent); }
.staff-msg-head > div { flex: 1; }
.staff-msg-tabs { display: flex; border-bottom: 1px solid var(--line); }
.staff-msg-tab { flex: 1; padding: 10px 6px; border: 0; border-bottom: 3px solid transparent; background: none; color: var(--muted); font: inherit; font-weight: 500; cursor: pointer; }
.staff-msg-tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.staff-msg-pill { display: inline-block; min-width: 18px; padding: 0 6px; border-radius: 9px; background: #e53935; color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.staff-msg-sub { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.staff-msg-sub input { flex: 1; padding: 6px 8px; font: inherit; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--ink); }
.staff-msg-body { flex: 1; overflow-y: auto; background: var(--bg); }
.staff-msg-body.chat { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.staff-msg-row { position: relative; display: grid; gap: 2px; width: 100%; padding: 10px 44px 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.staff-msg-row:hover { background: var(--bg); }
.staff-msg-row.unread strong { color: var(--accent); }
.staff-msg-row .staff-msg-pill { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); }
.staff-msg-row-top { display: flex; justify-content: space-between; gap: 8px; }
.staff-msg-preview { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.staff-msg-bubble { max-width: 80%; padding: 8px 12px; border-radius: 12px; line-height: 1.4; overflow-wrap: anywhere; }
.staff-msg-bubble time { display: block; margin-top: 2px; font-size: 11px; opacity: .7; }
.staff-msg-bubble.mine { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 4px; }
.staff-msg-bubble.theirs { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.staff-msg-card { margin: 10px 12px; padding: 10px 12px; border-radius: 6px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); }
.staff-msg-card.price { border-left-color: #f9a825; }
.staff-msg-new { display: inline-block; padding: 0 6px; margin-right: 2px; border-radius: 4px; background: #2e7d32; color: #fff; font-size: .75em; font-weight: 600; vertical-align: 1px; }
.staff-msg-card header { display: flex; justify-content: space-between; gap: 8px; }
.staff-msg-card p { margin: 6px 0; line-height: 1.4; overflow-wrap: anywhere; }
.staff-msg-compose { padding: 8px 12px; border-bottom: 1px solid var(--line); }
.staff-msg-compose summary { cursor: pointer; font-weight: 500; color: var(--accent); }
.staff-msg-compose form { margin-top: 8px; }
.staff-msg-compose textarea, .staff-msg-form textarea { resize: none; font: inherit; padding: 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--ink); }
.staff-msg-branches { display: flex; flex-wrap: wrap; gap: 4px 14px; border: 0; padding: 0; }
.staff-msg-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.staff-msg-form textarea { flex: 1; }
.staff-msg-empty { padding: 24px 16px; color: var(--muted); text-align: center; }
.staff-msg-toast { display: grid; gap: 2px; border: 0; font: inherit; text-align: left; cursor: pointer; border-left: 4px solid var(--accent); }
.staff-msg-toast.price { border-left-color: #f9a825; }
.staff-msg-count { margin-left: auto; min-width: 20px; padding: 0 6px; border-radius: 10px; background: #e53935; color: #fff; font-size: 12px; line-height: 20px; text-align: center; }
body.staff-msg-unread.pos-mode [data-pos="menu"] { position: relative; }
body.staff-msg-unread.pos-mode [data-pos="menu"]::after { content: ''; position: absolute; top: 8px; right: 8px; width: 10px; height: 10px; border-radius: 50%; background: #e53935; }
@media (max-width: 600px) {
  .staff-msg-panel, body.pos-mode .staff-msg-panel { top: 0; right: 0; width: 100vw; height: 100dvh; border-radius: 0; }
}

/* The till's PIN screen: Back office, for a tablet signed in with back-office rights (till.js). */
.pos-gate-link { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.pos-gate-link .pos-svg { width: 20px; height: 20px; }

/* Toasts above every panel, and clear of the assistant (assistant.js): above its button while it
   shows, left of its panel when it is open on a wide screen, at the top on a narrow one or a phone. */
.toasts { z-index: 90; }
/* Toasts sit bottom right: lift them only when the button is parked there (body[data-liquidy-dock], assistant.js). */
body:has(#liquidy-fab)[data-liquidy-dock="right-bottom"]:not(.pos-mode):not(.liquidy-open) .toasts { bottom: 84px; }
body.liquidy-open .toasts { right: 432px; }
@media (max-width: 900px) {
  body.liquidy-open .toasts { top: 12px; bottom: auto; left: 12px; right: 12px; justify-items: center; }
}
@media (max-width: 600px) {
  /* Toasts span the phone's width: lift them when the button is at the bottom on either side. */
  body:has(#liquidy-fab)[data-liquidy-dock$="-bottom"]:not(.pos-mode):not(.liquidy-open) .toasts { bottom: 80px; }
  /* The panel fills the screen: just under its header, so New chat and close stay usable. */
  body.liquidy-open .toasts { top: 72px; }
}
/* My Wi-Fi (myWifi.js), with the mobile money widget from /wifi/assets/pay.js. */
.my-wifi { display: grid; gap: 16px; max-width: 760px; }
.my-wifi-branches { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.my-wifi-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.my-wifi-head h3 { margin: 0; }
.my-wifi-login { display: flex; flex-wrap: wrap; align-items: end; gap: 12px 28px; }
.my-wifi-login > div { display: grid; gap: 2px; }
.my-wifi .mono { font-family: Consolas, "Courier New", monospace; font-size: 1.05rem; letter-spacing: .04em; user-select: all; }
.my-wifi .notice.good { background: var(--good-bg); color: var(--good); }
.my-wifi .pay-form { display: grid; gap: 12px; }
.my-wifi .pay-form .error { color: var(--bad); min-height: 1.2em; font-size: .9rem; margin: 0; }
.my-wifi .packs { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; }
.my-wifi .packs legend { font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.my-wifi .pack { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; font-weight: 400; }
.my-wifi .pack > span { flex: 1; display: grid; }
.my-wifi .pack:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.my-wifi .pay-form button.primary, .my-wifi .pay-form button.secondary { justify-self: start; border: 0; border-radius: 2px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; background: var(--brand); color: #fff; }
.my-wifi .pay-form button.secondary { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.my-wifi .pay-form button:disabled { opacity: .55; cursor: not-allowed; }
.my-wifi .step { margin: 0; font-size: .8rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: .03em; }
.my-wifi .pay-wait { text-align: center; display: grid; gap: 8px; }
.my-wifi .spinner { width: 32px; height: 32px; margin: 4px auto; border: 4px solid var(--neutral-bg); border-top-color: var(--brand); border-radius: 50%; animation: my-wifi-spin 1s linear infinite; }
@keyframes my-wifi-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .my-wifi .spinner { animation: none; } }

/* Help centre (help.js): the #help page, the ? button and the help panel. */
.topbar-grow, .help-grow { flex: 1; }
.help-btn { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 2px solid currentColor; background: transparent; color: var(--on-bar); font: inherit; font-size: 1.1rem; font-weight: 700; line-height: 1; cursor: pointer; }
.help-btn:hover { background: rgba(255,255,255,.15); } .help-btn:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.nav-icon.help { color: #ff9800; }
.help-page { max-width: 820px; display: grid; gap: 18px; }
.help-hero { display: grid; gap: 10px; border-top: 4px solid var(--accent); }
.help-hero h2 { font-size: 1.4rem; font-weight: 500; }
.help-search input { width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem; border: 1px solid var(--line); border-radius: 4px; background: var(--card); color: var(--ink); }
.help-section h3, .help-related h3 { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 4px 0 8px; }
.help-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.help-list.compact, .help-panel .help-list { grid-template-columns: minmax(0, 1fr); gap: 6px; }
.help-card { display: grid; gap: 4px; height: 100%; padding: 12px 14px; background: var(--card); color: var(--ink); text-decoration: none; border-radius: 4px; box-shadow: var(--shadow); border-left: 4px solid var(--accent); }
.help-card:hover, .help-card:focus-visible { box-shadow: 0 3px 8px rgba(0,0,0,.25); }
.help-article { background: var(--card); border-radius: 4px; box-shadow: var(--shadow); padding: 20px 24px; display: grid; gap: 12px; }
.help-panel .help-article { box-shadow: none; padding: 0; background: transparent; }
.help-article > h2 { font-size: 1.45rem; font-weight: 500; }
.help-crumbs a { color: var(--brand); }
.help-body { display: grid; gap: 10px; line-height: 1.6; }
.help-body h3 { font-size: 1.1rem; font-weight: 600; margin-top: 8px; } .help-body h4 { font-size: 1rem; font-weight: 600; }
.help-body p, .help-body ul, .help-body ol { margin: 0; } .help-body ul, .help-body ol { padding-left: 1.4em; display: grid; gap: 4px; }
.help-body a { color: var(--brand); }
.help-body code { background: var(--neutral-bg); padding: 1px 5px; border-radius: 3px; font-size: .92em; }
.help-ui { display: inline-block; padding: 0 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--neutral-bg); font-weight: 600; font-size: .92em; white-space: nowrap; }
.help-callout { padding: 10px 14px; border-radius: 4px; border-left: 4px solid var(--info); background: var(--info-bg); }
.help-callout.tip { border-color: var(--good); background: var(--good-bg); } .help-callout.careful { border-color: var(--warn); background: var(--warn-bg); }
.help-figure { margin: 4px 0; display: grid; gap: 4px; } .help-figure img { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 4px; display: block; }
.help-figure figcaption { color: var(--muted); font-size: .85rem; }
.help-related { border-top: 1px solid var(--line); padding-top: 12px; }
.help-more { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.help-panel { position: fixed; top: 0; right: 0; bottom: 0; z-index: 65; width: min(420px, 100vw); display: flex; flex-direction: column; background: var(--card); color: var(--ink); box-shadow: -4px 0 20px rgba(0,0,0,.3); }
.help-panel-head a.btn { text-decoration: none; }
.help-panel-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-top: 4px solid var(--accent); border-bottom: 1px solid var(--line); }
.help-panel-body { flex: 1; overflow-y: auto; padding: 16px; display: grid; gap: 12px; align-content: start; }
.help-panel .help-article > h2 { font-size: 1.2rem; }
.help-panel-all { margin: 0; }
@media (max-width: 860px) {
  .help-panel { width: 100vw; }
  .help-article { padding: 16px; }
  .help-list { grid-template-columns: minmax(0, 1fr); }
}

/* Training pack (#help/print): one booklet of guides, to print or save as a PDF. */
.help-pack-tools { display: grid; gap: 10px; margin-bottom: 18px; }
.help-pack-tools label { max-width: 360px; }
.help-pack-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.help-pack-buttons a.btn { text-decoration: none; }
.help-pack-cover, .help-pack-article { background: var(--card); border-radius: 8px; padding: 24px; margin-bottom: 18px; }
.help-pack-business { font-weight: 700; color: var(--accent, #4caf50); margin: 0; }
.help-pack-cover h1 { margin: 6px 0 10px; }
.help-pack-contents { padding-left: 20px; }
.help-pack-contents ol { padding-left: 18px; margin: 4px 0 10px; font-weight: normal; }
@media print {
  body:has(#help-pack) { background: #fff !important; color: #000 !important; }
  body:has(#help-pack) .topbar, body:has(#help-pack) .sidebar, body:has(#help-pack) .page-head, body:has(#help-pack) #banner,
  body:has(#help-pack) #liquidy, body:has(#help-pack) #staff-msg, body:has(#help-pack) #help-panel, body:has(#help-pack) #toasts,
  .help-pack-tools { display: none !important; }
  body:has(#help-pack) .app { display: block !important; min-height: 0; }
  body:has(#help-pack) .main, body:has(#help-pack) .view, .help-pack { margin: 0 !important; padding: 0 !important; max-width: none !important; }
  .help-pack-cover, .help-pack-article { background: none; border-radius: 0; padding: 0; margin: 0; box-shadow: none; }
  .help-pack-article { break-before: page; }
  .help-pack .help-figure { break-inside: avoid; }
  .help-pack .help-figure img { max-height: 110mm; width: auto; max-width: 100%; }
  .help-pack .help-callout { break-inside: avoid; }
  .help-pack a { color: inherit; text-decoration: none; }
}

/* Attendance timesheet (attendance.js): one small cell a day. */
.att-grid th, .att-grid td { padding: 3px 4px; font-size: .78rem; text-align: center; white-space: nowrap; }
.att-grid td.att-name { text-align: left; }
.att-grid .att-absent { background: var(--bad-bg); color: var(--bad); font-weight: 600; }
.att-grid .att-late, .att-grid .att-missing { background: var(--warn-bg); color: var(--warn); }
.att-grid .att-off { color: var(--muted, #888); }
.att-grid .att-come { color: var(--muted, #888); font-style: italic; }

/* My attendance calendar (myAttendance.js): a week a row, Monday first. */
.myat-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.myat-head { font-size: .78rem; color: var(--muted); text-align: center; }
.myat-day { min-height: 74px; border: 1px solid var(--line); border-radius: 8px; padding: 6px; font-size: .8rem; background: var(--card); }
.myat-day .myat-num { font-weight: 700; }
.myat-day .myat-label { font-weight: 600; margin-top: 2px; }
.myat-day .myat-note { font-size: .72rem; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.myat-day.good { border-color: var(--good-bg); background: var(--good-bg); color: var(--good); }
.myat-day.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-bg); }
.myat-day.bad { background: var(--bad-bg); color: var(--bad); border-color: var(--bad-bg); }
.myat-day.muted { color: var(--muted); }
.myat-day.come { color: var(--muted); border-style: dashed; }
.myat-total { font-size: 1.25rem; }
@media (max-width: 600px) { .myat-cal { gap: 3px; } .myat-day { min-height: 56px; padding: 3px; } .myat-day .myat-note { display: none; } }

/* Day-off rota (rota.js): a row a person, a column a weekday. */
.rota-grid th, .rota-grid td { text-align: center; padding: 6px 4px; }
.rota-grid td.rota-name { text-align: left; }
.rota-grid .rota-off { background: var(--good-bg); color: var(--good); font-weight: 700; }
.rota-grid .rota-clash { background: var(--bad-bg); color: var(--bad); font-weight: 700; }
.rota-grid .rota-closed { color: var(--muted); background: var(--bg); }
.rota-grid .rota-total td { font-weight: 600; border-top: 2px solid var(--line); }
.rota-cell { width: 100%; min-height: 32px; border: 1px dashed var(--line); background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer; font: inherit; }
.rota-cell:hover, .rota-cell:focus-visible { border-color: var(--brand); color: var(--brand); }
/* Staff Wi-Fi settings: speed per person. */
.wifi-speeds { border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px; display: grid; gap: 8px; }
.wifi-speeds legend { font-weight: 600; font-size: .85rem; padding: 0 4px; }
.wifi-speed-status { margin: 0; padding-left: 18px; display: grid; gap: 4px; }

/* Access rights: the ? beside each right and its pop-up. */
.right-help { width: 20px; height: 20px; margin-left: 4px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--muted); font: 600 .75rem/1 inherit; cursor: pointer; vertical-align: 1px; }
.right-help:hover, .right-help[aria-expanded="true"] { color: #fff; background: var(--brand); border-color: var(--brand); }
.right-help-pop { position: absolute; z-index: 60; width: min(340px, calc(100vw - 16px)); padding: 12px 14px; background: var(--card); color: var(--ink); border-radius: 4px; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: .875rem; line-height: 1.4; }
.right-help-pop p { margin: 0 0 8px; }
.right-help-pop dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; margin: 0 0 8px; }
.right-help-pop dt { font-weight: 600; }
.right-help-pop dd { margin: 0; }
.right-help-pop .right-help-note { color: var(--muted); }
.right-help-pop a { font-weight: 500; }

/* Access rights: search and the groups. */
.rights-find { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 0 0 12px; }
.rights-search { flex: 1 1 260px; max-width: 420px; }
.rights-search input { width: 100%; }
.rights-jump { display: flex; flex-wrap: wrap; gap: 6px; }
.rights-jump .chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; font-size: .8rem; cursor: pointer; }
.rights-jump .chip:hover { border-color: var(--brand); color: var(--brand); }
tr.rights-group th { padding: 12px; background: var(--bg); color: var(--ink); text-align: left; font-size: .95rem; }
tr.rights-group { scroll-margin-top: 44px; }
tr.rights-group th .muted { margin-left: 6px; font-weight: 400; }
tr[data-right-row].hidden, tr.rights-group.hidden { display: none; }
/* Stock count: line filter and bulk actions above the lines. */
.sc-tools { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px; margin: 12px 0 4px; }
.sc-tools .wifi-tabs { margin-bottom: 0; }
.sc-tool-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.po-line input.wh-tick { width: auto; max-width: none; margin: 0 8px 0 0; vertical-align: middle; }
.wh-tick-all { display: flex; align-items: center; gap: 6px; margin: 4px 0; }

/* Till sales, Till report, Sales by employee: the shared filter's quick days. */
.till-ranges { display: flex; flex-wrap: wrap; gap: 6px; }
.till-ranges .chip { padding: 4px 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); font: inherit; font-size: .8rem; cursor: pointer; }
.till-ranges .chip:hover { border-color: var(--brand); color: var(--brand); }
.till-ranges .chip.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.sm-list { display: flex; flex-direction: column; gap: 4px; max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px; margin: 6px 0 10px; }

/* Search this table */
.table-find { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 8px; }
.table-find label { flex: 0 1 320px; min-width: 200px; }
.table-find input { width: 100%; }
.table-wrap tr[hidden] { display: none !important; }

/* New item from an item search */
.quick-item-new .lv-name { color: var(--brand); font-weight: 600; }
.quick-item { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); border: 0; border-radius: 4px; padding: 22px; background: var(--card); color: var(--ink); box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.quick-item::backdrop { background: rgba(0,0,0,.5); }
.quick-item-form { display: grid; gap: 12px; }
.quick-item-form h3 { margin: 0; }
.quick-item-form p { margin: 0; }
.quick-item-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-item-actions { display: flex; gap: 10px; flex-wrap: wrap; }
@media (max-width: 480px) { .quick-item-row { grid-template-columns: 1fr; } }

/* Home */
.nav-icon.home { color: #ff9800; }
.home-hello { margin: 0 0 14px; font-weight: 500; }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; align-items: start; }
.home-card { display: grid; gap: 10px; }
.home-card p { margin: 0; }
.home-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.home-card-head h3 { margin: 0; }
#home-race { grid-column: 1 / -1; }
.home-race { display: flex; gap: 28px; flex-wrap: wrap; }
.home-big { font-size: 2rem; line-height: 1.1; }
.muted-strong { color: var(--muted); }
.home-race-message { font-size: 1.1rem; font-weight: 600; }
.home-race-message.win { color: var(--good); }
.home-bar { height: 10px; border-radius: 5px; background: var(--neutral-bg); overflow: hidden; }
.home-bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .4s; }
.home-bar.good span { background: var(--good); } .home-bar.info span { background: var(--info); } .home-bar.warn span { background: #f9a825; } .home-bar.bad span { background: var(--bad); }
.home-wifi { display: grid; gap: 6px; }
.home-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.home-list li span { margin-right: 8px; }
.home-links { display: flex; gap: 8px; flex-wrap: wrap; }
/* Sales race */
.race-settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.race-target { width: 120px; }

/* Access rights: by role or by right */
.rights-view { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.rights-view .chip { padding: 6px 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--ink); font: inherit; font-size: .85rem; cursor: pointer; }
.rights-view .chip:hover { border-color: var(--brand); color: var(--brand); }
.rights-view .chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.by-right-pick select { max-width: min(460px, 80vw); }
.by-right-all td { background: var(--bg); }

.sc-find { display: block; margin: 10px 0 6px; }
.sc-find input { width: 100%; }

.items-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 8px 10px; margin-bottom: 8px; }
.items-bulk #items-bulk-count { flex: 1 1 100%; }
.tick-cell { width: 32px; }
.sc-add { margin: 10px 0; }
.sc-add summary { cursor: pointer; font-weight: 600; }

.sc-dates { margin-top: 4px; }
.sc-dates .btn { white-space: normal; text-align: left; }
.sc-dates-edit { margin-top: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; gap: 6px; }
.sc-date-row { display: flex; gap: 6px; }
.sc-date-row input { width: 6.5em; }
.sc-date-actions { display: flex; gap: 6px; }

.pc-units { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.pc-units input { width: 5em; }

.home-expiry { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 4px 0 8px; }
