:root {
  --bg: #f6f1ea; --surface: #ffffff; --ink: #2a1f18; --muted: #7a6a5d; --line: #e6ddd2;
  --brand: #3b2a20; --brand-ink: #ffffff; --accent: #c8782f; --good: #2f7d4f; --bad: #b3261e;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans Arabic", Tahoma, Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 16px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
.wrap { max-width: 460px; margin: 0 auto; padding: 20px 16px 48px; }
.wide { max-width: 1040px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.center { text-align: center; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
label { display: block; font-size: 14px; color: var(--muted); margin: 12px 0 6px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
input[type=color] { padding: 4px; height: 46px; }
textarea { min-height: 90px; }
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 600;
  border: 0; border-radius: 12px; padding: 13px 18px; cursor: pointer; text-decoration: none;
  background: var(--brand); color: var(--brand-ink);
}
button.secondary, .btn.secondary { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.good { background: var(--good); color: #fff; }
button.danger { background: #fff; color: var(--bad); border: 1px solid #e9c4c1; }
button.big { width: 100%; padding: 16px; font-size: 18px; }
button:disabled { opacity: .5; cursor: default; }
.err { color: var(--bad); font-size: 14px; margin-top: 8px; }
.ok { color: var(--good); }

/* customer card */
.brandbar { border-radius: var(--radius) var(--radius) 0 0; padding: 22px 20px; display: flex; align-items: center; gap: 14px; }
.brandbar img { width: 54px; height: 54px; border-radius: 12px; object-fit: cover; background: rgba(255,255,255,.15); }
.brandbar .nm { font-size: 20px; font-weight: 700; }
.loyal { border-radius: var(--radius); overflow: hidden; box-shadow: 0 10px 30px rgba(59,42,32,.18); margin-bottom: 16px; background: var(--surface); }
.loyal .body { padding: 18px 20px 22px; }
.stamps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin: 6px 0 14px; }
.stamp { aspect-ratio: 1; border-radius: 50%; border: 2px dashed var(--line); display: flex; align-items: center; justify-content: center; font-size: 22px; transition: transform .3s; }
.stamp.on { border-style: solid; color: #fff; transform: scale(1.02); }
.stamp.pop { animation: pop .5s ease; }
@keyframes pop { 0% { transform: scale(.4); } 70% { transform: scale(1.15); } 100% { transform: scale(1); } }
.count { font-size: 15px; color: var(--muted); }
.count b { font-size: 26px; color: var(--ink); }
.reward-banner { background: #fff6e6; border: 1px solid #f1d6a8; color: #7a4a10; border-radius: 12px; padding: 12px 14px; font-weight: 600; margin-bottom: 12px; }
.qr { background: #fff; border-radius: 12px; padding: 10px; width: 210px; margin: 8px auto 4px; }
.qr svg { display: block; width: 100%; height: auto; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 22px; letter-spacing: 4px; font-weight: 700; }
.lang { display: block; text-align: end; font-size: 14px; margin: -6px 0 10px; }
.walletbtns { display: grid; gap: 10px; }
.walletbtns a { background: #000; color: #fff; border-radius: 12px; padding: 12px; text-align: center; text-decoration: none; font-weight: 600; }

/* staff */
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pinpad button { padding: 20px 0; font-size: 22px; background: #fff; color: var(--ink); border: 1px solid var(--line); }
.pindots { display: flex; gap: 12px; justify-content: center; margin: 10px 0; }
.pindots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--brand); }
.pindots span.on { background: var(--brand); }
#reader { width: 100%; border-radius: 12px; overflow: hidden; }
.member-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.bigcount { font-size: 40px; font-weight: 800; }
.acts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.acts .full { grid-column: 1 / -1; }
.hist { list-style: none; padding: 0; margin: 0; font-size: 14px; }
.hist li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hist li.void { text-decoration: line-through; color: var(--muted); }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 9; }

/* owner */
.topnav { background: var(--brand); color: #fff; }
.topnav .in { max-width: 1040px; margin: 0 auto; padding: 12px 16px; display: flex; gap: 6px 16px; align-items: center; flex-wrap: wrap; }
.topnav a { color: #fff; text-decoration: none; opacity: .8; font-size: 15px; }
.topnav a.on, .topnav a:hover { opacity: 1; text-decoration: underline; }
.topnav .brand { font-weight: 700; opacity: 1; margin-inline-end: 12px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.stat .v { font-size: 28px; font-weight: 800; }
.stat .l { color: var(--muted); font-size: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: start; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 13px; }
.tablewrap { overflow-x: auto; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars div { flex: 1; background: var(--accent); border-radius: 6px 6px 0 0; min-height: 2px; position: relative; }
.bars div span { position: absolute; top: -18px; left: 0; right: 0; text-align: center; font-size: 11px; color: var(--muted); }
.barlabels { display: flex; gap: 6px; font-size: 11px; color: var(--muted); }
.barlabels span { flex: 1; text-align: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .grid2 { grid-template-columns: 1fr; } }
.pill { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: 13px; background: #efe7dc; }
.secret { font-family: ui-monospace, Menlo, monospace; background: #fff6e6; padding: 2px 6px; border-radius: 6px; }

/* poster */
.poster { width: 148mm; min-height: 210mm; margin: 20px auto; background: #fff; border-radius: 16px; padding: 18mm 14mm; text-align: center; box-shadow: 0 6px 24px rgba(0,0,0,.12); }
.poster .qr { width: 80mm; }
@media print { body { background: #fff; } .noprint { display: none !important; } .poster { box-shadow: none; margin: 0 auto; } }
