/* Консоль: одна таблица стилей, без сборки. Правила -- docs/console.md, «Облик». */

:root {
  --c-bg: #f4f5f9;
  --c-surface: #ffffff;
  --c-surface-2: #f7f8fb;
  --c-ink: #14161f;
  --c-ink-2: #3b4152;
  /* Приглушённый текст: не ниже 4,5:1 на всех светлых фонах консоли (было 4,35:1 на фоне страницы). */
  --c-muted: #626a7d;
  --c-line: #e3e6ee;
  --c-line-2: #cfd4e0;
  /* Основной цвет -- синий знака «BE» (#1e3a8a), чуть светлее для ссылок и кнопок (У3). */
  --c-accent: #1d4ed8;
  --c-accent-ink: #ffffff;
  --c-accent-soft: #e8efff;
  --c-ok: #0f766e;
  --c-ok-soft: #e6f6f3;
  --c-warn: #b45309;
  --c-warn-soft: #fff4e0;
  --c-error: #b91c1c;
  --c-error-soft: #fdecec;
  --c-error-ink: #ffffff;
  --shadow: 0 1px 2px rgba(20, 22, 31, .06), 0 4px 16px rgba(20, 22, 31, .05);
  --radius: 12px;
  --radius-s: 8px;
  --nav-w: 236px;
  --top-h: 52px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --c-bg: #0f1117;
    --c-surface: #171a23;
    --c-surface-2: #1d212c;
    --c-ink: #eceef4;
    --c-ink-2: #c5c9d6;
    --c-muted: #8b91a3;
    --c-line: #262b38;
    --c-line-2: #343a4a;
    --c-accent: #6ea8fe;
    --c-accent-ink: #0f1117;
    --c-accent-soft: #172554;
    --c-ok: #4fd1c5;
    --c-ok-soft: #12302f;
    --c-warn: #f6ad55;
    --c-warn-soft: #3a2a12;
    --c-error: #fc8181;
    --c-error-soft: #3b1a1a;
    --c-error-ink: #0f1117;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 16px rgba(0, 0, 0, .3);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.console {
  margin: 0; min-height: 100vh;
  font: 14.5px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--c-ink); background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--c-accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code { font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--c-surface-2); padding: 1px 6px; border-radius: 5px; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; border-radius: 4px; }

/* --- шапка ------------------------------------------------------------------- */
.console-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 14px; height: var(--top-h); padding: 0 20px;
  background: var(--c-surface); border-bottom: 1px solid var(--c-line);
}
/* Бренд шириной с боковое меню (владелец 2026-09-28): переключатель отелей
   начинается ровно над границей меню. 38px = отступ шапки 20 + промежуток 14 + отступ переключателя 4. */
