/* Oktis — дизайн-система «фарфор и слива» */
:root {
  --bg: #F6F1EE;
  --card: #FFFFFF;
  --ink: #221A20;
  --ink-soft: #4A3F46;
  --muted: #8E8189;
  --line: #E8DFDA;
  --accent: #A85C68;
  --accent-ink: #8C4753;
  --accent-soft: #F3E4E6;
  --base: #221A20;          /* базовая поверхность: основные кнопки, выбранные чипы/даты */
  --on-base: #FFFFFF;       /* текст на --base */
  --on-accent: #FFFFFF;     /* текст на --accent */
  --gold: #B99C6B;
  --gold-soft: #F1E9DB;
  --ok: #5B8A5E;
  --danger: #B0524B;
  --r: 18px;
  --shadow: 0 1px 2px rgba(34,26,32,.05), 0 8px 24px rgba(34,26,32,.07);
  --font-ui: 'Manrope', system-ui, -apple-system, sans-serif;
  --font-display: 'Cormorant Garamond', serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: var(--font-ui);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  line-height: 1.45;
  overscroll-behavior-y: none;
}
h1, h2, .display { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; }
button { font-family: var(--font-ui); border: 0; cursor: pointer; background: none; color: inherit; }
input, select, textarea {
  font-family: var(--font-ui); font-size: 1rem; color: var(--ink);
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; width: 100%; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
label { display: block; font-size: .8rem; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }

.screen { display: none; padding: 16px 16px 96px; max-width: 560px; margin: 0 auto; }
.screen.active { display: block; animation: rise .28s ease; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

.card {
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 12px;
}
.row { display: flex; align-items: center; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); font-size: .85rem; }
.small { font-size: .8rem; }

.btn {
  display: block; width: 100%; text-align: center; padding: 15px;
  border-radius: 14px; font-weight: 700; font-size: 1rem;
  background: var(--base); color: var(--on-base); transition: transform .12s ease, opacity .2s;
}
.btn:active { transform: scale(.98); }
.btn.accent { background: var(--accent); color: var(--on-accent); }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
.btn:disabled { opacity: .4; }
.btn.inline { display: inline-block; width: auto; padding: 10px 18px; font-size: .9rem; }

.chip {
  display: inline-block; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card);
  font-size: .85rem; font-weight: 600; color: var(--ink-soft);
}
.chip.on { background: var(--base); color: var(--on-base); border-color: var(--base); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }

.monogram {
  width: 56px; height: 56px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-ink) 100%);
  color: var(--on-accent); display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 1.7rem; font-weight: 600;
}
.monogram.gold { background: linear-gradient(135deg, var(--gold) 0%, #9A7F4E 100%); }

.stars { color: var(--gold); letter-spacing: 2px; }

.seg { display: flex; background: #ECE3DE; border-radius: 12px; padding: 3px; margin-bottom: 14px; }
.seg button {
  flex: 1; padding: 9px 4px; border-radius: 10px; font-weight: 700; font-size: .85rem;
  color: var(--muted);
}
.seg button.on { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }

/* слоты времени */
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.slot {
  padding: 11px 0; text-align: center; border-radius: 12px; font-weight: 700;
  border: 1px solid var(--line); background: var(--card); font-size: .95rem;
  font-variant-numeric: tabular-nums; transition: all .15s ease;
}
.slot.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); transform: scale(1.05); }

/* календарная лента */
.datestrip { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
.datestrip::-webkit-scrollbar { display: none; }
.datecell {
  flex: none; width: 52px; padding: 9px 0 7px; text-align: center; border-radius: 14px;
  border: 1px solid var(--line); background: var(--card);
}
.datecell .dw { font-size: .65rem; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.datecell .dn { font-size: 1.15rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.datecell.off { opacity: .35; }
.datecell.on { background: var(--base); border-color: var(--base); }
.datecell.on .dw, .datecell.on .dn { color: var(--on-base); }

/* билет — сигнатурный элемент */
.ticket { position: relative; margin: 24px 0; filter: drop-shadow(0 12px 24px rgba(34,26,32,.12)); }
.ticket-body {
  background: var(--card); border-radius: var(--r) var(--r) 0 0; padding: 26px 22px 20px;
  text-align: center;
}
.ticket-stub {
  background: var(--card); border-radius: 0 0 var(--r) var(--r); padding: 16px 22px 20px;
  text-align: center; position: relative;
}
.ticket-stub::before {
  content: ""; position: absolute; left: 14px; right: 14px; top: -1px;
  border-top: 2px dashed var(--line);
}
.ticket-notch-l, .ticket-notch-r {
  position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--bg);
  top: 50%;
}
.ticket-notch-l { left: -11px; } .ticket-notch-r { right: -11px; }

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem;
  font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
.badge.gold { background: var(--gold-soft); color: #8A6F3E; }
.badge.rose { background: var(--accent-soft); color: var(--accent-ink); }
.badge.ok { background: #E4EEE4; color: var(--ok); }
.badge.gray { background: #EEE9E6; color: var(--muted); }
.badge.red { background: #F6E4E2; color: var(--danger); }

/* нижняя навигация (админка) */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: flex; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabbar button {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; color: var(--muted); font-size: .62rem; font-weight: 700;
}
.tabbar button .ic { font-size: 1.25rem; line-height: 1; }
.tabbar button.on { color: var(--accent-ink); }

/* модальные листы */
.sheet-back {
  position: fixed; inset: 0; background: rgba(34,26,32,.45); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.sheet-back.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 100;
  background: var(--bg); border-radius: 22px 22px 0 0;
  padding: 10px 18px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(105%); transition: transform .28s cubic-bezier(.32,.72,.33,1);
  max-height: 88vh; overflow-y: auto;
}
.sheet { visibility: hidden; transition: transform .28s cubic-bezier(.32,.72,.33,1), visibility 0s .28s; }
.sheet.open { transform: none; visibility: visible; transition-delay: 0s; }
.sheet .grip { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 4px auto 12px; }
.sheet h2 { font-size: 1.5rem; margin-bottom: 12px; }

.list-item {
  display: flex; align-items: center; gap: 12px; padding: 13px 2px;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; }

.empty { text-align: center; color: var(--muted); padding: 42px 20px; }
.empty .display { font-size: 1.5rem; color: var(--ink-soft); margin-bottom: 6px; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: 11px 20px; border-radius: 999px;
  font-size: .9rem; font-weight: 600; opacity: 0; transition: all .25s; z-index: 200;
  pointer-events: none; white-space: normal; max-width: 92vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%); }

.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { display: none; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px; background: #DDD3CD;
  transition: background .2s; display: block;
}
.switch i::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s;
}
.switch input:checked + i { background: var(--ok); }
.switch input:checked + i::after { transform: translateX(18px); }

.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 14px; }
.stat .v { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .l { font-size: .74rem; color: var(--muted); font-weight: 600; }

.hairline { display: flex; align-items: center; gap: 12px; margin: 20px 0 10px; }
.hairline::before, .hairline::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
.hairline span { font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

.price { font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.stat .v { font-size: clamp(1.05rem, 5.5vw, 1.55rem); overflow-wrap: anywhere; }
