/* 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 {
  --bg: #f6f3ee; --paper: #ffffff; --ink: #1c1c1c; --muted: #6f6a63; --line: #e8e2d8; --soft: #f1ece3;
  --green: #0b9444; --green-dark: #077a37; --green-soft: #e3f3e8; --red: #c7303a; --red-soft: #fbe7e8; --gold: #f2b43a; --gold-soft: #fff2d6;
  --radius: 18px; --shadow: 0 10px 30px rgba(28, 28, 28, .08);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Manrope, 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; }
body.mezze { --bg: #efefef; }
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); padding: 20px; margin: 14px 0; }
.card h2 { margin: 0 0 10px; font-size: 18px; }
.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: 999px; padding: 8px 14px; font-weight: 700; font-size: 14px; color: var(--muted); }
.chip[aria-selected="true"], .chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.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: #ececec; color: #333; }

/* 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: 2px solid var(--line); border-radius: 14px; padding: 14px 16px; font-size: 18px; background: #fff; color: var(--ink); outline: none; -webkit-appearance: none; }
input.in:focus, select.in:focus, textarea.in:focus { border-color: var(--green); }
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: 14px; padding: 14px 20px; font-weight: 800; font-size: 16px; background: var(--ink); color: #fff; min-height: 52px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.green { background: var(--green); } .btn.green:hover { background: var(--green-dark); }
.btn.red { background: var(--red); } .btn.ghost { background: var(--soft); color: var(--ink); } .btn.line { background: transparent; border: 2px 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: 0; 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(246, 243, 238, .97); 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(--shadow); }
.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; text-transform: uppercase; letter-spacing: .04em; border-top: 0; }
.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(--soft); border-radius: 14px; padding: 12px 14px; } .tile .v { font-size: 26px; font-weight: 800; line-height: 1.1; } .tile .l { font-size: 12px; color: var(--muted); font-weight: 700; }
.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: #fff; 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(--ink); color: #fff; 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.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: 700; color: var(--muted); background: rgba(246, 243, 238, .9); border-radius: 8px; padding: 2px 8px; pointer-events: none; }
