/* Фирменный стиль «Летово Джуниор» (letovojunior.ru): синий #1D428A, оранжевый #F25830,
   светло-голубой #E2EBFF, скругления 12px. Шрифт сайта Mont — платный, поэтому Montserrat. */
:root {
  --bg: #f4f7fd;
  --card: #ffffff;
  --text: #111820;
  --muted: #6b7487;
  --line: #e1e7f2;
  --primary: #1d428a;
  --primary-hover: #163571;
  --primary-soft: #e2ebff;
  --accent: #f25830;
  --accent-hover: #d9471f;
  --accent-soft: #ffe9d4;
  --ok: #1f9d63;
  --ok-bg: #dcf5e8;
  --bad: #d93a2b;
  --bad-bg: #fde4e1;
  --radius: 12px;
  --font: Montserrat, Mont, Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 var(--font); }
body { padding-bottom: env(safe-area-inset-bottom); }
#app { max-width: 720px; margin: 0 auto; padding: 12px 16px 48px; }
#app.wide { max-width: 1100px; }
h1, h2, h3 { color: var(--primary); font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 24px; margin: 4px 0 12px; }
h2 { font-size: 19px; margin: 22px 0 8px; }
h3 { font-size: 16px; margin: 12px 0 6px; }
a { color: var(--primary); text-underline-offset: 3px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > .grow { flex: 1 1 160px; }
.spacer { flex: 1; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 10px 0;
  box-shadow: 0 1px 2px rgba(29, 66, 138, .04); }

/* шапка с логотипом */
.topbar { display: flex; align-items: center; gap: 10px; margin: 0 -16px 10px; padding: 10px 16px;
  background: #fff; border-bottom: 3px solid var(--accent); position: sticky; top: 0; z-index: 10; }
.topbar .logo { height: 34px; width: auto; display: block; }
.topbar .title { font-weight: 600; font-size: 17px; color: var(--primary); padding-left: 10px; border-left: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1 1 auto; }
.topbar .badge { flex: none; }
.hero { text-align: center; padding: 28px 0 8px; position: relative; }
.hero img { height: 64px; width: auto; }
.hero h1 { font-size: 28px; margin: 14px 0 4px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 12px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
.badge.open { background: var(--ok-bg); color: #0d6b41; }
.badge.draft { background: var(--accent-soft); color: #9a3412; }
.badge.closed, .badge.blocked { background: var(--bad-bg); color: #8f1d12; }
.banner { padding: 12px 14px; border-radius: var(--radius); background: var(--accent-soft); color: #7c2d12; margin: 8px 0; }

/* кнопки как на сайте: синяя основная, светло-голубая второстепенная, оранжевая акцентная */
button, .btn { font: inherit; font-weight: 500; border: 0; background: var(--primary-soft); color: var(--primary);
  border-radius: var(--radius); padding: 10px 16px; cursor: pointer; text-decoration: none; display: inline-flex;
  align-items: center; justify-content: center; gap: 6px; min-height: 44px; transition: background .15s, transform .05s; }
button:hover, .btn:hover { background: #d3e0ff; }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: default; }
button.primary, .btn.primary { background: var(--primary); color: #fff; font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--primary-hover); }
button.accent { background: var(--accent); color: #fff; font-weight: 600; }
button.accent:hover { background: var(--accent-hover); }
button.ok { background: var(--ok); color: #fff; font-weight: 600; }
button.danger { background: var(--bad-bg); color: var(--bad); }
button.big { width: 100%; font-size: 18px; min-height: 56px; }
button.sm, .btn.sm { min-height: 34px; padding: 6px 12px; font-size: 14px; }
button.link { background: none; color: var(--primary); padding: 4px; min-height: 0; text-decoration: underline; text-underline-offset: 3px; }
button:focus-visible, .btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid rgba(29, 66, 138, .35); outline-offset: 2px; }

input, select, textarea { font: inherit; width: 100%; padding: 10px 12px; border: 1px solid #cfd8ea; border-radius: var(--radius);
  background: #fff; color: var(--text); min-height: 44px; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); }
textarea { min-height: 160px; font-family: ui-monospace, Consolas, monospace; font-size: 14px; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
input[type=checkbox] { width: 20px; height: 20px; min-height: 0; accent-color: var(--primary); }

/* монета коина */
.coin-i { display: inline-block; width: .95em; height: .95em; border-radius: 50%; vertical-align: -.12em;
  background: radial-gradient(circle at 35% 35%, #ffb38f 0 18%, var(--accent) 19% 62%, #c63d17 63% 100%);
  box-shadow: inset 0 0 0 .08em rgba(255, 255, 255, .45); }
.balance { font-size: 46px; font-weight: 700; letter-spacing: -1px; color: var(--primary); line-height: 1.1; }
.balance small { font-size: 18px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 8px 0 12px; }
.tabs button { background: none; border-bottom: 3px solid transparent; border-radius: 0; white-space: nowrap; padding: 10px 12px; color: var(--muted); }
.tabs button:hover { background: none; color: var(--primary); }
.tabs button.active { border-bottom-color: var(--accent); color: var(--primary); font-weight: 600; }

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .main { flex: 1 1 55%; min-width: 0; }
.list .amt { font-weight: 700; white-space: nowrap; }
.plus { color: var(--ok); }
.minus { color: var(--bad); }
.strike { text-decoration: line-through; opacity: .6; }

.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.product { background: #fff; border: 1px solid var(--line); color: var(--text); border-radius: 14px; padding: 12px; text-align: left;
  flex-direction: column; align-items: flex-start; justify-content: flex-start; min-height: 84px; }
.product:hover { background: #fff; border-color: var(--primary); }
.product b { font-size: 15px; font-weight: 600; }
.product .price { color: var(--accent); font-weight: 700; }
.product.out { opacity: .45; }

.cart-line { display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.cart-line .name { flex: 1; }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { min-height: 36px; width: 36px; padding: 0; }
.total { font-size: 28px; font-weight: 700; color: var(--primary); }

.qr { background: #fff; padding: 10px; border-radius: var(--radius); display: inline-block; line-height: 0; }
.qr svg { width: 100%; height: auto; }
.qr.lg { width: min(78vw, 340px); border: 3px solid var(--primary-soft); }
.qr.md { width: 200px; }
.qr.sm { width: 110px; }

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { color: var(--muted); font-weight: 600; font-size: 12px; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover { background: #f0f5ff; }
.table-wrap { overflow-x: auto; }
code { font-family: ui-monospace, Consolas, monospace; letter-spacing: 1px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; border-top: 3px solid var(--primary); }
.stat:nth-child(2n) { border-top-color: var(--accent); }
.stat .v { font-size: 26px; font-weight: 700; color: var(--primary); }
.stat .l { font-size: 13px; color: var(--muted); }

.modal-bg { position: fixed; inset: 0; background: rgba(17, 24, 32, .5); display: flex; align-items: flex-end; justify-content: center; z-index: 50; }
.modal { background: var(--bg); width: 100%; max-width: 620px; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 18px; }
@media (min-width: 700px) { .modal-bg { align-items: center; } .modal { border-radius: 20px; } }
.modal .close { float: right; text-decoration: none; font-size: 18px; }

.full { position: fixed; inset: 0; z-index: 60; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; background: var(--bg); overflow-y: auto; }
.full.success { background: var(--ok); color: #fff; }
.full.success h1, .full.success h2 { color: #fff; }
.full.success .btn, .full.success button { background: #fff; color: var(--primary); }
.full .huge { font-size: 64px; line-height: 1; }
.full .amount { font-size: 40px; font-weight: 700; margin: 10px 0; }
.full:not(.success) .amount { color: var(--primary); }

.scanner { position: relative; width: 100%; max-width: 420px; aspect-ratio: 1; background: #000; border-radius: 16px; overflow: hidden; margin: 0 auto; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner::after { content: ""; position: absolute; inset: 18%; border: 3px solid var(--accent); border-radius: 14px; }

.pin { font-size: 32px; text-align: center; letter-spacing: 12px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; max-width: 92vw; }
#toast div { background: var(--primary); color: #fff; padding: 12px 16px; border-radius: var(--radius); margin-top: 8px; box-shadow: 0 8px 24px rgba(17, 24, 32, .25); }
#toast div.err { background: var(--bad); }

details > summary { cursor: pointer; color: var(--primary); }

/* печать карточек */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.pcard { border: 1.5px dashed #9aa6bd; border-left: 6px solid var(--primary); border-radius: 12px; padding: 10px; display: flex; gap: 10px;
  align-items: center; background: #fff; break-inside: avoid; }
.pcard .qr { padding: 0; }
.pcard .logo-sm { height: 18px; width: auto; display: block; margin-bottom: 2px; }
.pcard .t { font-weight: 700; color: var(--primary); }
.pcard .code { font-family: ui-monospace, Consolas, monospace; font-size: 18px; font-weight: 700; letter-spacing: 2px; color: var(--accent); }
@media print {
  body { background: #fff; }
  .no-print, .topbar, .tabs { display: none !important; }
  #app { max-width: none; padding: 0; }
  .cards { grid-template-columns: repeat(3, 1fr); gap: 6mm; }
  .pcard { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
