/* CIAO Loyalty 1.0 — the look of the customer page and the staff page (Nov. 14, 2026). Phone first, big touch targets,
   the CIAO colours (green of the "!", red of the pizza, charcoal) on a warm cream. */
:root {
  /* 2.20.0 (Yohan, Dec. 4): Cuadre's dark look for every staff page — a near-black menu, a dark grey page, slightly lighter cards,
     CIAO's green and red made brighter to read on dark. The customer page (body.public) and the printed payslip keep the light look. */
  --bg: #1a1f20; --paper: #242b2c; --ink: #e9eeec; --muted: #98a5a2; --line: #343d3e; --soft: #2c3435;
  --green: #17a556; --green-dark: #6fdc9c; --green-soft: #1d3a2a; --red: #e0505c; --red-soft: #432427; --gold: #e8aa4a; --gold-soft: #3d2f17; --gold-ink: #f0c070;
  --blue-soft: #1f2d3a; --btn: #e9eeec; --btn-ink: #121617; --input: #1d2324; --hover: rgba(255, 255, 255, .035);
  --radius: 18px; --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 1px 1px rgba(0, 0, 0, .2); --lift: 0 10px 34px rgba(0, 0, 0, .5);
  color-scheme: dark;
}
body.public {
  --bg: #f4f1eb; --paper: #ffffff; --ink: #182121; --muted: #606c6a; --line: #e2ded5; --soft: #efebe3;
  --green: #0b9444; --green-dark: #077a37; --green-soft: #e1f1e6; --red: #c7303a; --red-soft: #fbe4e3; --gold: #f2b43a; --gold-soft: #fbefd9; --gold-ink: #7a5200;
  --blue-soft: #eef4fb; --btn: #182121; --btn-ink: #ffffff; --input: #ffffff; --hover: rgba(244, 241, 235, .6);
  --shadow: 0 1px 2px rgba(30, 40, 40, .06), 0 1px 1px rgba(30, 40, 40, .04); --lift: 0 8px 30px rgba(30, 40, 40, .12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--ink); line-height: 1.45; min-height: 100vh; min-height: 100dvh; font-feature-settings: "cv11", "ss01"; -webkit-font-smoothing: antialiased; }
