:root {
  --bordo: #4E0000;
  --bordo-2: #841A08;
  --orange: #C23A0A;
  --green: #4A6642;
  --cream: #F5EFE6;
  --cream-2: #FEF7E6;
  --dark: #1D0601;
  --muted: #6b5a55;
  --line: #e4d9cc;
  --white: #fff;
  --new: #F2B544;
  --new-bg: #FDF0D3;
  --ok: #4A6642;
  --ok-bg: #E3EBDF;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--cream); color: var(--dark);
  font: 16px/1.5 "Montserrat", system-ui, sans-serif;
}
a { color: var(--bordo-2); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
.muted { color: var(--muted); font-size: 14px; }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* шапка */
.top { background: var(--bordo); color: var(--cream); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; flex-wrap: wrap; }
.top a { color: var(--cream); text-decoration: none; }
.brand { font-weight: 800; font-size: 18px; }
.top nav { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.top nav a.active { text-decoration: underline; text-underline-offset: 4px; }
.badge { background: var(--new); color: var(--dark); border-radius: 999px; padding: 0 8px; font-size: 12px; font-weight: 700; margin-left: 4px; }
.linkbtn { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

main { padding: 24px 0 48px; }

/* формы и кнопки */
.card { background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: 0 1px 3px rgba(29,6,1,.08); margin-bottom: 16px; }
label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 4px; }
input, select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 8px; background: var(--white); color: var(--dark);
}
input:not([type=checkbox]), select { height: 44px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 0; border-color: transparent; }
.row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.field { margin-bottom: 12px; }
.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.check input { width: auto; margin-top: 4px; }
.btn {
  display: inline-block; border: 0; border-radius: 8px; padding: 11px 20px; font: inherit; font-weight: 700;
  background: var(--orange); color: var(--white); cursor: pointer; text-decoration: none; text-align: center;
}
.btn:hover { background: var(--bordo-2); }
.btn.secondary { background: var(--cream); color: var(--dark); border: 1px solid var(--line); }
.btn.green { background: var(--green); }
.btn.danger { background: transparent; color: var(--bordo-2); border: 1px solid var(--bordo-2); }
.btn.small { padding: 6px 12px; font-size: 14px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hp { position: absolute; left: -9999px; }

.flash { background: var(--cream-2); border-left: 4px solid var(--orange); padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.errors { background: #fbe7e2; border-left: 4px solid var(--bordo-2); padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; }
.errors p { margin: 0; }

/* гостевой поиск */
.hero { background: var(--bordo); color: var(--cream); padding: 32px 0 80px; }
.hero h1 { color: var(--cream); }
.hero p { margin: 0; opacity: .85; }
.search-card { margin-top: -56px; }
.group-title { margin: 28px 0 12px; }
.room {
  display: grid; grid-template-columns: 1fr auto; gap: 12px 20px; align-items: center;
  background: var(--white); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 10px;
  box-shadow: 0 1px 3px rgba(29,6,1,.08);
}
.room h3 { font-size: 17px; margin: 0 0 2px; }
.room .price { font-size: 20px; font-weight: 800; white-space: nowrap; }
.room .right { text-align: right; }
@media (max-width: 560px) {
  .room { grid-template-columns: 1fr; }
  .room .right { text-align: left; display: flex; justify-content: space-between; align-items: center; }
}
.summary dt { font-size: 13px; color: var(--muted); }
.summary dd { margin: 0 0 10px; font-weight: 600; }
.calc { width: 100%; border-collapse: collapse; font-size: 14px; }
.calc td { padding: 6px 0; border-bottom: 1px solid var(--line); }
.calc td:last-child { text-align: right; white-space: nowrap; }
.calc tr.total td { font-weight: 800; font-size: 16px; border-bottom: 0; padding-top: 10px; }
.two { display: grid; grid-template-columns: 1fr 320px; gap: 16px; align-items: start; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } }

/* шахматка */
.chess-wrap { overflow-x: auto; background: var(--white); border-radius: var(--radius); box-shadow: 0 1px 3px rgba(29,6,1,.08); }
.chess { border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: fixed; width: max(100%, 1494px); }
.chess col.c-room { width: 150px; }
.chess th, .chess td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 0; height: 40px; }
.chess thead th { position: sticky; top: 0; background: var(--cream-2); font-weight: 600; text-align: center; line-height: 1.2; padding: 4px 2px; }
.chess thead th.we { background: #F6E3D6; }
.chess thead th.today { box-shadow: inset 0 -3px 0 var(--orange); }
.chess .room-name { position: sticky; left: 0; background: var(--white); z-index: 1; text-align: left; padding: 0 10px; white-space: nowrap; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.chess .room-name small { display: block; font-weight: 400; color: var(--muted); }
.chess thead .room-name { background: var(--cream-2); z-index: 2; }
.chess tr.cat td { background: var(--bordo); color: var(--cream); font-weight: 700; height: 30px; padding: 0 10px; position: sticky; left: 0; }
.chess td.free a { display: block; height: 100%; min-height: 39px; }
.chess td.free a:hover { background: var(--cream-2); }
.chess td.we { background: #FCF6F1; }
.chess td.bk { padding: 3px 2px; }
.bk a {
  display: block; height: 100%; min-height: 33px; border-radius: 6px; padding: 3px 8px; text-decoration: none;
  color: var(--dark); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.25;
}
.bk a small { display: block; font-size: 11px; color: var(--muted); }
.bk.confirmed a { background: var(--ok-bg); border-left: 4px solid var(--ok); }
.bk.new a { background: var(--new-bg); border-left: 4px solid var(--new); }
.bk.cut-l a { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bk.cut-r a { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13px; align-items: center; margin: 12px 0; }
.legend span[class^="l-"]::before { content: ""; display: inline-block; width: 14px; height: 14px; border-radius: 3px; vertical-align: -2px; margin-right: 6px; }
.legend .l-new::before { background: var(--new-bg); border-left: 4px solid var(--new); }
.legend .l-ok::before { background: var(--ok-bg); border-left: 4px solid var(--ok); }
.legend .l-we::before { background: #F6E3D6; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: space-between; margin-bottom: 12px; }
.toolbar form { display: flex; gap: 8px; align-items: center; }
.toolbar input { width: auto; padding: 6px 10px; }

/* таблицы в админке */
.list { width: 100%; border-collapse: collapse; font-size: 14px; }
.list th { text-align: left; font-size: 12px; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 2px solid var(--line); }
.list td { padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.status { display: inline-block; border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 700; }
.status.new { background: var(--new-bg); color: #7a5200; }
.status.confirmed { background: var(--ok-bg); color: var(--green); }
.status.cancelled { background: #eee; color: #666; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { padding: 6px 12px; border-radius: 999px; text-decoration: none; background: var(--white); color: var(--dark); font-size: 14px; }
.tabs a.active { background: var(--bordo); color: var(--cream); }
@media (max-width: 700px) {
  .list thead { display: none; }
  .list tr { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .list td { display: block; border: 0; padding: 2px 8px; }
}
.price-table input { width: 110px; }
footer { color: var(--muted); font-size: 13px; padding: 24px 0; }

/* поиск: даты с ценами «от» и гости */
.search-row { display: grid; gap: 12px; grid-template-columns: 1.4fr 1fr auto; align-items: end; }
@media (max-width: 700px) { .search-row { grid-template-columns: 1fr; } }
.picker { position: relative; }
.picker-btn {
  width: 100%; height: 44px; text-align: left; font: inherit; padding: 0 12px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--dark);
}
.picker-btn:focus-visible, .cal-day:focus-visible, .stepper button:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }
.pop {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20; background: var(--white);
  border-radius: var(--radius); box-shadow: 0 10px 30px rgba(29,6,1,.18); padding: 16px;
}
.cal-pop { width: min(380px, calc(100vw - 32px)); }
.guests-pop { width: min(320px, calc(100vw - 32px)); }
.cal-head { display: flex; justify-content: space-between; margin-bottom: -36px; position: relative; z-index: 1; pointer-events: none; }
.cal-nav { pointer-events: auto; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--bordo-2); width: 36px; height: 36px; border-radius: 8px; }
.cal-nav:disabled { color: var(--line); cursor: default; }
.cal-months { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.cal-title { text-align: center; font-weight: 700; height: 36px; line-height: 36px; margin-bottom: 6px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-wd { text-align: center; font-size: 12px; color: var(--muted); padding-bottom: 4px; }
.cal-wd.we { color: var(--orange); }
.cal-day {
  border: 0; background: var(--white); border-radius: 6px; padding: 5px 0; min-height: 46px; cursor: pointer;
  font: inherit; color: var(--dark); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15;
}
.cal-day b { font-size: 14px; }
.cal-day small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.cal-day:hover:not(:disabled) { outline: 1px solid var(--orange); }
.cal-day.we { background: #F6E3D6; }
.cal-day.we small { color: var(--bordo-2); font-weight: 600; }
.cal-day:disabled { color: #c9bdb4; cursor: default; }
.cal-day.full { color: #b3a79e; cursor: not-allowed; }
.cal-day.full b { text-decoration: line-through; }
.cal-day.range { background: var(--cream-2); }
.cal-day.sel { background: var(--bordo); color: var(--cream); }
.cal-day.sel small { color: var(--cream); }
.cal-foot { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; }
#cal-hint { font-weight: 700; margin-bottom: 2px; }
.we-dot { display: inline-block; width: 12px; height: 12px; border-radius: 3px; background: #F6E3D6; vertical-align: -1px; }
.stepper-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.stepper { display: flex; align-items: center; gap: 10px; }
.stepper span { min-width: 22px; text-align: center; font-weight: 700; font-size: 18px; }
.stepper button {
  width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--cream);
  font-size: 20px; cursor: pointer; color: var(--dark);
}
.stepper button:disabled { opacity: .35; cursor: default; }
#guests-max { margin: 0 0 12px; }

/* оплата */
.btn.blue { background: #2F5D8A; }
.btn.blue:hover { background: #244869; }
.status.pay-none { background: #eee; color: #666; }
.status.pay-part { background: var(--new-bg); color: #7a5200; }
.status.pay-paid { background: #DCE8F4; color: #244869; }
.bk.confirmed.paid a { background: #DCE8F4; border-left-color: #2F5D8A; }
.legend .l-paid::before { background: #DCE8F4; border-left: 4px solid #2F5D8A; }

/* питание и услуги */
.meals { max-width: 520px; margin-bottom: 8px; }
.meals th, .meals td { text-align: center; }
.meals th:first-child, .meals td:first-child { text-align: left; }
.meals input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--green); cursor: pointer; }
.svc { border-top: 1px solid var(--line); padding: 12px 0; }
.svc-fields { margin-top: 10px; }
.svc-line { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.svc-selects { display: flex; gap: 8px; }
.svc-selects select { width: 84px; }
.svc-selects label { font-weight: 400; font-size: 12px; color: var(--muted); }
.services-table input:not([type=checkbox]) { width: 100%; min-width: 80px; }
.services-table input[type=checkbox] { width: 20px; height: 20px; }
h3.sub { font-size: 16px; margin: 16px 0 6px; }

/* сводка и отчёт */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--white); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 1px 3px rgba(29,6,1,.08); }
.stat b { display: block; font-size: 24px; font-weight: 800; line-height: 1.2; }
.stat span { font-size: 13px; color: var(--muted); }
.toolbar label { font-weight: 400; }

/* 16.10.2026: корпоративы, партнёры */
.bk.corp a { background: #EDE4F3; border-left: 4px solid #6B3F8C; }
.bk.corp.paid a { background: #E2D4EE; }
.bk .tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 0 4px; border-radius: 3px; background: #2F5D8A; color: #fff; margin-right: 4px; vertical-align: 1px; }
.bk.corp .tag { background: #6B3F8C; }
.bk.busy a, .bk.busy span.cell { display: block; height: 100%; min-height: 33px; border-radius: 6px; background: #E9E4E1; color: var(--muted); padding: 3px 8px; font-size: 12px; }
.legend .l-corp::before { background: #EDE4F3; border-left: 4px solid #6B3F8C; }
.legend .l-partner::before { background: #2F5D8A; }
.legend .l-busy::before { background: #E9E4E1; }
.chess tr.events th.room-name { color: #6B3F8C; }
.chess tr.events td { padding: 3px 2px; vertical-align: top; }
.chess tr.events td a.ev { display: block; background: #EDE4F3; border-left: 4px solid #6B3F8C; border-radius: 6px; padding: 2px 6px; font-size: 11px; line-height: 1.25; text-decoration: none; color: var(--dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.chess tr.events td a.ev.new { border-left-color: var(--new); background: var(--new-bg); }
.chess tr.events td a.add-ev { display: block; min-height: 33px; }
.chess tr.events td a.add-ev:hover { background: var(--cream-2); }
.price-table input.small-num { width: 90px; }
