/* Members' Club — shared styles. © Easy Soft Services Ltd. All rights reserved. */
:root {
  --ink: #1d1418;
  --ink-2: #3a2e33;
  --muted: #6e6367;
  --wine: #6b1733;
  --wine-2: #8a2445;
  --wine-soft: #f6e9ee;
  --gold: #b8892d;
  --gold-soft: #fbf3e1;
  --bg: #f7f4ef;
  --paper: #ffffff;
  --line: #e6dfd6;
  --line-2: #d6ccc0;
  --ok: #1e7247;
  --ok-soft: #e6f4ec;
  --warn: #9a5800;
  --warn-soft: #fdf1df;
  --bad: #b3261e;
  --bad-soft: #fbe9e7;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(29, 20, 24, .06), 0 6px 20px rgba(29, 20, 24, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--wine); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
p { margin: 0 0 .7em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.tiny { font-size: .75rem; }
.num { font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.kpis { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* ---------- top bar ---------- */
.topbar { background: var(--ink); color: #fff; padding: env(safe-area-inset-top) max(20px, env(safe-area-inset-right)) 0 max(20px, env(safe-area-inset-left)); height: calc(58px + env(safe-area-inset-top)); display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand .mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(140deg, var(--wine-2), var(--wine)); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); flex: none; }
.brand .mark svg { width: 17px; height: 17px; }
.brand small { font-weight: 500; opacity: .6; margin-left: 2px; }
.topbar .spacer { flex: 1; }
.topbar a, .topbar button.link { color: #fff; opacity: .85; text-decoration: none; font-size: .9rem; background: none; border: 0; cursor: pointer; padding: 6px 4px; font-family: inherit; }
.topbar a:hover, .topbar button.link:hover { opacity: 1; }
.chips { display: flex; gap: 8px; }
.chip { background: rgba(255,255,255,.1); border-radius: 999px; padding: 4px 11px; font-size: .8rem; white-space: nowrap; }
.chip b { font-weight: 700; }

/* ---------- cards & panels ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.flat { box-shadow: none; }
.card h2 { display: flex; align-items: center; gap: 8px; }
.section-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin: 0 0 10px; }

/* ---------- forms ---------- */
label { display: block; font-size: .85rem; font-weight: 600; color: var(--ink-2); margin-bottom: 5px; }
.field { margin-bottom: 12px; }
.field .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
input, select, textarea { width: 100%; font: inherit; color: var(--ink); background: #fff; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; min-height: 44px; }
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--wine-2); box-shadow: 0 0 0 3px rgba(138, 36, 69, .15); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; min-height: 0; accent-color: var(--wine); margin: 0; flex: none; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; font-size: .9rem; cursor: pointer; }
.check input { margin-top: 1px; }
.choice { display: flex; gap: 8px; flex-wrap: wrap; }
.choice label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 14px; cursor: pointer; margin: 0; background: #fff; font-weight: 600; }
.choice label:has(input:checked) { border-color: var(--wine); background: var(--wine-soft); }
.choice label.disabled { opacity: .45; cursor: not-allowed; }
.money-input { position: relative; }
.money-input::before { content: "£"; position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money-input input { padding-left: 26px; font-variant-numeric: tabular-nums; }
.big input { font-size: 1.35rem; font-weight: 700; min-height: 54px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 650; border-radius: 10px; padding: 10px 16px; min-height: 44px; border: 1px solid var(--line-2); background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--wine); border-color: var(--wine); color: #fff; }
.btn.primary:hover { background: var(--wine-2); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.gold { background: var(--gold); border-color: var(--gold); color: #fff; }
.btn.wa { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.btn.danger { color: var(--bad); border-color: #e7b9b5; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--wine); padding-left: 8px; padding-right: 8px; }
.btn.small { min-height: 34px; padding: 6px 11px; font-size: .85rem; }
.btn.block { width: 100%; }
.btn.xl { min-height: 56px; font-size: 1.1rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: #efe9e2; color: var(--ink-2); white-space: nowrap; letter-spacing: .01em; }
.badge.gold { background: var(--gold-soft); color: #7a5a12; border: 1px solid #ecd9a8; }
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.bad { background: var(--bad-soft); color: var(--bad); }
.badge.wine { background: var(--wine-soft); color: var(--wine); }

/* ---------- notices ---------- */
.notice { border-radius: 12px; padding: 12px 14px; font-size: .9rem; border: 1px solid; }
.notice.warn { background: var(--warn-soft); border-color: #f0d3a8; color: #6b3d00; }
.notice.bad { background: var(--bad-soft); border-color: #efc2bd; color: #7d1a14; }
.notice.ok { background: var(--ok-soft); border-color: #b9dfc9; color: #134d30; }
.notice.info { background: #f3efe9; border-color: var(--line); color: var(--ink-2); }
.notice ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover td { background: #fbf8f4; }

/* ---------- KPI tiles ---------- */
.kpi { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi .label { font-size: .78rem; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 1.7rem; font-weight: 750; letter-spacing: -.02em; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .sub { font-size: .78rem; color: var(--muted); margin-top: 2px; }

/* ---------- bars ---------- */
.bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; padding-top: 6px; }
.bars .bar { flex: 1; background: var(--wine-soft); border-radius: 5px 5px 2px 2px; position: relative; min-height: 3px; }
.bars .bar.peak { background: var(--wine); }
.bars-labels { display: flex; gap: 4px; margin-top: 6px; }
.bars-labels span { flex: 1; text-align: center; font-size: .68rem; color: var(--muted); }

/* ---------- toast ---------- */
#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; box-shadow: 0 8px 30px rgba(0,0,0,.25); z-index: 100; max-width: calc(100% - 32px); font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
#toast.bad { background: var(--bad); }
#toast.ok { background: var(--ok); }

/* ---------- demo banner ---------- */
.demo-bar { background: var(--gold); color: #fff; text-align: center; font-size: .82rem; font-weight: 700; padding: 6px 12px; }

/* ---------- footer ---------- */
.footer { text-align: center; color: var(--muted); font-size: .75rem; padding: 26px 16px 34px; }
.footer a { color: var(--muted); }

/* ---------- auth pages ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 500px at 10% -10%, rgba(107, 23, 51, .10), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, rgba(184, 137, 45, .12), transparent 60%), var(--bg); }
.auth .card { width: 100%; max-width: 400px; padding: 28px; }
.auth .brand { color: var(--ink); margin-bottom: 18px; font-size: 1.05rem; }

/* ---------- dots (stamp progress) ---------- */
.dots { display: flex; flex-wrap: wrap; gap: 6px; }
.dot { width: 22px; height: 22px; border-radius: 50%; border: 2px dashed var(--line-2); background: #fff; }
.dot.on { border: 0; background: var(--wine); box-shadow: inset 0 0 0 3px rgba(255,255,255,.25); }
.gold-tier .dot.on { background: var(--gold); }

/* ---------- progress ---------- */
.progress { height: 10px; background: #efe9e2; border-radius: 999px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--wine-2), var(--wine)); border-radius: 999px; }

/* ---------- till ---------- */
.till { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; padding: 18px; max-width: 1400px; margin: 0 auto; align-items: start; }
.side { display: flex; flex-direction: column; gap: 12px; position: sticky; top: 76px; }
.search { position: relative; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); }
.search input { font-size: 1.05rem; min-height: 56px; padding-left: 44px; border-radius: 12px; border-width: 2px; }
.results { display: flex; flex-direction: column; gap: 6px; max-height: 46vh; overflow: auto; }
.result { display: flex; align-items: center; gap: 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; cursor: pointer; text-align: left; font: inherit; color: inherit; width: 100%; }
.result:hover, .result.active { border-color: var(--wine-2); background: #fffafb; }
.avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--wine-soft); color: var(--wine); display: grid; place-items: center; font-weight: 750; flex: none; font-size: .9rem; }
.avatar.gold { background: var(--gold-soft); color: #7a5a12; box-shadow: inset 0 0 0 2px #ecd9a8; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.2rem; }
.result .meta { flex: 1; min-width: 0; }
.result .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-box { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; border-radius: 11px; background: var(--wine); color: #fff; font-size: .75rem; font-weight: 750; padding: 0 6px; }
.count.zero { background: #d8d0c7; }
.welcome { text-align: center; padding: 60px 20px; }
.welcome .big-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 18px; background: linear-gradient(140deg, var(--wine-2), var(--wine)); display: grid; place-items: center; }
.welcome .big-icon svg { width: 34px; height: 34px; }
.member-head { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.member-head .who { flex: 1; min-width: 200px; }
.member-head h1 { margin: 0; font-size: 1.45rem; }
.balance { display: flex; gap: 18px; flex-wrap: wrap; }
.balance .item .v { font-size: 1.6rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.balance .item .l { font-size: .78rem; color: var(--muted); font-weight: 600; }
.sale-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.preview { background: var(--ink); color: #fff; border-radius: 12px; padding: 14px 16px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: center; }
.preview .pay { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.preview .earn { color: #f1d9a0; font-weight: 700; }
.preview.err { background: var(--bad); }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; background: #fff; }
.stepper button { width: 40px; min-height: 40px; border: 0; background: #f4efe9; font-size: 1.2rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper span { min-width: 40px; text-align: center; font-weight: 750; font-variant-numeric: tabular-nums; }
.stamp-row { display: flex; align-items: center; gap: 12px; justify-content: space-between; flex-wrap: wrap; padding: 10px 0; border-top: 1px solid var(--line); }
.stamp-row:first-child { border-top: 0; }
.receipt { text-align: center; padding: 26px 18px; }
.receipt .pay { font-size: 2.6rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.order { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.order + .order { margin-top: 10px; }
.modal { position: fixed; inset: 0; background: rgba(29, 20, 24, .6); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal .card { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; }
.modal video { width: 100%; border-radius: 10px; background: #000; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%); background: var(--bg); box-shadow: -10px 0 40px rgba(0,0,0,.18); z-index: 60; overflow: auto; padding: 20px; }

/* ---------- admin ---------- */
.admin { max-width: 1240px; margin: 0 auto; padding: 18px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 18px; scrollbar-width: none; }
.tabs button { font: inherit; font-weight: 650; color: var(--muted); background: none; border: 0; padding: 12px 14px; cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--wine); border-bottom-color: var(--wine); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters button { font: inherit; font-size: .85rem; font-weight: 600; border: 1px solid var(--line-2); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; color: var(--ink-2); }
.filters button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list-row:first-child { border-top: 0; }
.list-row .grow { flex: 1; min-width: 180px; }
.done-row { opacity: .5; }

.topbar a, .topbar button.link, .topbar #who { white-space: nowrap; }
.topbar .brand { min-width: 0; }
@media (max-width: 1000px) {
  .topbar .chips, .topbar #who { display: none; }
}
@media (max-width: 900px) {
  .till { grid-template-columns: 1fr; }
  .side { position: static; }
}
@media (max-width: 720px) {
  .topbar { padding: env(safe-area-inset-top) max(14px, env(safe-area-inset-right)) 0 max(14px, env(safe-area-inset-left)); gap: 10px; }
  .sale-grid { grid-template-columns: 1fr; }
  .topbar .chips { display: none; }
  .hide-sm { display: none !important; }
  /* phone: owner tabs become tappable pills, numbers sit two to a row */
  .tabs { flex-wrap: wrap; gap: 6px; border-bottom: 0; overflow: visible; }
  .tabs button { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: .88rem; }
  .tabs button.on { background: var(--wine); border-color: var(--wine); color: #fff; }
  .grid.kpis { grid-template-columns: 1fr 1fr; gap: 10px; }
  .kpi { padding: 13px; }
  .kpi .value { font-size: 1.4rem; }
  td, th { padding-left: 7px; padding-right: 7px; }
}
.show-sm { display: none; }
@media (max-width: 720px) { .show-sm { display: block; } }
@media print {
  .no-print { display: none !important; }
  body { background: #fff; }
}
.drawer { padding-top: calc(20px + env(safe-area-inset-top)); padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