.console-brand { display: inline-flex; align-items: center; gap: 9px; flex: none; width: calc(var(--nav-w) - 38px); font-weight: 700; letter-spacing: -.01em; color: var(--c-ink); }
.console-brand:hover { text-decoration: none; }
/* Знак продукта «BE» (владелец 2026-09-28): белая плашка -- читается и в тёмной теме. */
.console-brand .logo { width: 26px; height: 26px; border-radius: 7px; display: inline-block; background: #fff; box-shadow: 0 0 0 1px var(--c-line); }
.console-hotel { display: inline-flex; align-items: center; gap: 8px; padding-left: 14px; border-left: 1px solid var(--c-line); color: var(--c-ink-2); font-weight: 600; }
/* Меню учётной записи (У3): плашка «инициалы + имя + роль», по нажатию -- карточка действий. */
.account-menu { position: relative; margin-left: auto; }
.account-menu > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 4px 10px 4px 4px; border: 1px solid var(--c-line); border-radius: 999px; background: var(--c-surface);
}
.account-menu > summary::-webkit-details-marker { display: none; }
.account-menu > summary:hover, .account-menu[open] > summary { background: var(--c-surface-2); border-color: var(--c-line-2); }
.avatar {
  flex: 0 0 32px; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-accent); color: var(--c-accent-ink); font-size: 12.5px; font-weight: 700; letter-spacing: .02em;
}
img.avatar { object-fit: cover; background: var(--c-surface-2); }
.avatar-sm { flex-basis: 24px; width: 24px; height: 24px; font-size: 10px; }
.avatar-lg { flex-basis: 96px; width: 96px; height: 96px; font-size: 32px; }
.who { display: inline-flex; align-items: center; gap: 8px; }
.account-who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.account-name { font-size: 13.5px; font-weight: 600; color: var(--c-ink); max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-role { font-size: 12px; color: var(--c-muted); }
.account-caret { width: 16px; height: 16px; fill: none; stroke: var(--c-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.account-menu[open] .account-caret { transform: rotate(180deg); }
.account-pop {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 50; width: 264px; padding: 6px;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(20, 22, 31, .14), 0 2px 6px rgba(20, 22, 31, .06);
}
.account-head { display: grid; gap: 2px; padding: 10px 10px 12px; margin-bottom: 4px; border-bottom: 1px solid var(--c-line); font-size: 12.5px; color: var(--c-muted); }
.account-head strong { font-size: 14px; color: var(--c-ink); overflow-wrap: anywhere; }
.account-head span { overflow-wrap: anywhere; }
.account-pop a, .account-pop button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 8px 10px; border: 0; border-radius: var(--radius-s);
  background: none; color: var(--c-ink-2); font: inherit; font-size: 14px; text-align: left; cursor: pointer; text-decoration: none;
}
.account-pop a:hover, .account-pop button:hover { background: var(--c-surface-2); color: var(--c-ink); text-decoration: none; }
.account-pop form { margin: 4px 0 0; padding-top: 4px; border-top: 1px solid var(--c-line); }
.account-pop button { color: var(--c-error); }
.account-pop svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* --- каркас ------------------------------------------------------------------- */
.console-body { display: flex; min-height: calc(100vh - var(--top-h)); }
.console-nav {
  width: var(--nav-w); flex: none; padding: 18px 12px 24px;
  background: var(--c-surface); border-right: 1px solid var(--c-line);
  position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto;
}
.console-nav .nav-all > summary { display: none; }
.console-nav ul { list-style: none; margin: 0; padding: 0; }
.nav-group { margin: 0 0 16px; }
.nav-group-title { margin: 0 0 6px; padding: 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); }
/* Категория меню сворачивается (владелец 2026-10-05): заголовок -- кнопка со стрелкой. */
details.nav-group > summary.nav-group-title {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 6px 10px; border-radius: var(--radius-s); cursor: pointer; list-style: none; user-select: none;
}
details.nav-group > summary.nav-group-title::-webkit-details-marker { display: none; }
details.nav-group > summary.nav-group-title::after {
  content: ""; width: 7px; height: 7px; flex: none; margin-right: 2px;
  border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor;
  transform: rotate(45deg) translateY(-2px); transition: transform .15s ease;
}
details.nav-group:not([open]) > summary.nav-group-title::after { transform: rotate(-45deg); }
details.nav-group > summary.nav-group-title:hover { background: var(--c-surface-2); color: var(--c-ink-2); }
details.nav-group > summary.nav-group-title:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 1px; }
details.nav-group:not([open]) { margin-bottom: 6px; }
@media (prefers-reduced-motion: reduce) {
  details.nav-group > summary.nav-group-title::after { transition: none; }
}
.console-nav a, .console-nav .soon {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-s);
  color: var(--c-ink-2); text-decoration: none; font-weight: 500;
}
.console-nav a:hover { background: var(--c-surface-2); text-decoration: none; color: var(--c-ink); }
.console-nav a.active { background: var(--c-accent-soft); color: var(--c-accent); font-weight: 600; }
.console-nav a.active::before { content: ""; width: 3px; height: 16px; border-radius: 3px; background: var(--c-accent); margin-left: -10px; }
.console-nav .soon { color: var(--c-muted); }
/* Рабочая область -- на всю ширину окна (владелец 2026-09-28). */
.console-main { flex: 1; min-width: 0; padding: 28px 36px 48px; }

h1 { font-size: 22px; font-weight: 700; letter-spacing: -.015em; margin: 0 0 18px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
h1 code { font-size: 18px; }
h2 { font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); margin: 0 0 10px; }
main > h2 { margin-top: 28px; }
h3 { font-size: 15px; margin: 0 0 6px; }
p { margin: 0 0 10px; }
.muted { color: var(--c-muted); }
.error { color: var(--c-error); }
.help { color: var(--c-muted); font-size: 13px; overflow-wrap: anywhere; }

/* --- карточки ----------------------------------------------------------------- */
.cards { list-style: none; margin: 0 0 22px; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.card p { margin: 4px 0; }
.card.inactive { color: var(--c-muted); }
.card > a > strong { font-size: 16px; }
/* Карточка типа номера: обложка сверху во всю ширину карточки. */
.room-card { padding: 0 0 14px; overflow: hidden; }
.room-card > a, .room-card > p { margin-left: 18px; margin-right: 18px; }
.room-cover { display: block; margin: 0; height: 150px; background: var(--c-surface-2); }
.room-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.room-cover-empty { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--c-muted); font-size: 13px; }
.room-card > a:first-of-type + a { display: inline-block; margin-top: 12px; }

