/* Добро.Пространства — стиль по образцу dobro.ru */

:root {
  --orange: #ff5e00;
  --orange-hover: #e65500;
  --orange-light: #ff8742;
  --purple: #550577;
  --purple-light: #a764ff;
  --bg-lilac: #f3eef6;
  --ink: #09090b;
  --gray: #6b6b76;
  --line: #e7e2ec;
  --white: #fff;
  --radius: 20px;
  --shadow: 0 4px 24px rgba(85, 5, 119, .08);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Golos Text', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* ---------- Шапка ---------- */

.header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 28px;
  height: 68px;
}
.logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; letter-spacing: -.02em; }
.logo-mark {
  width: 36px; height: 36px; border-radius: 10px;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  display: grid; place-items: center; color: #fff; font-size: 19px;
}
.logo b { color: var(--purple); }
.logo span { color: var(--orange); }

.nav { display: flex; gap: 22px; font-size: 15px; font-weight: 500; color: #3c3c46; }
.nav a:hover { color: var(--orange); }
.header-spacer { flex: 1; }
.header-auth { display: flex; align-items: center; gap: 12px; }
.header-user { font-size: 14px; font-weight: 600; color: var(--purple); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Бургер и мобильное меню */
.burger { display: none; background: none; border: none; color: var(--purple); padding: 6px; }
.mobile-menu {
  border-top: 1px solid var(--line);
  background: var(--white);
  padding: 14px 20px 18px;
}
.mobile-menu nav { display: flex; flex-direction: column; gap: 4px; }
.mobile-menu nav a { padding: 11px 4px; font-weight: 600; font-size: 16px; border-bottom: 1px solid var(--line); }
.mobile-menu-auth { display: flex; align-items: center; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: none; border-radius: 999px;
  padding: 12px 26px;
  font-size: 15px; font-weight: 600;
  transition: .15s;
  white-space: nowrap;
}
.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: var(--orange-hover); }
.btn-outline { background: transparent; color: var(--purple); border: 2px solid var(--purple); padding: 10px 24px; }
.btn-outline:hover { background: var(--purple); color: #fff; }
.btn-ghost { background: var(--bg-lilac); color: var(--purple); }
.btn-ghost:hover { background: #e9e0f0; }
.btn-sm { padding: 8px 18px; font-size: 14px; }
.btn-danger { background: #fdecec; color: #c51212; }
.btn-danger:hover { background: #f8d7d7; }
.btn-success { background: #e8f7ef; color: #0f7b43; }
.btn-success:hover { background: #d3efdf; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* ---------- Хиро ---------- */

.hero {
  background: linear-gradient(160deg, var(--purple) 0%, #7a1ba8 60%, var(--purple-light) 130%);
  color: #fff;
  padding: 72px 0 88px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; right: -120px; top: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 94, 0, .35), transparent 65%);
}
.hero-badge {
  display: inline-block; background: rgba(255, 255, 255, .14);
  border-radius: 999px; padding: 7px 18px;
  font-size: 14px; font-weight: 600; margin-bottom: 22px;
}
.hero h1 {
  font-size: clamp(32px, 5vw, 54px);
  font-weight: 800; line-height: 1.12; letter-spacing: -.02em;
  max-width: 780px;
}
.hero h1 em { font-style: normal; color: #ffbd66; }
.hero p { margin-top: 18px; font-size: 18px; max-width: 620px; color: rgba(255, 255, 255, .85); }
.hero-actions { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero .btn-outline { border-color: #fff; color: #fff; }
.hero .btn-outline:hover { background: #fff; color: var(--purple); }
.hero-stats { display: flex; gap: 44px; margin-top: 48px; flex-wrap: wrap; }
.hero-stat b { display: block; font-size: 32px; font-weight: 800; }
.hero-stat span { font-size: 14px; color: rgba(255, 255, 255, .75); }

/* ---------- Фильтры ---------- */

.filters {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: grid;
  grid-template-columns: 2fr 1.4fr 1.2fr 1.1fr .7fr .7fr auto;
  gap: 10px;
  margin-top: -42px;
  position: relative; z-index: 5;
}
@media (max-width: 1100px) and (min-width: 861px) {
  .filters { grid-template-columns: repeat(3, 1fr); }
}
.filters input, .filters select {
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 12px 16px; width: 100%; background: #fff;
  outline: none;
}
.filters input:focus, .filters select:focus { border-color: var(--purple-light); }

/* ---------- Секции ---------- */

.section { padding: 56px 0; }
.section-lilac { background: var(--bg-lilac); }
.section-title { font-size: clamp(24px, 3vw, 34px); font-weight: 800; color: var(--purple); letter-spacing: -.02em; }
.section-sub { color: var(--gray); margin-top: 8px; font-size: 16px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }

/* ---------- Карточки помещений ---------- */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 24px; }

.card {
  background: #fff; border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(85, 5, 119, .14); }
.card-photo { position: relative; aspect-ratio: 16 / 10; background: linear-gradient(135deg, var(--bg-lilac), #e5d9f0); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; }
.card-photo .no-photo { position: absolute; inset: 0; display: grid; place-items: center; color: var(--purple-light); font-size: 44px; }
.card-cap {
  position: absolute; left: 12px; bottom: 12px;
  background: rgba(255, 255, 255, .95); color: var(--purple);
  border-radius: 999px; padding: 5px 14px; font-size: 13px; font-weight: 700;
}
.card-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.card-inst { font-size: 13.5px; color: var(--gray); display: flex; align-items: center; gap: 6px; }
.card-desc { font-size: 14px; color: #4a4a55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 12px; }

.ico { vertical-align: -0.15em; flex-shrink: 0; }
.card-inst .ico, .tag .ico, .list-meta .ico { margin-right: 4px; }

.tag {
  display: inline-block; background: var(--bg-lilac); color: var(--purple);
  border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 600;
}

/* ---------- Как это работает ---------- */

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 24px; }
.step { background: #fff; border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow); }
.step-num {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--orange), var(--orange-light));
  color: #fff; font-weight: 800; font-size: 19px;
  display: grid; place-items: center; margin-bottom: 16px;
}
.step h3 { font-size: 17px; margin-bottom: 8px; color: var(--purple); }
.step p { font-size: 14px; color: var(--gray); }

/* ---------- Страница помещения ---------- */

.breadcrumbs { padding: 20px 0 0; font-size: 14px; color: var(--gray); }
.breadcrumbs a:hover { color: var(--orange); }

.space-layout { display: grid; grid-template-columns: 1fr 400px; gap: 32px; align-items: start; padding: 24px 0 64px; }
@media (max-width: 900px) { .space-layout { grid-template-columns: 1fr; } }

.gallery-main {
  border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 16 / 9; background: var(--bg-lilac);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumbs img {
  width: 96px; height: 64px; object-fit: cover; border-radius: 10px;
  cursor: pointer; opacity: .65; transition: .15s; border: 2px solid transparent; flex-shrink: 0;
}
.gallery-thumbs img.active, .gallery-thumbs img:hover { opacity: 1; border-color: var(--orange); }

.space-info h1 { font-size: clamp(26px, 3vw, 36px); color: var(--purple); font-weight: 800; letter-spacing: -.02em; margin-top: 20px; }
.space-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.space-desc { margin-top: 18px; font-size: 16px; color: #33333c; max-width: 720px; }
.equip { margin-top: 22px; }
.equip h3 { font-size: 18px; color: var(--purple); margin-bottom: 12px; }
.equip-list { display: flex; flex-wrap: wrap; gap: 8px; }

.book-panel {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px; position: sticky; top: 88px;
}

/* Лента дат (2 недели вперёд) */
.date-strip {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px;
  scrollbar-width: thin;
}
.date-chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 14px;
  padding: 8px 4px; min-width: 56px; text-align: center; cursor: pointer;
  flex-shrink: 0; transition: .12s;
}
.date-chip small { display: block; font-size: 11px; color: var(--gray); text-transform: uppercase; letter-spacing: .04em; }
.date-chip b { display: block; font-size: 17px; margin: 1px 0; }
.date-chip span { display: block; font-size: 11px; color: var(--gray); }
.date-chip:hover { border-color: var(--purple-light); }
.date-chip.active { background: var(--purple); border-color: var(--purple); }
.date-chip.active small, .date-chip.active b, .date-chip.active span { color: #fff; }

/* Чипсы мест */
.unit-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.unit-chip {
  border: 1.5px solid var(--line); background: #fff; border-radius: 999px;
  padding: 7px 15px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: .12s;
}
.unit-chip:hover { border-color: var(--purple-light); }
.unit-chip.active { background: var(--purple); border-color: var(--purple); color: #fff; }

/* Сетка получасовых слотов */
.slot-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.slot {
  border: 1.5px solid var(--line); background: #fff; border-radius: 10px;
  padding: 8px 2px; font-size: 13px; font-weight: 600; text-align: center;
  cursor: pointer; transition: .1s; font-variant-numeric: tabular-nums;
}
.slot:hover { border-color: var(--orange); }
.slot.busy {
  background: #f4f4f6; color: #b9b9c2; border-color: transparent;
  cursor: not-allowed; text-decoration: line-through;
}
.slot.sel { background: var(--orange); border-color: var(--orange); color: #fff; }
.slot.sel-edge { background: var(--orange-hover); }
.slot-legend { display: flex; gap: 14px; font-size: 12px; color: var(--gray); margin-top: 8px; }
.slot-legend i { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -1px; }

/* Сводка брони */
.book-summary {
  background: var(--bg-lilac); border-radius: 12px; padding: 12px 16px;
  font-size: 14px; color: var(--purple); margin: 14px 0; line-height: 1.6;
}
.book-summary b { font-weight: 700; }

/* Успешная отправка */
.book-success { text-align: center; padding: 12px 0; }
.book-success .ok-circle {
  width: 64px; height: 64px; border-radius: 50%; background: #e8f7ef; color: #0f7b43;
  display: grid; place-items: center; margin: 0 auto 14px;
}
.book-success h3 { color: var(--purple); margin-bottom: 8px; }
.book-success p { color: var(--gray); font-size: 14.5px; margin-bottom: 16px; }
.book-panel h3 { color: var(--purple); font-size: 20px; margin-bottom: 4px; }
.book-panel .hint { font-size: 13.5px; color: var(--gray); margin-bottom: 16px; }
.form-row { margin-bottom: 14px; }
.form-row label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 6px; color: #3c3c46; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 14px; outline: none; background: #fff;
}
.form-row input:focus, .form-row select:focus, .form-row textarea:focus { border-color: var(--purple-light); }
.form-2col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.busy-list { margin-top: 16px; font-size: 13.5px; }
.busy-list h4 { font-size: 14px; color: var(--purple); margin-bottom: 8px; }
.busy-item { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line); color: var(--gray); }

/* ---------- Формы авторизации ---------- */

.auth-wrap { max-width: 460px; margin: 48px auto 80px; }
.auth-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 34px; }
.auth-card h1 { color: var(--purple); font-size: 26px; margin-bottom: 6px; }
.auth-card .sub { color: var(--gray); font-size: 14.5px; margin-bottom: 22px; }
.auth-alt { text-align: center; margin-top: 18px; font-size: 14.5px; color: var(--gray); }
.auth-alt a { color: var(--orange); font-weight: 600; }
.demo-note { margin-top: 16px; background: var(--bg-lilac); border-radius: 12px; padding: 12px 14px; font-size: 13px; color: var(--purple); }

/* ---------- Статусы ---------- */

.status { display: inline-block; border-radius: 999px; padding: 4px 12px; font-size: 12.5px; font-weight: 700; }
.status-pending { background: #fff3e6; color: #b25000; }
.status-approved { background: #e8f7ef; color: #0f7b43; }
.status-rejected { background: #fdecec; color: #c51212; }
.status-cancelled { background: #eee; color: #666; }

/* ---------- Таблицы / списки ---------- */

.list-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 22px; margin-bottom: 14px; }
.list-head { display: flex; justify-content: space-between; align-items: start; gap: 14px; flex-wrap: wrap; }
.list-title { font-weight: 700; font-size: 17px; }
.list-meta { font-size: 14px; color: var(--gray); margin-top: 4px; }
.list-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.comment-box { margin-top: 10px; font-size: 14px; background: var(--bg-lilac); border-radius: 10px; padding: 10px 14px; color: var(--purple); }

/* ---------- Админка ---------- */

.admin-layout { display: grid; grid-template-columns: 230px 1fr; gap: 28px; padding: 32px 0 64px; align-items: start; }
@media (max-width: 800px) { .admin-layout { grid-template-columns: 1fr; } }
.admin-nav { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px; position: sticky; top: 88px; }
.admin-nav button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 11px 14px; border-radius: 12px; font-size: 15px; font-weight: 600; color: #3c3c46;
}
.admin-nav button:hover { background: var(--bg-lilac); }
.admin-nav button.active { background: var(--purple); color: #fff; }

.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; margin-bottom: 28px; }
.stat-tile { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.stat-tile b { display: block; font-size: 30px; font-weight: 800; color: var(--purple); }
.stat-tile span { font-size: 13.5px; color: var(--gray); }
.stat-tile.accent b { color: var(--orange); }

.pill-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.pill-tabs button {
  border: none; background: #fff; box-shadow: var(--shadow);
  border-radius: 999px; padding: 8px 18px; font-size: 14px; font-weight: 600; color: #3c3c46;
}
.pill-tabs button.active { background: var(--orange); color: #fff; }

.photo-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.photo-thumb { position: relative; }
.photo-thumb img { width: 84px; height: 56px; object-fit: cover; border-radius: 8px; }
.photo-thumb button {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px;
  border-radius: 50%; border: none; background: #c51212; color: #fff; font-size: 11px; line-height: 1;
}

.modal-back {
  position: fixed; inset: 0; background: rgba(9, 9, 11, .5); z-index: 200;
  display: grid; place-items: center; padding: 20px;
}
.modal {
  background: #fff; border-radius: var(--radius); padding: 28px;
  width: 100%; max-width: 620px; max-height: 90vh; overflow-y: auto;
}
.modal h3 { color: var(--purple); margin-bottom: 18px; font-size: 20px; }

/* ---------- Футер ---------- */

.footer { background: var(--purple); color: rgba(255, 255, 255, .85); padding: 44px 0 28px; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer .logo b, .footer .logo span { color: #fff; }
.footer-note { font-size: 13.5px; margin-top: 10px; max-width: 420px; color: rgba(255, 255, 255, .65); }
.footer-links { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-links a:hover { color: var(--orange-light); }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .15); margin-top: 28px; padding-top: 18px; font-size: 13px; color: rgba(255, 255, 255, .55); }

/* ---------- Утилиты ---------- */

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border-radius: 999px;
  padding: 12px 24px; font-size: 14.5px; z-index: 300;
  box-shadow: 0 8px 30px rgba(0, 0, 0, .25);
}
.toast.error { background: #c51212; }
.toast.success { background: #0f7b43; }
.empty { text-align: center; color: var(--gray); padding: 48px 0; font-size: 15.5px; }
.error-text { color: #c51212; font-size: 14px; margin-top: 8px; min-height: 18px; }

@media (max-width: 860px) {
  .nav, .header-auth { display: none; }
  .burger { display: block; }
  .filters { grid-template-columns: 1fr; margin-top: -30px; }
  .hero { padding: 44px 0 60px; }
  .hero-stats { gap: 24px; margin-top: 36px; }
  .hero-stat b { font-size: 26px; }
  .section { padding: 40px 0; }
  .section-head { flex-direction: column; align-items: start; }
  .book-panel { position: static; padding: 20px; }
  .space-layout { padding-bottom: 40px; gap: 20px; }
  .admin-nav { position: static; display: flex; overflow-x: auto; gap: 4px; padding: 8px; }
  .admin-nav button { white-space: nowrap; width: auto; flex-shrink: 0; }
  .list-head { flex-direction: column; }
  .list-head > .status { order: -1; }
  .footer-inner { flex-direction: column; }
  .modal { padding: 20px; }
  .auth-wrap { margin: 24px auto 48px; }
  .auth-card { padding: 24px; }
}