h1, h2, h3, b, strong, th { font-weight: 650; }
body.mezze { --bg: #1c1c1e; }
a { color: var(--green-dark); }
button { font: inherit; cursor: pointer; }
input, select, textarea { font: inherit; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hide { display: none !important; }
.sr { position: absolute; left: -9999px; }

/* header */
header.top { display: flex; align-items: center; gap: 12px; padding: 14px 18px 8px; max-width: 720px; margin: 0 auto; }
header.top img.logo { height: 44px; width: auto; }
header.top .sp { flex: 1; }
header.top .who { font-size: 13px; color: var(--muted); text-align: right; line-height: 1.25; }
header.top .who b { color: var(--ink); display: block; font-size: 14px; }
.testbar { background: var(--gold); color: #3a2a00; text-align: center; font-weight: 700; font-size: 13px; padding: 6px 10px; }
.iconbtn { border: 0; background: transparent; color: var(--muted); padding: 8px; border-radius: 12px; display: inline-flex; }
.iconbtn:hover { background: var(--soft); color: var(--ink); }

main { max-width: 720px; margin: 0 auto; padding: 8px 16px 110px; }
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--line); padding: 20px; margin: 14px 0; }
.card h2 { margin: 0 0 10px; font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.card p { margin: 8px 0; }
.muted { color: var(--muted); } .small { font-size: 13px; } .center { text-align: center; } .right { text-align: right; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: var(--paper); border-radius: 12px; padding: 8px 14px; font-weight: 600; font-size: 14px; color: var(--ink); }
.chip:hover { border-color: var(--green); }
.chip[aria-selected="true"], .chip.on { background: var(--green); color: #fff; border-color: var(--green); }
.badge { display: inline-block; border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 800; background: var(--soft); color: var(--muted); vertical-align: middle; }
.badge.green { background: var(--green-soft); color: var(--green-dark); } .badge.red { background: var(--red-soft); color: var(--red); } .badge.gold { background: var(--gold-soft); color: #7a5200; }
.badge.ciao { background: var(--green-soft); color: var(--green-dark); } .badge.mezze { background: var(--soft); color: var(--ink); }

/* forms */
label.f { display: block; margin: 12px 0 0; font-size: 13px; font-weight: 700; color: var(--muted); }
label.f span { display: block; margin-bottom: 6px; }
input.in, select.in, textarea.in { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; font-size: 18px; background: var(--input); color: var(--ink); outline: none; -webkit-appearance: none; }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23, 165, 86, .25); }
input.in.big { font-size: 28px; font-weight: 800; letter-spacing: .04em; text-align: center; padding: 16px; }
input.in.money { font-size: 34px; font-weight: 800; text-align: center; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 2px 0; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; padding: 13px 20px; font-weight: 600; font-size: 15px; background: var(--btn); color: var(--btn-ink); min-height: 50px; transition: filter .15s, background .15s; }
.btn:hover { filter: brightness(1.12); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.green { background: var(--green); color: #fff; } .btn.green:hover { background: var(--green); }
.btn.red { background: var(--red); color: #fff; } .btn.ghost { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line); } .btn.ghost:hover { background: var(--soft); filter: none; } .btn.line { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn.wide { width: 100%; } .btn.xl { font-size: 20px; min-height: 64px; border-radius: 18px; }
.btn.sm { min-height: 40px; padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.btns { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; } .btns .btn { flex: 1; }
.error { background: var(--red-soft); color: var(--red); border-radius: 12px; padding: 12px 14px; font-weight: 700; margin: 12px 0; }
.ok { background: var(--green-soft); color: var(--green-dark); border-radius: 12px; padding: 12px 14px; font-weight: 700; margin: 12px 0; }

/* the balance */
.balance { text-align: center; padding: 10px 0 4px; }
.balance .n { font-size: 64px; font-weight: 800; line-height: 1; letter-spacing: -.02em; }
.balance .n small { font-size: 20px; font-weight: 700; margin-left: 6px; letter-spacing: 0; }
.balance .st { font-size: 16px; margin-top: 8px; }
.balance .st b { color: var(--green-dark); }
.progress { display: flex; gap: 6px; justify-content: center; margin: 14px 0 4px; }
.progress .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--soft); border: 2px solid var(--line); }
.progress .dot.on { background: var(--green); border-color: var(--green); }
.ready { background: linear-gradient(135deg, var(--green), #15b35a); color: #fff; border-radius: 16px; padding: 16px 18px; text-align: center; font-weight: 800; font-size: 18px; margin: 12px 0; display: flex; align-items: center; justify-content: center; gap: 10px; }
.ready .ic { width: 28px; height: 28px; }

/* lists */
.list { margin: 0; padding: 0; list-style: none; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-top: 1px solid var(--line); }
.list li:first-child { border-top: 0; }
.list .what { flex: 1; min-width: 0; } .list .what b { display: block; } .list .what .small { color: var(--muted); }
.list .pts { font-weight: 800; font-size: 18px; white-space: nowrap; } .list .pts.plus { color: var(--green-dark); } .list .pts.minus { color: var(--red); }
.list li.voided .what, .list li.voided .pts { text-decoration: line-through; opacity: .55; }
.pick { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--paper); border-radius: 16px; padding: 14px 16px; margin: 8px 0; box-shadow: var(--shadow); }
.pick .av { width: 46px; height: 46px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); font-weight: 800; display: flex; align-items: center; justify-content: center; font-size: 18px; flex: none; }
.pick .nm { flex: 1; min-width: 0; } .pick .nm b { display: block; font-size: 17px; } .pick .nm span { color: var(--muted); font-size: 14px; }
.pick .bal { font-weight: 800; font-size: 22px; text-align: right; } .pick .bal small { display: block; font-size: 11px; color: var(--muted); font-weight: 700; }

/* the success panel */
.done { position: fixed; inset: 0; background: rgba(20, 24, 25, .96); display: flex; align-items: center; justify-content: center; padding: 20px; z-index: 30; }
.done .box { background: var(--paper); border-radius: 24px; padding: 28px 24px; max-width: 440px; width: 100%; text-align: center; box-shadow: var(--lift); }
.done .plus { font-size: 54px; font-weight: 800; color: var(--green-dark); line-height: 1; }
.done .name { font-size: 22px; font-weight: 800; margin: 10px 0 2px; }
.done .big { font-size: 20px; margin: 8px 0; }

/* bottom nav (staff) */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); z-index: 20; }
nav.tabs button { flex: 1; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; border-radius: 12px; }
nav.tabs button[aria-selected="true"] { color: var(--green-dark); }
nav.tabs button .ic { width: 24px; height: 24px; }

/* tables (stats, admin) */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td { padding: 8px 6px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tbl th { color: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; border-top: 0; }
.tbl tbody tr:hover td, .tbl tr:hover td { background-color: var(--hover); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl tr.tot td { font-weight: 800; border-top: 2px solid var(--ink); }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.tile { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; } .tile .v { font-size: 26px; font-weight: 700; line-height: 1.1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; } .tile .l { font-size: 12px; color: var(--muted); font-weight: 600; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; align-items: center; font-size: 14px; }
.kv .k { color: var(--muted); }

/* login */
.login { max-width: 420px; margin: 20px auto; }
.login .choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 10px 0; }
.login .choice button { border: 2px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 18px; padding: 18px 10px; font-weight: 800; display: flex; flex-direction: column; align-items: center; gap: 8px; min-height: 110px; }
.login .choice button img { height: 40px; width: auto; } .login .choice button.mz img { height: 34px; }
.login .choice button[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }

/* customer page extras */
.hero { text-align: center; padding: 8px 0 2px; }
.hero img { width: 240px; max-width: 70%; height: auto; }
.hero h1 { font-size: 24px; margin: 8px 0 2px; letter-spacing: -.01em; } .hero p { margin: 0; color: var(--muted); }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; text-align: center; margin-top: 10px; }
.how div { background: var(--soft); border-radius: 14px; padding: 12px 8px; font-size: 13px; font-weight: 700; }
.how div b { display: block; font-size: 22px; color: var(--green-dark); }
.brands { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 8px 0 0; } .brands img { height: 26px; width: auto; opacity: .85; }
footer.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 20px 10px 40px; }

#toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: var(--btn); color: var(--btn-ink); padding: 12px 18px; border-radius: 14px; font-weight: 700; font-size: 14px; opacity: 0; transition: .2s; z-index: 40; max-width: 92vw; pointer-events: none; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--green); border-radius: 50%; animation: spin .8s linear infinite; margin: 20px auto; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 600px) { .btns.two .btn { flex: 1 1 45%; } header.top img.logo { height: 52px; } }

/* 2.22.1 (Dec. 4, Yohan): the PUPARO HQ logo next to the CIAO logo at the top of the staff pages (no "Powered by" badge) */
header.top .prod-sep { width: 1px; align-self: stretch; margin: 6px 2px; background: var(--line); }
header.top img.prod-logo { height: 40px; width: auto; display: block; }
@media (min-width: 600px) { header.top img.prod-logo { height: 46px; } }
/* 2.4: the version label, same place on every page (bottom-right) */
.ver-badge { position: fixed; right: 8px; bottom: 6px; z-index: 40; font-size: 11px; font-weight: 500; color: var(--muted); background: var(--bg); font-variant-numeric: tabular-nums; border-radius: 8px; padding: 2px 8px; pointer-events: none; }

.num, td.num, .tbl td { font-variant-numeric: tabular-nums; }
body.public .done { background: rgba(244, 241, 235, .97); }
/* 2.22.4: PUPARO mark = Home button, small, left of the CIAO logo (staff pages) */
header.top a.home-mark { display: flex; align-items: center; padding: 4px 6px 4px 0; margin-right: 4px; border-right: 1px solid var(--line); }
header.top a.home-mark img { height: 30px; width: auto; display: block; }
header.top a.home-mark:active { opacity: .6; }
