/* Shared look for the counter and the back office. System fonts only: it must look right with no internet. */
:root {
  --bg: #f6f7f9; --card: #fff; --ink: #111827; --muted: #6b7280; --line: #e5e7eb; --soft: #f3f4f6;
  --accent: #111827; --accent-ink: #fff; --lime: #d9f99d; --ok: #15803d; --warn: #b45309; --bad: #b91c1c;
  --radius: 12px; --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 16px rgba(0,0,0,.06);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { font-size: 15px; line-height: 1.4; -webkit-font-smoothing: antialiased; }
h1 { font-size: 22px; margin: 0 0 12px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0 0 10px; }
h3 { font-size: 15px; margin: 0 0 10px; }
p { margin: 6px 0; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { width: 100%; padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 9px; background: #fff; min-height: 40px; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .hint { color: var(--muted); font-size: 13px; }
.err { color: var(--bad); font-size: 14px; min-height: 1em; } .ok { color: var(--ok); } .warnc { color: var(--warn); }
.lbl { display: block; font-size: 13px; color: var(--muted); margin: 12px 0 4px; }
.row { display: flex; gap: 8px; align-items: center; } .row.wrap { flex-wrap: wrap; } .row.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
a.btn { color: inherit; text-decoration: none; display: inline-flex; align-items: center; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 9px 14px; min-height: 40px; cursor: pointer; background: var(--soft); font-weight: 600; white-space: nowrap; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:disabled, .btn:disabled { opacity: .4; cursor: not-allowed; }
.btn.ghost { background: #fff; border-color: var(--line); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.big { min-height: 48px; padding: 12px 20px; font-size: 16px; }
.btn.sm { min-height: 32px; padding: 5px 10px; font-size: 13px; }
.link { background: none; border: 0; color: #2563eb; cursor: pointer; padding: 0; font-size: 12px; text-decoration: underline; }
kbd { font-size: 11px; border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; opacity: .7; margin-left: 6px; font-family: inherit; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.narrow { max-width: 420px; margin: 40px auto; }
.tag { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--soft); color: var(--muted); white-space: nowrap; }
.tag.ok { background: #dcfce7; color: var(--ok); } .tag.warn { background: #fef3c7; color: var(--warn); } .tag.bad { background: #fee2e2; color: var(--bad); }
.center { text-align: center; padding: 60px 16px; }
table { border-collapse: collapse; width: 100%; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 1px solid var(--line); }
td { padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th.num { text-align: right; }

/* top bar with the store and the Recurlab credit */
.top { display: flex; align-items: center; gap: 16px; padding: 10px 18px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; flex-wrap: wrap; }
.brand .store { font-weight: 700; font-size: 16px; }
.brand .credit { font-weight: 800; letter-spacing: -.04em; font-size: 11px; color: var(--muted); }
.top nav { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.nav { white-space: nowrap; flex-shrink: 0; background: none; border: 0; padding: 8px 12px; border-radius: 9px; cursor: pointer; font-weight: 600; color: var(--muted); }
.nav.on { background: var(--ink); color: #fff; }
.top .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.who { font-size: 13px; color: var(--muted); }
.pill { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.pill.warn { background: #fef3c7; border-color: #fcd34d; } .pill.bad { background: #fee2e2; border-color: #fca5a5; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: #9ca3af; display: inline-block; }
.dot.on { background: #22c55e; } .dot.off { background: #f59e0b; }

/* sheets (dialogs) */
.modal { position: fixed; inset: 0; display: none; align-items: flex-start; justify-content: center; padding: 6vh 16px; background: rgba(17,24,39,.35); z-index: 50; overflow: auto; }
.modal.open { display: flex; }
.sheet { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 440px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.sheet.wide { max-width: 620px; }
.sheet .row { margin-top: 14px; justify-content: flex-end; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%) translateY(20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: .2s; z-index: 60; max-width: min(560px, calc(100vw - 32px)); pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%); } .toast.bad { background: var(--bad); }

/* PIN pad */
.pin { font-size: 26px; letter-spacing: .4em; text-align: center; }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; }
.pad button { min-height: 52px; font-size: 20px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; }
.pad button:active { background: var(--soft); }

/* guided tour: outline only, never a grey layer */
.tour-on { outline: 3px solid #2563eb !important; outline-offset: 3px; border-radius: 10px; position: relative; z-index: 15; }
#tourCard { position: fixed; right: 16px; bottom: 16px; width: min(360px, calc(100vw - 32px)); background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.18); padding: 14px 16px; z-index: 70; }
#tourCard.mini { width: auto; padding: 6px; }
#tourCard h3 { margin: 6px 0; } #tourCard p { font-size: 14px; }
#tourCard .t-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
#tourCard button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 13px; }
#tourCard .t-row { display: flex; gap: 6px; justify-content: flex-end; margin-top: 10px; flex-wrap: wrap; }
#tourCard .t-primary { background: var(--ink); color: #fff; border-color: var(--ink); }
#tourCard .t-try { background: #eff6ff; padding: 6px 8px; border-radius: 8px; }

/* printing: only the receipt */
#print { display: none; }
@media print {
  @page { size: 80mm auto; margin: 3mm; }
  body > *:not(#print) { display: none !important; }
  #print { display: block !important; }
  html, body { background: #fff !important; }
}
.receipt { width: 74mm; font-family: "Courier New", ui-monospace, monospace; font-size: 11.5px; color: #000; line-height: 1.3; }
.receipt hr { border: 0; border-top: 1px dashed #000; margin: 4px 0; }
.r-c { text-align: center; } .r-b { font-weight: 700; } .r-big { font-size: 14px; } .r-small { font-size: 10.5px; }
.r-title { margin: 4px 0; letter-spacing: .05em; }
.r-row { display: flex; justify-content: space-between; gap: 6px; }
.r-line { margin: 2px 0; }
.r-t { width: 100%; } .r-t th, .r-t td { padding: 1px 2px; border: 0; font-size: 10.5px; color: #000; text-transform: none; letter-spacing: 0; }
.r-box { border: 1px solid #000; padding: 4px; margin-top: 6px; }
/* the old POS's A4 invoice (settings: Bill paper = A4) */
.inv-a4 { box-sizing: border-box; width: 100%; max-width: 190mm; font: 10.5px/1.35 Arial, Helvetica, sans-serif; color: #000; border: 1px solid #000; }
.inv-a4 .b { font-weight: 700; } .inv-a4 .small { font-size: 9px; }
.a4-head { display: flex; gap: 12px; padding: 6px 8px 2px; align-items: flex-start; }
.a4-logo { width: 38mm; padding: 4mm 0; } .a4-logo img { width: 100%; display: block; }
.a4-co { font-size: 11px; line-height: 1.5; } .a4-co .b { font-size: 11.5px; }
.a4-title { text-align: right; padding: 4px 8px 6px; font-size: 11.5px; }
.a4-trial { text-align: right; padding: 0 8px 6px; font-size: 9.5px; }
.a4-meta { display: grid; grid-template-columns: 1fr 1fr 1fr; border-top: 1px solid #000; padding: 4px 4px; font-size: 11px; line-height: 1.6; } .a4-meta .r { text-align: right; }
.a4-t { width: 100%; border-collapse: collapse; } .a4-t th, .a4-t td { border: 1px solid #000; padding: 2px 4px; font-size: 9.5px; color: #000; text-transform: none; letter-spacing: 0; vertical-align: top; }
.a4-t th { font-weight: 700; text-align: left; } .a4-t .n { text-align: right; } .a4-t .c { text-align: center; } .a4-t .big { font-size: 11.5px; }
.a4-t tr > :first-child { border-left: 0; } .a4-t tr > :last-child { border-right: 0; }
.a4-net { text-align: right; padding: 5px 8px; border-bottom: 1px solid #000; font-size: 11.5px; } .a4-net .small { font-weight: 400; }
.a4-foot { display: grid; grid-template-columns: 38% 1fr; padding: 6px 4px; font-size: 11px; line-height: 1.7; }
.a4-left span { display: inline-block; width: 90px; } .a4-right .tr { display: grid; grid-template-columns: 1fr 1fr; }
.a4-rem { padding: 2px 4px 8px; font-size: 11px; border-bottom: 1px solid #000; }
.a4-end { text-align: center; padding: 4px; font-size: 10.5px; line-height: 1.9; }

@media (max-width: 760px) {
  .grid2 { grid-template-columns: 1fr; }
  .top { padding: 8px 12px; gap: 8px; }
  .top nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
}