/* --- карточка брони: две колонки ------------------------------------------------ */
.detail-grid {
  display: grid; gap: 14px; margin: 0 0 22px;
  /* На узком экране сначала факты (заказчик, номера), потом деньги и действия (У1). */
  grid-template-columns: 1fr; grid-template-areas: "main" "money";
}
.detail-col { display: grid; gap: 14px; align-content: start; min-width: 0; }
.detail-col-money { grid-area: money; }
/* Номера брони списком: тип и сумма в строку, под ними даты и гости по одному. */
.room-lines { list-style: none; margin: 0; padding: 0; }
.room-line { padding: 10px 0; border-bottom: 1px solid var(--c-line); }
.room-line:last-child { border-bottom: 0; }
.room-line-head { display: flex; justify-content: space-between; gap: 12px; }
.room-line-head .num { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.room-line .guest { display: block; }
.detail-col-main { grid-area: main; }
.detail-col .card { min-width: 0; }
.detail-col .card h3 { margin: 14px 0 6px; }
.detail-col .card h3:first-child { margin-top: 0; }
@media (min-width: 1000px) {
  .detail-grid { grid-template-columns: 1fr 1fr; grid-template-areas: "main money"; align-items: start; }
}

/* --- диалог подтверждения ------------------------------------------------------- */
.confirm-dialog {
  border: 1px solid var(--c-line); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 22px; background: var(--c-surface); color: var(--c-ink);
  max-width: 420px; width: calc(100% - 32px);
}
.confirm-dialog h2 { color: var(--c-ink); font-size: 16px; text-transform: none; letter-spacing: 0; margin: 0 0 10px; }
.confirm-dialog::backdrop { background: rgba(15, 17, 23, .55); }
.confirm-dialog .actions { margin-top: 16px; }
.confirm-dialog .actions form { display: contents; }

/* --- показатели и задачи (обзор) --------------------------------------------- */
.stats { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.stat { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat a { display: block; color: inherit; text-decoration: none; }
.stat a:hover .stat-value { color: var(--c-accent); }
.stat-value { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat-label { display: block; margin-top: 4px; font-size: 13px; color: var(--c-muted); }
.stat-note { display: block; margin-top: 6px; font-size: 12px; }
.stat-zero .stat-value { color: var(--c-muted); }

.tasks { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 8px; }
.task { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 16px; background: var(--c-surface); border: 1px solid var(--c-line); border-left: 3px solid var(--c-warn); border-radius: var(--radius-s); box-shadow: var(--shadow); }
.task-error { border-left-color: var(--c-error); }
.task-text { flex: 1; min-width: 240px; }
.task .button { padding: 6px 12px; font-size: 13px; }

/* --- календарь загрузки ---------------------------------------------------- */
/* Первая колонка липкая: на горизонте в 30+ ночей строка уезжает, и клетка
   «занято/всего» остаётся без имени типа номера. */
/* `.table` clips to its rounded corners (`overflow: hidden`), которое иначе
   становится ближайшим предком с overflow != visible и «крадёт» у первой
   колонки контекст липкости у `.table-scroll` -- колонка перестаёт стоять на
   месте и уезжает вместе с прокруткой. Своя рамка и тень заменяют скруглённые
   углы, которые снимает overflow: visible. */
/* На узком экране общее правило `.table { display: block; overflow-x: auto; }`
   ломает и то, и другое по той же причине: своя прокрутка внутри `.table-scroll`
   уже есть, вторая не нужна и рвёт липкую колонку. */
.table.calendar { overflow: visible; display: table; }
.calendar th:first-child, .calendar td:first-child {
  position: sticky; left: 0; z-index: 1; background: var(--c-surface);
  border-right: 1px solid var(--c-line); width: 200px; min-width: 200px; max-width: 200px;
  white-space: normal; text-align: left;
}
.calendar thead th:first-child { background: var(--c-surface-2); z-index: 2; }
.calendar td { text-align: center; white-space: nowrap; }
.calendar .cell-full { color: var(--c-error); font-weight: 600; }
.calendar .cell-free { color: var(--c-muted); }

/* --- бейджи и сообщения -------------------------------------------------------- */
.tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.5; background: var(--c-warn-soft); color: var(--c-warn); white-space: nowrap; }
.tag-ok { background: var(--c-ok-soft); color: var(--c-ok); }
.tag:not(.tag-ok):not(.tag-warn) { background: var(--c-surface-2); color: var(--c-ink-2); }
.messages { list-style: none; padding: 0; margin: 0 0 18px; display: grid; gap: 8px; }
.message { padding: 10px 14px; border-radius: var(--radius-s); background: var(--c-ok-soft); color: var(--c-ok); border: 1px solid transparent; font-weight: 500; }
.message.error { background: var(--c-error-soft); color: var(--c-error); }
.message.warning { background: var(--c-warn-soft); color: var(--c-warn); }
.message.info { background: var(--c-accent-soft); color: var(--c-accent); }

/* --- формы --------------------------------------------------------------------- */
.form fieldset { min-width: 0; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 16px 20px 6px; margin: 0 0 16px; box-shadow: var(--shadow); }
.form legend { font-weight: 700; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--c-muted); padding: 0 6px; }
.form .field { margin: 0 0 14px; }
.form label { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 5px; color: var(--c-ink-2); }
.form input[type="text"], .form input[type="url"], .form input[type="email"], .form input[type="number"], .form input[type="time"],
.form input[type="date"], .form input[type="password"], .form input[type="search"], .form select, .form textarea {
  width: 100%; min-width: 0; max-width: 640px; padding: 9px 12px; border: 1px solid var(--c-line-2); border-radius: var(--radius-s);
  font: inherit; color: var(--c-ink); background: var(--c-surface); transition: border-color .12s, box-shadow .12s;
}
.form input:focus, .form select:focus, .form textarea:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.form textarea { min-height: 96px; resize: vertical; }
.form input[type="checkbox"], .form input[type="radio"] { width: 16px; height: 16px; margin-right: 8px; vertical-align: -2px; accent-color: var(--c-accent); }
.form .help { margin: 5px 0 0; max-width: 640px; overflow-wrap: anywhere; }
.form .has-error input, .form .has-error textarea, .form .has-error select { border-color: var(--c-error); }
.form .error { font-size: 13px; margin: 4px 0 0; }
.errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--c-error); font-size: 13px; }
.form-narrow { max-width: 380px; }
.form-inline { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.form-inline > * { min-width: 0; max-width: 100%; }
.form-inline > .help { flex: 1 1 200px; margin: 0; }
.filters { margin-bottom: 0; flex-wrap: wrap; }
.filters select, .filters input { width: auto; }
.filters input[type="text"] { min-width: 260px; }
.actions { display: flex; gap: 10px; align-items: center; margin: 12px 0 0; }

/* --- списки: липкая строка фильтров, счётчик ------------------------------------ */
.filters-bar {
  position: sticky; top: var(--top-h); z-index: 10;
  background: var(--c-bg); padding: 14px 0 12px; margin: 0 0 6px;
  border-bottom: 1px solid var(--c-line);
}
.filters-bar .filters { margin-bottom: 10px; }
.filters-bar .filters:last-child { margin-bottom: 0; }
.results-count { margin: 0; font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.table-scroll { overflow-x: auto; }

.actions button, .form button[type="submit"], .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 1px solid transparent; border-radius: var(--radius-s);
  background: var(--c-accent); color: var(--c-accent-ink); font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; transition: filter .12s, transform .05s;
}
.actions button:hover, .form button[type="submit"]:hover, .button:hover { filter: brightness(1.08); text-decoration: none; }
.actions button:active, .form button[type="submit"]:active, .button:active { transform: translateY(1px); }
.button-secondary, .actions .button-secondary { background: var(--c-surface); color: var(--c-ink-2); border-color: var(--c-line-2); }
.danger-button, .actions .danger-button, .form button.danger-button[type="submit"] { background: var(--c-error); color: var(--c-error-ink); }
button.link { background: none; border: 0; padding: 0; color: var(--c-accent); cursor: pointer; font: inherit; text-decoration: none; }
button.link:hover { text-decoration: underline; }
/* Кнопка «показать введённое» у полей с ключами: ставится скриптом сразу
   после input, поэтому отступ сверху, а не слева. */
.reveal-toggle { display: inline-block; margin-top: 6px; font-size: 13px; }
button.danger { color: var(--c-error); }
.photo-actions button[disabled] { color: var(--c-muted); text-decoration: none; cursor: default; }

/* --- таблицы ------------------------------------------------------------------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin: 0 0 18px; }
.table th, .table td { padding: 10px 14px; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: middle; }
.table th { background: var(--c-surface-2); font-weight: 600; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; color: var(--c-muted); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--c-surface-2); }
.table tfoot td { background: var(--c-surface-2); font-weight: 700; border-top: 1px solid var(--c-line-2); border-bottom: 0; }
.table tfoot tr:not(:last-child) td { border-bottom: 1px solid var(--c-line); }
.table tr.inactive td { color: var(--c-muted); }
.table td code { white-space: nowrap; }
/* Роли сотрудника: «длинное название отеля → роль» переносится внутри бейджа. */
.table td.roles { min-width: 14rem; }
.table td.roles .tag { white-space: normal; margin: 0 0 4px; }
.table.compact th, .table.compact td { padding: 6px 10px; font-size: 13px; }
.table.compact { box-shadow: none; margin: 8px 0 0; }
/* Таблица «поле -- значение» (реквизиты): значения длинные (адреса, почта), поэтому
   на узком экране она остаётся таблицей и переносит текст, а не прокручивается внутри себя. */
.table.kv { display: table; overflow: hidden; }
.table.kv th { width: 34%; }
.table.kv td { overflow-wrap: anywhere; }
.table input { width: 120px; min-width: 72px; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
details > summary { cursor: pointer; }
.pager { display: flex; gap: 14px; align-items: center; margin: 12px 0 0; }
.pager .button { padding: 7px 14px; font-size: 13.5px; }

/* --- содержимое разделов --------------------------------------------------------- */
.thumb { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; display: block; }
.amenity-group h3 { font-size: 13px; margin: 12px 0 6px; color: var(--c-muted); font-weight: 600; }
.amenity-items { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.amenity { font-weight: 400; display: inline-flex; align-items: center; gap: 4px; }
.amenity input { margin: 0; }
.photos { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 12px; }
.photo { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow); }
.photo img { width: 200px; height: 140px; object-fit: cover; border-radius: 8px; display: block; }
.photo-actions { display: flex; gap: 10px; margin-top: 8px; }
/* Первая плитка галереи -- та, что уходит гостю на карточку поиска. */
.photo-cover { margin: 0 0 6px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--c-accent); }
.photos[data-reorder-url] .photo { cursor: grab; }
.photo.dragging { opacity: .5; cursor: grabbing; }
code.url { display: inline-block; padding: 6px 10px; word-break: break-all; white-space: normal; user-select: all; }
.payload { background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius); padding: 12px 14px; font-size: 13px; overflow: auto; max-height: 480px; white-space: pre-wrap; word-break: break-word; }
.snippet {
  display: block; width: 100%; max-width: 640px; box-sizing: border-box; margin: 6px 0 0;
  padding: 9px 12px; border: 1px solid var(--c-line-2); border-radius: var(--radius-s);
  font: inherit; color: var(--c-ink); background: var(--c-surface);
  white-space: pre-wrap; word-break: break-all;
}
.snippet:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }

