/* Мясоедов — guest, cashier and admin UI. Warm light theme; the pass and tier
   cards stay dark like cuts of meat on butcher paper. */
:root {
  color-scheme: light;
  /* Butcher-paper cream, espresso text, oxblood accent. */
  --bg: #f6efe5;
  --surface: #fffaf2;
  --surface-2: #efe4d4;
  --line: rgba(64, 34, 24, 0.12);
  --line-2: rgba(64, 34, 24, 0.24);
  --text: #2b1b15;
  --muted: #6b574a;
  --faint: #978476;
  --accent: #9b2226;
  --accent-2: #b52b30;
  --copper: #a35a26;
  --gold: #8f6418;
  --steel: #6f6f6f;
  --ok: #2e7a47;
  --err: #b3261e;
  --ink: #241612; /* dark "steak" surfaces: pass, tier cards, tier badges */
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --pass-font: -apple-system, "SF Pro Text", "Helvetica Neue", var(--font);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 var(--font);
  font-variant-numeric: lining-nums; /* Playfair defaults to old-style figures */
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; line-height: 1.08; margin: 0 0 0.5em; letter-spacing: -0.005em; }
h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.4rem, 3.5vw, 2rem); }
h3 { font-size: 1.05rem; font-family: var(--font); font-weight: 700; letter-spacing: 0; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.875rem; }
.num { font-variant-numeric: tabular-nums lining-nums; white-space: nowrap; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }
.stack > * + * { margin-top: 1rem; }
.eyebrow { font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--copper); margin-bottom: 0.75rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- demo stand ---- */
.showcase-bar { background: var(--ink); color: #f5ece0; text-align: center; font-size: 0.85rem; padding: 8px 16px; }
.showcase-bar a { color: #e4bc70; }
.demo-logins { display: grid; gap: 8px; }
.demo-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.demo-logins code { font-weight: 700; }

/* ---- top bar & footer ---- */
.topbar { border-bottom: 1px solid var(--line); background: var(--surface); }
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 800; letter-spacing: 0.08em; font-size: 1.1rem; }
.brand img { width: 34px; height: 34px; }
.footer { border-top: 1px solid var(--line); margin-top: 72px; padding: 32px 0 48px; color: var(--faint); font-size: 0.875rem; }
.footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 32px; justify-content: space-between; }
.footer a { color: var(--muted); }

/* ---- buttons & forms ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  background: var(--accent); color: #fff; font: 700 1rem/1 var(--font); text-decoration: none;
  cursor: pointer; transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--accent-2); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--text); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: 1.1rem; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 0.875rem; }
.btn-danger { background: transparent; border-color: rgba(239, 106, 94, 0.5); color: var(--err); }
.btn-danger:hover { background: rgba(239, 106, 94, 0.1); }
.btn-wallet { background: #000; border: 1px solid #a6a6a6; border-radius: 12px; min-height: 56px; color: #fff; font-weight: 600; }
.btn-wallet:hover { background: #111; }
.btn-wallet svg { width: 26px; height: 26px; flex: none; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 0.875rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field small { display: block; color: var(--faint); margin-top: 6px; font-size: 0.8rem; }
input, select, textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-2); background: #fff; color: var(--text); font: 500 1rem var(--font);
}
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }
input[type="checkbox"] { width: 22px; min-height: 22px; height: 22px; accent-color: var(--accent); flex: none; margin: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 0.9rem; color: var(--muted); margin-bottom: 20px; }
.alert { border-radius: var(--radius-sm); padding: 12px 16px; margin-bottom: 16px; border: 1px solid; font-weight: 500; }
.alert-error { background: #fbebe8; border-color: #ecbcb5; color: #8a1f17; }
.alert-ok { background: #e9f4ec; border-color: #b9dcc3; color: #1e5a33; }
.alert-demo { background: #fbf2dd; border-color: #e9d29f; color: #5f4310; font-weight: 400; }
.card-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }

/* ---- Wallet pass replica ---- */
.pass {
  --label: #e4bc70;
  width: 100%; max-width: 340px; border-radius: 14px; overflow: hidden;
  background: #181210; color: #f5ece0; font-family: var(--pass-font);
  box-shadow: 0 40px 70px -30px rgba(70, 30, 15, 0.55), 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.pass-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; }
