/* KKK.LASH Mini App — пастельная тема: бежевый, белый, светло-розовый */
:root {
  --bg: #faf5f0;          /* тёплый бежевый фон */
  --card: #ffffff;
  --accent: #d8a7a0;      /* пыльная роза */
  --accent-dark: #c08d86;
  --accent-soft: #f6e7e4; /* светло-розовый */
  --text: #5b4a48;
  --muted: #b3a09c;
  --free: #eef7f0;        /* мягкий зелёный для свободных дней */
  --free-text: #4c8a62;
  --radius: 18px;
  --shadow: 0 4px 14px rgba(190, 150, 145, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  max-width: 480px;
  margin: 0 auto;
  /* место под фиксированную нижнюю кнопку + safe-area iPhone */
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

/* ---------------------------------------------------------- шапка */
.brand { text-align: center; padding: 22px 16px 10px; }
.brand-name {
  font-size: 26px; font-weight: 700; letter-spacing: 3px; color: var(--accent-dark);
}
.brand-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* ---------------------------------------------------------- вкладки */
.tabs {
  display: flex; gap: 6px; padding: 8px 12px;
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  /* узкие экраны: горизонтальный скролл вместо переноса на новую строку */
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 1 0 auto;  /* не сжиматься ниже ширины текста — лучше скролл */
  border: none; background: transparent; color: var(--muted);
  font-size: 12.5px; padding: 9px 10px; border-radius: 999px; cursor: pointer;
  white-space: nowrap; transition: background 0.15s, color 0.15s;
}
.tab.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }

main { padding: 8px 14px; }
.tab-page { display: none; animation: fade 0.18s ease; }
.tab-page.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

/* ---------------------------------------------------------- карточки */
.card, .service-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px;
}
.cards { display: flex; flex-direction: column; gap: 12px; }
.service-card .name { font-size: 16px; font-weight: 600; }
.service-card .meta { font-size: 13px; color: var(--muted); margin: 4px 0 12px; }
.service-card .row {
  display: flex; justify-content: space-between; align-items: center;
}
.service-card .price { font-size: 17px; font-weight: 700; color: var(--accent-dark); }
.choose-btn {
  border: none; background: var(--accent); color: #fff; font-size: 14px;
  font-weight: 600; padding: 9px 20px; border-radius: 999px; cursor: pointer;
}
.choose-btn:active { background: var(--accent-dark); }

/* ---------------------------------------------------------- галерея */
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gallery .shot {
  background: var(--card); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
}
.gallery img { width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block; }
.gallery .caption { font-size: 12.5px; color: var(--text); padding: 8px 10px 10px; }
.gallery .caption:empty { display: none; }

/* ---------------------------------------------------------- о мастере */
.about-photo {
  width: 100%; border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 12px; display: block;
}
.about-text { font-size: 14.5px; line-height: 1.55; white-space: pre-line; }

