/* Приложение клиента и менеджера (адаптивное, мобильный приоритет) */
body { background: var(--surface-soft); }
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; background: var(--surface); position: relative; display: flex; flex-direction: column; }
@media (min-width: 600px) { .app { box-shadow: 0 0 40px rgba(16,39,54,.06); } }

.topbar { position: sticky; top: 0; z-index: 20; padding: 10px 20px 6px; background: var(--surface); }
.topbar-in { display: flex; align-items: center; gap: 12px; min-height: 52px; }
.topbar-title { font-family: var(--font-display); font-weight: 400; font-size: 20px; line-height: 1; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.salon-switch { border: 0; background: var(--surface-soft); border-radius: var(--radius-pill); padding: 8px 14px; font: 14px var(--font-sans); color: var(--ink-deep); display: inline-flex; gap: 6px; align-items: center; cursor: pointer; max-width: 55%; }
.salon-switch span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.salon-switch .icon { width: 18px; height: 18px; }

.screen { flex: 1; padding: 8px 20px 120px; position: relative; overflow-x: hidden; }
.screen > .over-lines { display: grid; gap: var(--space-3); }
.screen-head { display: flex; align-items: center; gap: 12px; margin: 6px 0 4px; }
.screen-head h1, .screen-head h2 { flex: 1; }

/* нижнее меню */
.tabbar { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; z-index: 30; padding: 0 12px calc(10px + env(safe-area-inset-bottom)); pointer-events: none; }
.tabbar-in { pointer-events: auto; display: flex; background: var(--surface); border-radius: var(--radius-pill); box-shadow: 0 -2px 20px rgba(16,39,54,.08); border: 1px solid var(--line-hairline); padding: 6px; }
.tab { flex: 1; display: grid; justify-items: center; gap: 2px; padding: 7px 2px; border-radius: var(--radius-pill); color: var(--ink-muted); text-decoration: none; font-size: 11px; min-height: 48px; transition: color 200ms; }
.tab[aria-current="page"] { color: var(--gold-deep); font-weight: 600; }
.tab[aria-current="page"] .icon { stroke-width: 1.8; }

/* ---------- вход и регистрация ---------- */
body:has(.auth) { background: var(--surface); }
.auth { min-height: 100vh; min-height: 100dvh; position: relative; overflow: hidden; display: flex; flex-direction: column; padding: 28px 24px 40px; }
.auth .over-lines { display: grid; gap: var(--space-3); max-width: 420px; width: 100%; margin: 0 auto; }
.auth-logo { display: grid; justify-items: center; gap: 10px; margin: 10px 0 18px; text-align: center; }
.auth-logo img { width: 48px; height: 48px; }
.steps { display: flex; gap: 6px; justify-content: center; }
.steps i { width: 26px; height: 4px; border-radius: 4px; background: var(--surface-neutral); }
.steps i.on { background: var(--gold); }
.otp { display: flex; gap: 12px; justify-content: center; }
.otp input { width: 58px; height: 64px; text-align: center; font: 28px var(--font-sans); border: 0; border-radius: var(--radius-sm); background: var(--surface-input); color: var(--ink-deep); }
.otp input:focus { outline: 2px solid var(--sky); }
.dev-hint { font-size: 12px; text-align: center; color: var(--ink-muted); border: 1px dashed var(--line-soft); border-radius: var(--radius-sm); padding: 8px; }

/* ---------- главная клиента ---------- */
.hello { font-size: 15px; color: var(--ink-deep); text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; flex: 1; }
.balance-big { font-family: var(--font-display); font-weight: 400; font-size: 44px; line-height: .95; color: var(--ink); }
.balance-big small { font-size: 20px; }

.guest-card {
  font: inherit; color: inherit; position: relative; margin: 6px auto 0; width: min(100%, 330px); background: var(--surface);
  border: 1px solid var(--gold); border-radius: 999px 999px var(--radius-md) var(--radius-md);
  padding: 34px 26px 22px; display: grid; justify-items: center; gap: 12px; cursor: pointer;
  box-shadow: 0 12px 30px rgba(106,93,73,.10); transition: transform 300ms; text-align: center;
}
.guest-card:active { transform: scale(0.98); }
.guest-card .gc-top { display: grid; justify-items: center; gap: 4px; }
.guest-card .gc-top img { width: 40px; height: 40px; }
.guest-card .gc-label { font-family: var(--font-display); font-size: 15px; text-transform: uppercase; letter-spacing: .5px; color: var(--gold-deep); }
.guest-card .qr-box { width: 200px; height: 200px; }
.guest-card .qr-box svg { width: 100%; height: 100%; display: block; }
.guest-card .gc-name { font-size: 16px; }
.guest-card .gc-bal { font-family: var(--font-display); font-size: 20px; font-weight: 400; color: var(--ink-deep); }
.timer { width: 100%; height: 4px; background: var(--surface-soft); border-radius: 4px; overflow: hidden; }
.timer i { display: block; height: 100%; background: var(--gold); border-radius: 4px; transition: width 1s linear; }

.welcome-banner { background: #F6F0E6; border-radius: var(--radius-md); padding: 18px 22px; display: flex; gap: 14px; align-items: center; }
.welcome-banner b { font-family: var(--font-display); font-weight: 400; font-size: 18px; color: var(--ink-deep); }

/* список операций */
.ops { display: grid; }
.op { display: flex; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line-hairline); }
.op:last-child { border-bottom: 0; }
.op-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-soft); flex: none; color: var(--gold-deep); font-family: var(--font-display); font-size: 18px; }
.op-main { flex: 1; min-width: 0; }
.op-title { font-size: 15px; }
.op-sub { font-size: 13px; color: var(--ink-muted); }
.op-amt { font-family: var(--font-display); font-size: 18px; font-weight: 400; white-space: nowrap; }
.op.reversed .op-title, .op.reversed .op-amt { text-decoration: line-through; color: var(--ink-muted); }
.day-head { font-size: 13px; color: var(--ink-muted); margin-top: 14px; text-transform: lowercase; }
.row-link { display: flex; align-items: center; gap: 14px; padding: 16px 4px; border-bottom: 1px solid var(--line-hairline); color: var(--ink); text-decoration: none; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; font: inherit; text-align: left; cursor: pointer; }
.row-link > span { flex: 1; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.section-title h3 { font-size: 20px; }
.link { color: var(--ink-deep); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; padding: 6px 0; font-family: var(--font-sans); }

/* ---------- QR на весь экран ---------- */
.qr-full { position: fixed; inset: 0; background: var(--surface); z-index: 80; display: flex; flex-direction: column; align-items: center; padding: 20px 24px 36px; overflow: auto; }
.qr-full .close { align-self: flex-end; }
.qr-full .qr-big { width: min(82vw, 380px); aspect-ratio: 1; margin-top: 10px; }
.qr-full .qr-big svg { width: 100%; height: 100%; display: block; }
.qr-full .timer { width: min(82vw, 380px); margin-top: 14px; }
.backup-code { font-family: var(--font-display); font-size: 44px; font-weight: 400; letter-spacing: 6px; color: var(--ink-deep); }

/* ---------- акции ---------- */
.promo-card { border-radius: var(--radius-md); overflow: hidden; background: var(--surface); border: 1px solid var(--line-hairline); cursor: pointer; text-align: left; padding: 0; font: inherit; color: inherit; display: block; width: 100%; transition: transform 300ms; }
.promo-card:active { transform: scale(0.98); }
.cover { aspect-ratio: 16 / 9; background: var(--surface-soft) center / cover no-repeat; width: 100%; }
.promo-card .pc-body { padding: 16px 20px 20px; display: grid; gap: 8px; }
.promo-card h3 { font-size: 20px; }
.promo-banner { position: relative; border-radius: var(--radius-md); overflow: hidden; cursor: pointer; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; width: 100%; background: var(--surface-soft); display: grid; grid-template-columns: 1fr 120px; align-items: stretch; }
.promo-banner .pb-text { padding: 18px 20px; display: grid; gap: 4px; align-content: center; }
.promo-banner .pb-text b { font-family: var(--font-display); font-weight: 400; font-size: 18px; line-height: 1.2; }
.promo-banner .cover { aspect-ratio: auto; height: 100%; }

/* ---------- запись ---------- */
.salon-item { display: flex; gap: 14px; align-items: center; padding: 18px 20px; border-radius: var(--radius-md); background: var(--surface-soft); border: 0; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; transition: transform 300ms; }
.salon-item:active { transform: scale(0.98); }
.salon-item .grow b { font-family: var(--font-display); font-weight: 400; font-size: 18px; display: block; line-height: 1.25; }
.booking { position: fixed; inset: 0; z-index: 70; background: var(--surface); display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }
.booking .topbar { position: relative; }
.booking-frame { flex: 1; position: relative; }
.booking-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.booking-frame .loading { position: absolute; inset: 0; display: grid; place-items: center; background: var(--surface); }
.progress { height: 2px; background: var(--surface-soft); overflow: hidden; }
.progress i { display: block; height: 100%; width: 40%; background: var(--gold); animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }

/* ---------- менеджер ---------- */
.scanner { position: relative; border-radius: var(--radius-md); overflow: hidden; background: var(--ink-deep); aspect-ratio: 3 / 4; max-height: 56vh; width: 100%; }
.scanner video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scanner .frame { position: absolute; inset: 15% 12%; border-radius: 28px; box-shadow: 0 0 0 999px rgba(16,39,54,.45); border: 2px solid var(--gold); }
.scanner .scan-msg { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; color: #fff; font-size: 14px; padding: 0 20px; }
.scanner-off { aspect-ratio: auto; min-height: 260px; display: grid; place-items: center; color: #fff; text-align: center; padding: 30px; gap: 14px; }
.client-card { display: flex; gap: 16px; align-items: center; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--gloss), var(--sky); display: grid; place-items: center; font-family: var(--font-display); font-size: 20px; color: var(--ink-deep); flex: none; box-shadow: var(--shadow-button); }
.preview { background: #F6F0E6; border-radius: var(--radius-sm); padding: 14px 18px; font-size: 15px; color: var(--ink-deep); }
.preview b { font-size: 18px; }
.success { text-align: center; display: grid; gap: 16px; justify-items: center; padding-top: 30px; }
.success .ok { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--gloss), var(--gold); box-shadow: var(--shadow-button); color: var(--ink-deep); }
.success .ok .icon { width: 40px; height: 40px; stroke-width: 2; }
.success .big { font-family: var(--font-display); font-weight: 400; font-size: 30px; line-height: 1.15; }
.totals { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.totals > div { background: var(--surface-soft); border-radius: var(--radius-sm); padding: 14px 12px; text-align: center; }
.totals b { display: block; font-family: var(--font-display); font-weight: 400; font-size: 22px; color: var(--ink-deep); line-height: 1.1; }
.totals span { font-size: 12px; }
.offline-bar { background: var(--surface-neutral); color: var(--ink-deep); font-size: 13px; text-align: center; padding: 6px 12px; border-radius: var(--radius-pill); }