.pass-head img { width: 30px; height: 30px; }
.pass-logotext { flex: 1; font-weight: 700; font-size: 15px; letter-spacing: 0.03em; }
.pf { display: flex; flex-direction: column; min-width: 0; }
.pf-r { text-align: right; align-items: flex-end; }
.pf .l { font-size: 10px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--label); }
.pf .v { font-size: 16px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pass-strip { aspect-ratio: 375 / 144; background: #3a0f10 center / cover no-repeat; padding: 10px 14px; }
.pass-strip .v { font-size: 46px; font-weight: 300; line-height: 1.05; letter-spacing: -0.01em; }
.pass-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px 0; }
.pass-qr { width: 156px; margin: 18px auto 18px; padding: 10px 10px 6px; background: #fff; border-radius: 8px; color: #111; text-align: center; font-size: 11px; }
.pass-qr img { width: 100%; image-rendering: pixelated; }

/* ---- landing ---- */
.hero { padding: 56px 0 24px; }
.hero .wrap { display: grid; gap: 48px; align-items: center; grid-template-columns: 1.15fr 0.85fr; }
.hero .lead { font-size: 1.2rem; color: var(--muted); max-width: 36ch; }
.hero h1 { font-size: clamp(2.6rem, 7vw, 4.4rem); }
.hero .lead strong { color: var(--text); }
.hero-pass { display: flex; justify-content: center; position: relative; }
.hero-pass::before { content: ""; position: absolute; width: min(420px, 90%); aspect-ratio: 1; border-radius: 50%; background: #ecdcc6; top: 50%; left: 50%; transform: translate(-50%, -50%); }
.hero-pass .pass { position: relative; }
.hero-pass .pass { transform: rotate(3deg); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.section { padding: 56px 0 0; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 24px; }
.tier { position: relative; border-radius: var(--radius); overflow: hidden; min-height: 200px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; background: #2a0d0e center / cover no-repeat; color: #f5ece0; box-shadow: 0 24px 40px -28px rgba(70, 30, 15, 0.6); }
.tier::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18, 14, 13, 0) 30%, rgba(18, 14, 13, 0.85)); }
.tier > * { position: relative; z-index: 1; }
.tier-code { font-family: var(--font); font-weight: 800; letter-spacing: 0.14em; font-size: 0.85rem; }
.tier-pct { font-family: var(--display); font-weight: 800; font-size: 3.4rem; line-height: 1; }
.tier-note { color: rgba(245, 236, 224, 0.78); font-size: 0.9rem; }
.perks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 24px; }
.perk { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.perk b { display: block; font-family: var(--display); font-size: 1.5rem; margin-bottom: 6px; color: var(--accent); }
.perk span { color: var(--muted); font-size: 0.92rem; }
.join { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 40px; align-items: start; }
.join .card-box { padding: 28px; }

/* ---- card page ---- */
.card-page { display: grid; grid-template-columns: 360px 1fr; gap: 48px; padding-top: 40px; align-items: start; }
.card-page .pass { max-width: 360px; }
.inapp .btn { margin-top: 10px; }
.inapp span { display: block; margin-top: 6px; }
.desktop-qr { display: flex; gap: 16px; align-items: center; }
.desktop-qr img { flex: none; image-rendering: pixelated; border-radius: 6px; }
.history { list-style: none; padding: 0; margin: 0; }
.history li { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.history .delta { font-weight: 700; }
.plus { color: var(--ok); }
.minus { color: var(--muted); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; position: relative; padding-left: 40px; margin-bottom: 14px; color: var(--muted); }
.steps li::before { content: counter(s); position: absolute; left: 0; top: -2px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 0.85rem; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 8px 0; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--copper)); border-radius: inherit; }

/* ---- prose pages ---- */
.prose { max-width: 720px; padding-top: 40px; }
.prose h2 { margin-top: 1.6em; font-size: 1.3rem; }
.prose li { margin-bottom: 0.4em; color: var(--muted); }
.prose p { color: var(--muted); }

/* ---- login ---- */
.auth { max-width: 440px; margin: 64px auto 0; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; margin-bottom: 20px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--surface-2); }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; text-align: center; padding: 10px 8px; border-radius: 10px; color: var(--muted); transition: background 0.15s; }
.seg b { display: block; font-weight: 700; }
.seg small { display: block; font-size: 0.75rem; color: var(--faint); margin-top: 2px; }
.seg input:checked + span { background: var(--accent); color: #fff; }
.seg input:checked + span small { color: rgba(255, 255, 255, 0.75); }
.seg input:focus-visible + span { outline: 2px solid var(--copper); outline-offset: 2px; }

/* ---- admin ---- */
.admin-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.admin-nav a { color: var(--muted); text-decoration: none; padding: 8px 12px; border-radius: 8px; font-weight: 600; font-size: 0.92rem; white-space: nowrap; }
.admin-nav a:hover { color: var(--text); background: var(--surface); }
.admin-nav a.on { color: var(--text); background: var(--surface-2); }
.admin-main { padding-top: 32px; }
.page-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 { font-size: 1.8rem; margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 32px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.stat .k { color: var(--muted); font-size: 0.85rem; }
.stat .v { font-family: var(--display); font-weight: 800; font-size: 1.8rem; margin-top: 2px; }
.stat .s { color: var(--faint); font-size: 0.8rem; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { text-align: left; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--faint); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
tr.link-row { cursor: pointer; }
tr.link-row:hover td { background: var(--surface-2); }
.badge { display: inline-block; padding: 3px 9px; border-radius: 6px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; background: var(--ink); }
.badge-muted { color: var(--faint); background: transparent; border: 1px solid currentColor; }
.searchbar { display: flex; gap: 8px; max-width: 480px; flex: 1; }
.pager { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; align-items: center; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.inline-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.inline-form input, .inline-form select { width: auto; flex: 1; min-width: 140px; }
dl.kv { display: grid; grid-template-columns: auto 1fr; gap: 8px 20px; margin: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -8px 0 16px; }
.presets a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 99px; border: 1px solid var(--line-2); font-size: 0.875rem; font-weight: 600; }
.presets a:hover { color: var(--text); background: var(--surface); }
.presets a.on { color: #fff; background: var(--accent); border-color: var(--accent); }
.presets .btn { margin-left: auto; }
table.report tr.empty td { color: var(--faint); }
th.hl, td.hl { background: rgba(155, 34, 38, 0.06); font-weight: 700; }
tfoot td { font-weight: 800; border-top: 2px solid var(--line-2); border-bottom: 0; }
.guide { display: grid; gap: 20px; max-width: 820px; }
.guide h2 { font-size: 1.3rem; margin-bottom: 0.6em; }
.guide h3 { margin: 20px 0 10px; }
.guide .steps li { color: var(--text); }
dl.kv dt { color: var(--faint); }
dl.kv dd { margin: 0; }

/* ---- cashier app ---- */
.kassa { min-height: 100dvh; display: flex; flex-direction: column; }
.kassa-bar { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); gap: 12px; }
.kassa-main { flex: 1; width: min(560px, 100% - 32px); margin: 0 auto; padding: 20px 0 40px; }
.scan-box { position: relative; aspect-ratio: 1; max-height: 60vh; margin: 0 auto 16px; border-radius: var(--radius); overflow: hidden; background: #000; }
.scan-box video { width: 100%; height: 100%; object-fit: cover; }
.scan-box::after { content: ""; position: absolute; inset: 18%; border: 3px solid rgba(228, 188, 112, 0.85); border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35); }
.results { list-style: none; padding: 0; margin: 12px 0 0; }
.results button { width: 100%; text-align: left; display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); font: inherit; margin-bottom: 8px; cursor: pointer; }
.results button:hover { border-color: var(--line-2); }
.member-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 16px; }
.member-head h2 { font-family: var(--font); font-weight: 800; font-size: 1.5rem; margin: 0 0 4px; }
.balance-big { font-family: var(--display); font-size: 2.4rem; font-weight: 800; line-height: 1; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
.chip { font-size: 0.8rem; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.chip-bday { background: #fbf2dd; color: var(--gold); }
.chip-tier { background: var(--ink); }
.money-input { font-family: var(--display); font-size: 2.2rem; font-weight: 800; min-height: 72px; text-align: center; }
.redeem-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 16px; }
.redeem-row input[type="number"] { flex: 1; }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.summary div { display: flex; justify-content: space-between; padding: 4px 0; }
.summary .total { font-size: 1.15rem; font-weight: 800; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.done { text-align: center; padding: 24px 0; }
.done .tick { width: 72px; height: 72px; border-radius: 50%; background: #e9f4ec; color: var(--ok); display: grid; place-items: center; margin: 0 auto 16px; font-size: 2.2rem; }
.done .big { font-family: var(--display); font-size: 2.8rem; font-weight: 800; color: var(--ok); }
.pos-discount { border: 2px solid var(--accent); background: rgba(155, 34, 38, 0.06); border-radius: var(--radius); padding: 14px 16px; margin: 0 0 20px; }
.pos-discount .k { font-weight: 700; }
.pos-discount .v { font-family: var(--display); font-size: 2.6rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.recent { margin-top: 32px; }
.recent li { font-size: 0.9rem; }
.qr-modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.85); display: grid; place-items: center; padding: 24px; z-index: 10; }
.qr-modal .sheet { background: #fff; color: #111; border-radius: var(--radius); padding: 24px; text-align: center; max-width: 340px; }
.qr-modal img { width: 260px; height: 260px; image-rendering: pixelated; margin: 0 auto 12px; }
[hidden] { display: none !important; }

/* ---- responsive ---- */
@media (max-width: 900px) {
  .hero .wrap, .join, .card-page { grid-template-columns: 1fr; }
  .hero { padding-top: 32px; }
  .hero-pass .pass { transform: none; }
  .perks { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .card-page { gap: 32px; }
  .card-page .pass { margin: 0 auto; }
}
@media (max-width: 640px) {
  .tiers { grid-template-columns: 1fr; }
  .tier { min-height: 150px; }
  .grid-2 { grid-template-columns: 1fr; }
  .card-box { padding: 20px; }
  th, td { padding: 10px 12px; }
  .hide-sm { display: none; }
}

/* ---- print (reconciliation report, setup guide) ---- */
@media print {
  .topbar, .no-print, .alert-demo { display: none !important; }
  body { background: #fff; }
  .admin-main { padding-top: 0; }
  .table-wrap, .card-box { border-color: #bbb; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