/* --- вход и регистрация ----------------------------------------------------------- */
body.console.auth .console-main { max-width: 440px; margin: 6vh auto 0; padding: 32px; background: var(--c-surface); border: 1px solid var(--c-line); border-radius: 16px; box-shadow: var(--shadow); }
body.console.auth .console-body { align-items: flex-start; justify-content: center; }

/* --- длинная форма с оглавлением ------------------------------------------------- */
.form-layout { display: flex; gap: 24px; align-items: flex-start; }
.form-layout > .form, .form-layout > .form-sections { flex: 1 1 auto; min-width: 0; }
.form-toc { width: 200px; flex: none; position: sticky; top: calc(var(--top-h) + 18px); }
.form-toc summary { display: none; }
.form-toc ul { list-style: none; margin: 0; padding: 0; }
.form-toc a { display: block; padding: 6px 10px; border-radius: 6px; font-size: 13px; color: var(--c-ink-2); text-decoration: none; }
.form-toc a:hover { background: var(--c-surface-2); color: var(--c-ink); text-decoration: none; }
/* Чтобы после перехода по якорю заголовок секции не уезжал под липкую шапку. */
.form-layout [id] { scroll-margin-top: calc(var(--top-h) + 16px); }

/* --- узкий экран ----------------------------------------------------------------- */
@media (max-width: 860px) {
  .console-top { padding: 0 14px; gap: 10px; }
  .console-brand { width: auto; }
  .console-hotel { display: none; }
  .account-who, .account-caret { display: none; }
  .account-menu > summary { padding: 3px; }
  .console-body { flex-direction: column; }
  .console-nav { position: static; width: auto; height: auto; padding: 8px 14px; border-right: 0; border-bottom: 1px solid var(--c-line); }
  .console-nav .nav-all > summary { display: block; padding: 8px 10px; font-weight: 600; color: var(--c-ink-2); list-style: none; }
  .console-nav .nav-all > summary::-webkit-details-marker { display: none; }
  .console-nav .nav-all > summary::after { content: "▾"; float: right; color: var(--c-muted); }
  .console-nav .nav-all[open] > summary::after { content: "▴"; }
  .nav-group { margin: 6px 0 10px; }
  /* Заголовок раздела на телефоне -- цель для пальца: не ниже строки пункта (38px). */
  details.nav-group > summary.nav-group-title { min-height: 38px; }
  .console-nav .nav-all[open] > summary { margin-bottom: 8px; }
  .console-main { padding: 18px 16px 40px; }
  .cards { grid-template-columns: minmax(0, 1fr); }
  .cards > .card { min-width: 0; }
  .card .table td code { white-space: normal; overflow-wrap: anywhere; }
  .table { display: block; overflow-x: auto; }
  .form-layout { display: block; }
  .form-toc { position: static; width: auto; margin: 0 0 14px; }
  .form-toc summary { display: block; padding: 8px 10px; font-weight: 600; color: var(--c-ink-2); list-style: none; }
  .form-toc summary::-webkit-details-marker { display: none; }
  .form-toc summary::after { content: "▾"; float: right; color: var(--c-muted); }
  .form-toc details[open] summary::after { content: "▴"; }
  .filters-bar { padding: 10px 0 8px; }
  .filters { flex-wrap: wrap; align-items: stretch; }
  .filters select, .filters input { flex: 1 1 130px; min-width: 0; }
  .filters button[type="submit"] { flex: 1 1 100%; }
  body.console.auth .console-main { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
}

/* --- печать ---------------------------------------------------------------------- */
/* Стойка печатает карточку брони и отдаёт её гостю: на листе нужны заказчик,
   номера с гостями, сумма и остаток. Навигация, кнопки, сообщения, журнал
   платежей и состояние обмена с PMS -- внутренняя кухня, на бумаге им нечего
   делать. Правила общие для всей консоли: печатается только содержимое. */
.print-only { display: none; }
@media print {
  .console-top, .console-nav, .messages, .actions, .no-print, dialog,
  .button, .console-main button { display: none !important; }
  .print-only { display: block; }
  .print-head { margin: 0 0 12px; font-size: 12px; color: #000; }
  body, .console-main { background: #fff; color: #000; }
  .console-body { display: block; }
  .console-main { padding: 0; }
  .detail-grid { display: block; }
  .card { border: 0; box-shadow: none; padding: 0 0 12px; break-inside: avoid; }
  .card h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; }
  .table-scroll { overflow: visible; }
  .table { width: 100%; }
  a { color: #000; text-decoration: none; }
  .tag { border: 1px solid #000; color: #000; background: none; }
}

/* --- вход и регистрация (У2): панель о продукте слева, форма справа ------------- */
body.auth-page { background: var(--c-bg); }
.auth-shell { display: grid; grid-template-columns: minmax(340px, 44%) 1fr; min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden; color: #fff; padding: 40px 52px;
  display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
  background:
    radial-gradient(90% 70% at 0% 0%, rgba(96, 165, 250, .45) 0%, transparent 60%),
    radial-gradient(70% 60% at 100% 100%, rgba(56, 189, 248, .28) 0%, transparent 65%),
    linear-gradient(155deg, #172554 0%, #1e3a8a 50%, #1d4ed8 100%);
}
/* Два мягких круга -- глубина без картинок. */
.auth-brand::before, .auth-brand::after { content: ""; position: absolute; border-radius: 50%; pointer-events: none; }
.auth-brand::before { width: 420px; height: 420px; right: -160px; top: -140px; border: 1px solid rgba(255, 255, 255, .14); }
.auth-brand::after { width: 260px; height: 260px; right: 40px; bottom: -120px; background: rgba(255, 255, 255, .06); }
.auth-brand > * { position: relative; }
.auth-logo { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.auth-logo:hover { text-decoration: none; }
.auth-logo-mark { width: 36px; height: 36px; border-radius: 9px; display: inline-block; background: #fff; box-shadow: 0 4px 14px rgba(15, 17, 23, .25); }
.auth-brand :focus-visible { outline-color: #fff; }
.auth-lead { margin: 0 0 28px; max-width: 17ch; font-size: clamp(26px, 2.7vw, 36px); line-height: 1.18; font-weight: 700; letter-spacing: -.02em; }
.auth-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; font-size: 16px; color: rgba(255, 255, 255, .92); }
.auth-points li { display: flex; align-items: center; gap: 12px; }
.auth-points li::before {
  content: "✓"; flex: 0 0 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .28);
}

.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 28px; }
.auth-panel { width: 100%; max-width: 400px; }
.auth-panel h1 { margin: 0 0 6px; font-size: 28px; line-height: 1.2; letter-spacing: -.02em; }
.auth-sub { margin: 0 0 28px; color: var(--c-muted); font-size: 15px; line-height: 1.5; }
.auth-form .field { margin: 0 0 16px; }
.auth-form input[type="text"], .auth-form input[type="email"], .auth-form input[type="password"] { height: 46px; padding: 0 14px; border-radius: 10px; font-size: 15px; }
.auth-form .help { font-size: 12.5px; }
.auth-submit { width: 100%; height: 48px; margin-top: 6px; border-radius: 10px; font-size: 15px; font-weight: 600; }
.password-wrap { position: relative; display: block; }
.password-wrap input { padding-right: 48px !important; }
.password-toggle {
  position: absolute; right: 1px; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--c-muted);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.password-toggle:hover { background: var(--c-surface-2); color: var(--c-ink-2); }
.password-toggle[aria-pressed="true"] { color: var(--c-accent); }
.password-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.auth-forgot { margin: -6px 0 18px; font-size: 13.5px; }
.auth-forgot summary { display: inline-block; cursor: pointer; color: var(--c-accent); list-style: none; }
.auth-forgot summary::-webkit-details-marker { display: none; }
.auth-forgot p { margin: 10px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--c-surface-2); border: 1px solid var(--c-line); color: var(--c-ink-2); line-height: 1.5; }
.auth-note { margin: 14px 0 0; text-align: center; font-size: 12.5px; color: var(--c-muted); }
.auth-switch { margin: 28px 0 0; padding-top: 20px; border-top: 1px solid var(--c-line); text-align: center; color: var(--c-muted); font-size: 14px; }
.auth-switch a { font-weight: 600; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .auth-brand {
    background:
      radial-gradient(90% 70% at 0% 0%, rgba(59, 130, 246, .3) 0%, transparent 60%),
      radial-gradient(70% 60% at 100% 100%, rgba(14, 165, 233, .2) 0%, transparent 65%),
      linear-gradient(155deg, #0b1633 0%, #172554 55%, #1e3a8a 100%);
  }
}

/* Узкий экран: панель -- шапкой над формой, преимущества -- строкой. */
@media (max-width: 860px) {
  .auth-shell { grid-template-columns: 1fr; min-height: 0; }
  .auth-brand { padding: 18px 20px 20px; gap: 14px; }
  .auth-logo-mark { width: 30px; height: 30px; }
  .auth-brand::before { width: 240px; height: 240px; right: -90px; top: -110px; }
  .auth-brand::after { display: none; }
  .auth-lead { margin: 0 0 12px; max-width: none; font-size: 19px; }
  .auth-points { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
  .auth-points li { gap: 6px; }
  .auth-points li::before { flex-basis: 18px; height: 18px; font-size: 11px; }
  .auth-main { align-items: flex-start; padding: 28px 16px 40px; }
  .auth-panel h1 { font-size: 24px; }
  .auth-sub { margin-bottom: 22px; }
}

/* --- профиль сотрудника (У4) ---------------------------------------------------- */
.profile-form { max-width: 640px; }
.profile-form .card, .profile-form + .card { margin: 0 0 16px; }
.profile-avatar { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.profile-avatar > img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 1px solid var(--c-line); }
.profile-avatar-actions { flex: 1; min-width: 220px; }
.profile-avatar-actions .field { margin-bottom: 8px; }
.profile-avatar-actions input[type="file"] { max-width: 100%; }
.profile-roles { list-style: none; margin: 0 0 8px; padding: 0; }
.profile-roles li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--c-line); }
.profile-roles li:last-child { border-bottom: 0; }
/* Поле «Телефон» рендерится как input[type=tel] (не входит в общий список .form input[...]
   в разделе «формы») -- без этого правила поле оставалось с оформлением браузера по
   умолчанию, светло-серым и уже соседних полей даже в тёмной теме. */
.profile-form input[type="tel"] {
  width: 100%; max-width: 640px; padding: 9px 12px; border: 1px solid var(--c-line-2); border-radius: var(--radius-s);
  font: inherit; color: var(--c-ink); background: var(--c-surface); transition: border-color .12s, box-shadow .12s;
}
.profile-form input[type="tel"]:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px var(--c-accent-soft); }
.profile-form .has-error input[type="tel"] { border-color: var(--c-error); }

/* --- приглашения сотрудников (У5) ----------------------------------------------- */
.invite-fresh { margin: 0 0 18px; border-color: var(--c-accent); }
.copy-row { display: flex; gap: 8px; flex-wrap: wrap; }
.copy-row input { flex: 1 1 260px; min-width: 0; height: 40px; padding: 0 12px; border: 1px solid var(--c-line-2); border-radius: var(--radius-s); background: var(--c-surface-2); color: var(--c-ink); font: inherit; font-size: 13px; }
.copy-row button { height: 40px; padding: 0 16px; border: 1px solid var(--c-line-2); border-radius: var(--radius-s); cursor: pointer; font: inherit; font-weight: 600; }
.row-actions { white-space: nowrap; }
.row-actions form { display: inline; }
.row-actions form + form { margin-left: 12px; }
/* На узком экране общее правило `.table { display: block; overflow-x: auto; }`
   спорит со своей прокруткой `.table-scroll` (тот же конфликт, что и у
   `.table.calendar` выше) -- колонка действий «Новая ссылка / Отозвать»
   переставала прокручиваться и пропадала совсем. Тот же приём: у таблицы
   возвращается обычная раскладка, прокручивает только обёртка. */
@media (max-width: 860px) {
  .invite-pending-scroll .table { display: table; overflow-x: visible; }
}

/* --- переключатель организаций и отелей (О1+Д1, Э4) ------------------------------ */
.org-switcher { position: relative; margin-left: 4px; padding-left: 14px; border-left: 1px solid var(--c-line); min-width: 0; }
.org-switcher > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 4px 8px; border-radius: var(--radius-s);
}
.org-switcher > summary::-webkit-details-marker { display: none; }
.org-switcher > summary:hover, .org-switcher[open] > summary { background: var(--c-surface-2); }
.org-switcher-org { font-size: 12px; color: var(--c-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.org-switcher-hotel { font-weight: 600; color: var(--c-ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 240px; }
.org-switcher[open] .account-caret { transform: rotate(180deg); }
.org-switcher-pop {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 50; width: 300px; max-height: 70vh; overflow-y: auto; padding: 6px;
  background: var(--c-surface); border: 1px solid var(--c-line); border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(20, 22, 31, .14), 0 2px 6px rgba(20, 22, 31, .06);
}
.org-switcher-title { margin: 8px 10px 4px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--c-muted); }
.org-switcher-pop a { display: block; padding: 8px 10px; min-height: 36px; border-radius: var(--radius-s); color: var(--c-ink-2); overflow-wrap: anywhere; }
.org-switcher-pop a:hover { background: var(--c-surface-2); text-decoration: none; }
.org-switcher-pop a[aria-current="page"] { background: var(--c-accent-soft); color: var(--c-accent); font-weight: 600; }
.org-switcher-all { font-size: 13px; color: var(--c-accent) !important; }
.org-switcher-more { margin-top: 4px; border-top: 1px solid var(--c-line); border-radius: 0 !important; font-size: 13px; }
@media (max-width: 860px) {
  .org-switcher { padding-left: 8px; }
  .org-switcher-org { display: none; }
  .org-switcher-hotel { max-width: 140px; }
  /* Список привязан к шапке, а не к кнопке: иначе на 375px он уезжает за правый край. */
  .org-switcher { position: static; }
  .org-switcher-pop { left: 14px; right: 14px; width: auto; }
}

/* --- номер отеля (У6): под названием в шапке, в переключателе, в настройках ------- */
.hotel-title { display: inline-flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.console-hotel { min-width: 0; }
.console-hotel .hotel-title > span:first-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: min(360px, 40vw); }
.hotel-number { font-size: 11px; font-weight: 500; color: var(--c-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.org-switcher-pop .hotel-number { float: right; margin-left: 10px; line-height: 20px; }
.org-switcher-pop a[aria-current="page"] .hotel-number { color: var(--c-accent); }
.hotel-number-line { margin: -4px 0 16px; }
.op-search { margin-bottom: 14px; }
.op-search input[type="search"] { min-width: 0; width: min(280px, 100%); }

/* Карточка тарифа (Т4.1): две таблицы по дням месяца -- «Цены» и «Ограничения»,
   в каждой типы номеров -- группы со сворачиванием (скрипт `rate_card.js`). Без скрипта все группы развёрнуты,
   кнопок нет. Шапка с днями липнет к верху области прокрутки, первая колонка --
   к левому краю (общее правило `.calendar`). */
.rate-grid-scroll { max-height: 75vh; overflow: auto; margin: 0 0 12px; }
.rate-grid-scroll .table { margin: 0; }
.rate-grid thead th { position: sticky; top: 0; z-index: 3; background: var(--c-surface-2); }
.rate-grid thead th:first-child { z-index: 4; }
/* Строка-заголовок группы тянется на всю ширину; название и кнопка остаются
   у левого края при прокрутке вбок. */
.rate-grid th.rate-group-cell { position: static; width: auto; min-width: 0; max-width: none; border-right: 0; background: var(--c-accent-soft); color: var(--c-ink); font-size: 14px; letter-spacing: 0; text-transform: none; text-align: left; padding: 0; }
.rate-group-head { position: sticky; left: 0; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; }
.rate-group-name { font-weight: 700; }
.rate-group-toggle { display: none; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid var(--c-line-2); border-radius: var(--radius-s); background: var(--c-surface); color: var(--c-ink-2); cursor: pointer; }
.rate-grid-js .rate-group-toggle { display: inline-flex; }
.rate-group-toggle:hover { background: var(--c-surface-2); }
.rate-group-toggle:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 1px; }
.rate-group-caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); }
.rate-group-toggle[aria-expanded="false"] .rate-group-caret { transform: rotate(-45deg); }
.rate-grid-title { margin: 20px 0 8px; font-size: 16px; }
.rate-grid .rate-limit-row td:first-child { color: var(--c-ink-2); }

/* Форма шаблона размещения (Ш1.1): две таблицы рядом -- места и типы номеров, как в 1С;
   на узком экране друг под другом. Кнопки строк ставит скрипт `accommodation.js`. */
.acc-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.acc-rows { margin: 0; }
.acc-rows .table { margin: 8px 0 12px; }
.acc-rows select { width: 100%; }
.acc-n { width: 3.5em; text-align: right; font-variant-numeric: tabular-nums; }
.acc-act { width: 1%; white-space: nowrap; }
@media (max-width: 860px) {
  .acc-tables { grid-template-columns: 1fr; }
}

/* Конструктор вставки виджета (блок В): настройки слева, предпросмотр справа
   и прилипает при прокрутке; на узком экране -- друг под другом. */
.wb { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; }
.wb-preview { position: sticky; top: 16px; }
.wb-preview iframe { display: block; width: 100%; height: 520px; border: 1px solid var(--c-line); border-radius: var(--radius); background: var(--c-surface); transition: max-width .2s; }
.wb-preview.is-mobile iframe { max-width: 390px; }
.wb-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; }
.wb-tile { display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1px solid var(--c-line); border-radius: var(--radius); cursor: pointer; }
.wb-tile:has(input:checked) { border-color: var(--c-accent); box-shadow: 0 0 0 1px var(--c-accent); background: var(--c-accent-soft); }
.wb-tile input { margin: 0; }
.wb-colors { display: grid; gap: 10px; }
.wb-color { display: grid; grid-template-columns: 1fr 9em 2.6em; gap: 8px; align-items: center; }
/* Атрибут hidden сильнее display кнопок: скрипт прячет «Показать», когда ширина меняется сразу. */
.wb [hidden] { display: none !important; }
.wb-color input[type=color] { width: 2.6em; height: 2.2em; padding: 0; border: 1px solid var(--c-line); border-radius: 6px; background: none; }
/* Рядом -- только на широком экране: с боковым меню консоли колонке
   предпросмотра нужно не меньше ~500px. Уже -- предпросмотр под настройками. */
@media (max-width: 1200px) {
  .wb { grid-template-columns: 1fr; }
  .wb-preview { position: static; }
}