/* ---------------------------------------------------------- запись */
.field-label {
  font-size: 13px; font-weight: 600; color: var(--muted);
  margin: 16px 4px 8px; text-transform: uppercase; letter-spacing: 0.6px;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chip {
  border: 1.5px solid var(--accent-soft); background: var(--card);
  color: var(--text); font-size: 13.5px; padding: 8px 14px;
  border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.chip.active {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 600;
}

.calendar-card { padding: 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-title { font-size: 15px; font-weight: 600; }
.cal-nav {
  border: none; background: var(--accent-soft); color: var(--accent-dark);
  width: 34px; height: 34px; border-radius: 50%; font-size: 18px; cursor: pointer;
}
.cal-nav:disabled { opacity: 0.35; cursor: default; }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar .dow { text-align: center; font-size: 11px; color: var(--muted); padding: 4px 0; }
.day {
  aspect-ratio: 1; display: flex; flex-direction: column; align-items: center;
  justify-content: center; border-radius: 12px; font-size: 14px;
  color: var(--muted); background: transparent; border: none;
}
.day.free { background: var(--free); color: var(--free-text); font-weight: 700; cursor: pointer; }
.day.free .cnt { font-size: 9.5px; font-weight: 400; }
.day.selected { outline: 2px solid var(--accent); background: var(--accent-soft); color: var(--accent-dark); }

.slots { display: flex; flex-wrap: wrap; gap: 8px; }
.slot {
  border: none; background: var(--free); color: var(--free-text);
  font-size: 15px; font-weight: 600; padding: 10px 16px;
  border-radius: 12px; cursor: pointer;
}
.slot.selected { background: var(--accent); color: #fff; }

.empty { color: var(--muted); font-size: 14px; padding: 8px 4px; }

/* ---------------------------------------------------------- нижняя кнопка */
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(250, 245, 240, 0.92);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.cta {
  display: block; width: 100%; max-width: 452px; margin: 0 auto;
  border: none; border-radius: 16px; padding: 15px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; box-shadow: var(--shadow);
}
.cta:active { background: var(--accent-dark); }
.cta:disabled {
  background: var(--accent-soft); color: var(--accent-dark);
  cursor: default; box-shadow: none;
}
.cta.hint { background: var(--accent-soft); color: var(--accent-dark); }

.cal-hint { font-size: 12px; color: var(--muted); margin-top: 10px; text-align: center; }

/* ---------------------------------------------------------- экран успеха */
.success-screen {
  text-align: center; padding: 64px 24px;
  animation: fade 0.25s ease;
}
.success-emoji { font-size: 52px; margin-bottom: 12px; }
.success-title { font-size: 20px; font-weight: 700; color: var(--accent-dark); }
.success-text {
  font-size: 14.5px; color: var(--muted); margin-top: 8px;
  white-space: pre-line; line-height: 1.5;
}
.success-fallback {
  margin-top: 18px; border: none; background: var(--accent-soft);
  color: var(--accent-dark); font-size: 13.5px; font-weight: 600;
  padding: 10px 18px; border-radius: 999px; cursor: pointer;
}

/* ---------------------------------------------------------- тост-подсказка */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 30;
  background: var(--text); color: #fff; font-size: 13.5px;
  padding: 10px 18px; border-radius: 999px; box-shadow: var(--shadow);
}
/* !important обязателен: .modal ниже по файлу задаёт display:flex с той
   же специфичностью и без него перекрывает display:none — модалки
   («Ручная запись» и др.) становились видны всем, включая клиентов */
.hidden { display: none !important; }
.tab[hidden] { display: none; }

/* ---------------------------------------------------------- админка */
.subnav {
  display: flex; gap: 6px; margin-bottom: 12px;
  overflow-x: auto; scrollbar-width: none;
}
.subnav::-webkit-scrollbar { display: none; }
.subtab {
  flex: 1 0 auto; border: 1.5px solid var(--accent-soft); background: var(--card);
  color: var(--muted); font-size: 12.5px; padding: 8px 10px;
  border-radius: 999px; cursor: pointer; white-space: nowrap;
}
.subtab.active {
  background: var(--accent); border-color: var(--accent);
  color: #fff; font-weight: 600;
}
.sub-page { display: none; }
.sub-page.active { display: block; }

.day.has-appts { background: var(--accent-soft); color: var(--accent-dark); font-weight: 700; cursor: pointer; }
.day.has-appts .cnt { font-size: 9.5px; font-weight: 400; }
.day.filtered { outline: 2px solid var(--accent); }

.adm-date {
  font-size: 13px; font-weight: 700; color: var(--accent-dark);
  margin: 14px 4px 6px;
}
.adm-appt { margin-bottom: 8px; padding: 12px 14px; }
.cl-row { cursor: pointer; }
.adm-line { font-size: 14px; }
.adm-status { font-size: 12px; color: var(--muted); margin-top: 2px; }
.adm-actions { display: flex; gap: 8px; margin-top: 8px; }
.mini-btn {
  border: none; border-radius: 999px; padding: 7px 14px;
  font-size: 13px; font-weight: 600; cursor: pointer;
}
.mini-btn.ok { background: var(--free); color: var(--free-text); }
.mini-btn.no { background: #fbeaea; color: #b0564d; }

.cta-secondary {
  background: var(--accent-soft); color: var(--accent-dark);
  margin: 12px 0; box-shadow: none;
}
.cta-secondary:active { background: #f0dcd8; }

.modal {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(60, 40, 40, 0.35);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-card {
  background: var(--bg); border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.input {
  width: 100%; border: 1.5px solid var(--accent-soft); border-radius: 12px;
  padding: 12px 14px; font-size: 15px; margin-bottom: 10px;
  background: var(--card); color: var(--text);
}
.modal-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.modal-actions .cta { padding: 13px; }
.modal-actions .cta-secondary { margin: 0; }
