/* Оформление в стиле демо-сайта ЖК: шрифты Inter и Playfair Display, тёплый светлый фон,
   тонкие линии, скругление 4 px, золотистый акцент для главных кнопок. Структура — наша. */
:root {
  --canvas: #fafaf9;
  --surface: #fff;
  --ink: #0c0a09;
  --muted: #57534e;
  --subtle: #79716b;
  --hair: #e7e5e4;
  --hair-mid: #d6d3d1;
  --hair-strong: #8a837d;
  --primary: #1c1917;
  --primary-hover: #292524;
  --accent: #bf9548;
  --accent-hover: #a37a33;
  --accent-soft: #faf4e8;
  --wash: #f5f5f4;
  --radius: 4px;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: Inter, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  /* Шрифт — четыре размера, стандарт в docs/DESIGN.md. Новых размеров не вводить. */
  --fs-title: 22px;   /* заголовки разделов и подразделов, название ЖК, заголовок панели */
  --fs-main: 14px;    /* вкладки, кнопки, основной текст, содержимое таблиц и выпадающих списков, поля */
  --fs-note: 12px;    /* примечания, подсказки, шапки таблиц, подписи полей, надзаголовки, время в календаре */
  --fs-amount: 26px;  /* ключевые суммы: дашборд, долг или переплата, временный пароль */
  --error: #b91c1c;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--canvas); color: var(--ink); }
body { font: var(--fs-main)/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
@media (min-width: 761px) { body { min-width: 1024px; } }
a { color: var(--ink); text-underline-offset: 3px; text-decoration-color: var(--hair-strong); }
a:hover { color: var(--accent); }
h1, h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
h1 { font-size: var(--fs-title); line-height: 1.2; margin: 0 0 18px; }
h2 { font-size: var(--fs-title); line-height: 1.3; margin: 24px 0 12px; }

button, input, select, textarea { font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--hair-mid); border-radius: var(--radius); padding: 7px 10px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
button, .button { cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  text-decoration: none; padding: 7px 14px; font-size: var(--fs-main); font-weight: 500; line-height: 1.4;
  border: 1px solid var(--accent); border-radius: var(--radius); background: var(--accent); color: #fff; }
button:hover, .button:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
/* Главные действия: войти, забронировать, сохранить, отправить. */
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; } /* размер — как у всех кнопок */
button.primary:hover, .button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
/* Кнопки-фильтры и переключатели: белые (отжатые) и чёрные (нажатые). Все остальные текстовые кнопки — золотые. */
.lang-switch button, .view-switch button, .view-modes .button, .period-switch button, .room-switch a, .asset-switch a {
  background: var(--surface); border: 1px solid var(--hair-strong); color: var(--ink); }
.lang-switch button:hover, .view-switch button:hover, .view-modes .button:hover, .period-switch button:hover, .room-switch a:hover, .asset-switch a:hover {
  background: var(--wash); border-color: var(--hair-strong); color: var(--ink); }
.current, button.current, .button.current, a.current, button.active-period, .room-switch a.active,
.lang-switch button.current, .view-switch button.current, .view-modes .button.current, .asset-switch a.current {
  background: var(--primary); border-color: var(--primary); color: #fff; }
.current:hover, button.current:hover, .button.current:hover, a.current:hover, button.active-period:hover, .room-switch a.active:hover,
.lang-switch button.current:hover, .view-switch button.current:hover, .view-modes .button.current:hover, .asset-switch a.current:hover {
  background: var(--primary-hover); border-color: var(--primary-hover); color: #fff; }
input[type=checkbox], input[type=radio] { padding: 0; accent-color: var(--accent); width: 16px; height: 16px; }
form.inline { display: inline; margin: 0; }

/* Шапка */
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 24px;
  background: rgba(250, 250, 249, .92); border-bottom: 1px solid var(--hair); }
.site-name { font-family: var(--serif); font-size: var(--fs-title); letter-spacing: 0.06em; text-transform: uppercase; }
.who { display: flex; gap: 14px; align-items: center; font-size: var(--fs-note); color: var(--muted); }
.who a { color: var(--muted); }

/* Боковое меню-вкладки: одинаковой высоты, выбранная — серым и жирным. */
.layout { display: flex; align-items: stretch; min-height: calc(100vh - 58px); }
.tabs { width: 240px; flex: none; padding: 24px 0 24px 16px; border-right: 1px solid var(--hair); background: var(--canvas); }
.tab { display: flex; align-items: center; height: 44px; margin-bottom: 6px; padding: 0 14px; font-size: var(--fs-main);
  border: 1px solid var(--hair); border-right: none; border-radius: var(--radius) 0 0 var(--radius);
  text-decoration: none; color: var(--muted); background: var(--surface); line-height: 1.2; overflow: hidden; }
.tab:hover { color: var(--ink); background: var(--wash); }
.tab.active { font-weight: 600; color: var(--ink); background: var(--hair); margin-right: -1px; box-shadow: inset 3px 0 0 var(--accent); }
.content { flex: 1; padding: 28px 32px; min-width: 0; background: var(--canvas); }

/* Таблицы: тонкие линии */
table.grid, table.list { border-collapse: collapse; width: 100%; background: var(--surface); }
/* Колонки — по самому широкому тексту (без переносов); слишком длинные записи переносит static/js/tables.js. */
table.list { width: auto; max-width: 100%; }
table.list td { white-space: nowrap; }
table.list td .cell-wrap { white-space: normal; }
table.grid th, table.grid td, table.list th, table.list td { border: 1px solid var(--hair); padding: 6px 8px; vertical-align: top; text-align: left; }
table.list th, table.grid thead th { font-size: var(--fs-note); font-weight: 500; color: var(--muted); background: var(--canvas); white-space: nowrap; }
table.list th { white-space: normal; }
table.list tr:hover td { background: #fcfcfb; }
table.form th { text-align: left; font-weight: 400; font-size: var(--fs-note); color: var(--muted); padding: 6px 14px 6px 0; vertical-align: baseline; white-space: nowrap; }
table.form td { padding: 6px 0; vertical-align: baseline; }
table.form tr:has(textarea, select[multiple], ul) > * { vertical-align: top; }
table.form tr:has(textarea, select[multiple], ul) > th { padding-top: 14px; }
.help { font-size: var(--fs-note); color: var(--muted); }
.error, .errors { color: var(--error); font-weight: 500; }
ul.errors, ul.messages { list-style: none; padding: 10px 14px; margin: 0 0 18px; border-radius: var(--radius); }
ul.messages { background: var(--accent-soft); border: 1px solid #ecdcbc; border-left: 3px solid var(--accent); }
ul.errors { background: #fef2f2; border: 1px solid #fecaca; border-left: 3px solid var(--error); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 12px 0; }
/* Подписи полей в строке фильтров («Статус», «Тема», «С», «По», «Период») — как подписи в формах. */
.actions > label, .actions .field-label { font-size: var(--fs-note); color: var(--muted); }
.actions > label select, .actions > label input { margin-left: 4px; font-size: var(--fs-main); color: var(--ink); }
.muted { color: var(--subtle); }
.deleted, .deleted a { color: #b8b2ad; }
.eyebrow { font-size: var(--fs-note); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); }

/* Резервирование */
.room-switch { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.room-switch a { padding: 6px 12px; font-size: var(--fs-main); border: 1px solid var(--hair-mid); border-radius: var(--radius); text-decoration: none; background: var(--surface); }
.room-switch a.active, .view-modes a.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.room-card { display: flex; gap: 20px; align-items: stretch; background: var(--surface); border: 1px solid var(--hair);
  border-radius: var(--radius); overflow: hidden; margin: 6px 0 16px; max-width: 1100px; }
.room-card img { width: 300px; height: 190px; object-fit: cover; flex: none; display: block; }
.room-card .room-info { padding: 16px 20px 16px 0; }
.room-card h2 { margin: 6px 0 8px; }
.room-thumb { display: block; width: 100%; height: 64px; object-fit: cover; border-radius: 2px; margin-bottom: 4px; }
.booking-layout { display: flex; gap: 24px; align-items: flex-start; }
.booking-layout .calendar { flex: 1; min-width: 0; overflow-x: auto; }
.booking-layout .panel { width: 340px; flex: none; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 16px 18px; }
/* Блоки панели брони («Бронь», «Изменить бронь», «Удалить бронь») отделены отступом 24 px, первый — без отступа. */
.panel h2 { margin: 24px 0 12px; font-size: var(--fs-title); }
.panel h2:first-of-type { margin-top: 0; }
.panel > .row-actions, .panel form > .row-actions { display: flex; margin: 12px 0 0; }
.panel table.form { margin-bottom: 12px; }
/* Подпись поля вне таблицы формы («Причина» отмены, отклонения) — как подписи в формах. */
.panel form > p > label { display: block; margin-bottom: 4px; font-size: var(--fs-note); color: var(--muted); }
.panel form > p input[type=text] { width: 100%; }
.panel table.form { width: 100%; table-layout: fixed; }
.panel table.form th { width: 38%; white-space: normal; }
.panel select, .panel input[type=text], .panel input[type=date], .panel input[type=datetime-local] { width: 100%; max-width: 100%; }
.panel table.form tr.checkbox-row label { align-items: flex-start; }
table.grid { table-layout: fixed; width: auto; }
table.grid thead th:not(.time) { width: 210px; } /* колонка дня или помещения: не растягиваем на весь экран */
table.grid th.time { width: 58px; font-size: var(--fs-note); font-weight: 400; color: var(--subtle); background: var(--canvas); }
table.grid td { height: 26px; padding: 0; font-size: var(--fs-main); }
table.grid thead th.today-col { color: var(--accent); }
table.grid td a.cell { display: block; height: 100%; min-height: 25px; padding: 3px 6px; text-decoration: none; }
table.grid td.free a.cell:hover { background: var(--accent-soft); }
table.grid td.booking { padding: 4px 6px; background: var(--wash); box-shadow: inset 3px 0 0 var(--hair-strong); }
table.grid td.booking a.cell { padding: 0; }
table.grid td.booking.mine { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); font-weight: 600; }
table.grid td.booking.pending { background: repeating-linear-gradient(-45deg, var(--accent-soft) 0 6px, #fff 6px 10px); }
/* Чужая неоплаченная бронь платного помещения: серая и неактивная — время занято, но ещё не оплачено. */
table.grid td.booking.unpaid { background: #ecebe9; box-shadow: inset 3px 0 0 var(--hair-mid); color: var(--subtle); font-style: italic; }
table.grid td.cleanup { font-style: italic; color: var(--subtle); padding: 3px 6px;
  background: repeating-linear-gradient(45deg, #fff 0 6px, var(--wash) 6px 8px); }
table.grid td.past { background: #f7f7f6; }
table.grid td.off { background: #f1f0ef; }
table.grid td.closed { padding: 4px 6px; font-style: italic; color: var(--muted);
  background: repeating-linear-gradient(-45deg, #fff 0 6px, var(--hair) 6px 8px); }
section.pending { background: var(--accent-soft); border: 1px solid #ecdcbc; border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 10px 16px; margin: 14px 0; }
section.pending h2 { margin-top: 4px; }
details > summary.button { margin: 12px 0; list-style: none; }
details > summary::-webkit-details-marker { display: none; }

/* Вход: наш рисунок дома слева, панель входа справа */
.login-page { display: flex; min-height: 100vh; background: var(--surface); }
.login-image { flex: 1; margin: 32px; background: #fff url("../img/login-bg.jpg") center / contain no-repeat; }
.login-side { flex: none; width: 480px; display: flex; align-items: center; justify-content: center; padding: 32px; border-left: 1px solid var(--hair); background: var(--canvas); }
.login-box { width: 380px; max-width: 100%; padding: 32px 36px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); font-size: var(--fs-main); }
.login-box h1 { font-size: var(--fs-title); text-align: center; margin-bottom: 22px; }
.login-box h2 { font-size: var(--fs-title); margin-top: 0; }
.login-box .form, .login-box .form tbody, .login-box .form tr { display: block; width: 100%; }
.login-box .form th { display: block; padding: 0 0 4px; font-size: var(--fs-note); }
.login-box .form td { display: block; padding: 0 0 14px; }
.login-box input[type=text], .login-box input[type=password] { width: 100%; font-size: var(--fs-main); padding: 9px 11px; }
.login-box button.primary { width: 100%; }
.login-box .actions { justify-content: space-between; gap: 12px; margin-top: 3px; }
.login-box .help { font-size: var(--fs-note); text-align: center; }
.login-box form + form { margin-top: 12px; }
.notice { background: var(--canvas); border: 1px solid var(--hair); border-radius: var(--radius); padding: 10px 12px; margin-top: 18px; color: var(--muted); }

.stub { background: var(--surface); border: 1px dashed var(--hair-strong); border-radius: var(--radius); padding: 28px; max-width: 700px; }
.mobile-stub { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 16px; text-align: center; }
body.mobile { min-width: 0; }
.password-box { font-family: Consolas, monospace; font-size: var(--fs-amount); border: 1px solid var(--hair-strong); border-radius: var(--radius); background: var(--surface); padding: 10px 16px; display: inline-block; letter-spacing: 2px; }

/* Временные кнопки «Вид админ / Вид житель» */
.view-switch { display: flex; gap: 8px; align-items: center; border: 1px dashed var(--hair-strong); border-radius: var(--radius); padding: 4px 10px; font-size: var(--fs-main); }
.view-switch input { width: 64px; padding: 4px 8px; }
.view-switch select { padding: 4px 6px; }
.view-switch button { white-space: nowrap; }
.view-switch form { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.view-switch .viewing { font-weight: 600; color: var(--accent); }

/* Платежи */
.statement { margin-bottom: 36px; max-width: 1400px; }
.statement .balance { font-size: var(--fs-main); margin: 4px 0 14px; }
.statement .balance b { font-weight: 600; }
.statement .balance strong { font-family: var(--serif); font-weight: 500; font-size: var(--fs-amount); }
table.money td:nth-child(n+3), table.money th:nth-child(n+3) { text-align: right; white-space: nowrap; }
table.money td:nth-child(2) { text-align: left; }
table.money .total-row td { font-weight: 600; border-top: 1px solid var(--hair-strong); background: var(--canvas); }
table.money .muted-row td { color: var(--subtle); }
button.active-period { background: var(--primary); border-color: var(--primary); color: #fff; }
.asset-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 20px; }
.asset-switch a { padding: 6px 12px; font-size: var(--fs-main); border: 1px solid var(--hair-mid); border-radius: var(--radius); text-decoration: none; background: var(--surface); }

/* Переключатель языка */
.lang-switch { display: inline-flex; gap: 0; margin: 0; }
.lang-switch button { padding: 3px 8px; font-size: var(--fs-note); border-radius: 0; margin-left: -1px; border-color: var(--hair-mid); }
.lang-switch button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.lang-switch button:last-child { border-radius: 0 var(--radius) var(--radius) 0; }
.lang-switch button.current { background: var(--primary); border-color: var(--primary); color: #fff; }
.login-box .lang-switch { display: flex; justify-content: center; margin: -8px 0 14px; }
.login-box .form input[type=checkbox] { width: 16px; margin-right: 6px; }
table.form tr.checkbox-row td { padding: 6px 0; }
table.form tr.checkbox-row label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

/* Фильтры */
form.actions select { max-width: 360px; }

/* Справочники */
.sections-form { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; background: var(--surface);
  border: 1px solid var(--hair); border-radius: var(--radius); padding: 12px 16px; }
.sections-form label { display: inline-flex; gap: 8px; align-items: center; }
table.form.hours td label { margin-left: 12px; display: inline-flex; gap: 6px; align-items: center; }

/* Правила пользования */
.rules-page { max-width: 820px; margin: 0 auto; padding: 32px 24px; }
.rules-page .lang-switch { display: flex; justify-content: flex-end; }
.rules-text { background: var(--surface); }
.rules-text.bordered { border: 1px solid var(--hair); border-radius: var(--radius); padding: 14px 20px; max-height: 50vh; overflow: auto; margin-bottom: 16px; }

/* Кнопки-иконки (Material Design): квадратные 34×34, золотые; подпись — во всплывающей подсказке (data-tip).
   Переходы в другие разделы (Правила пользования, Журнал действий) — обычные кнопки с текстом. */
.icon-btn, button.icon-btn, .button.icon-btn { width: 34px; height: 34px; padding: 0; flex: none; color: var(--accent); background: var(--surface); }
.icon-btn:hover, button.icon-btn:hover, .button.icon-btn:hover { color: var(--accent-hover); border-color: var(--accent); background: var(--accent-soft); }
.icon-btn.primary, button.icon-btn.primary { color: var(--accent); background: var(--surface); border-color: var(--accent); }
.icon-btn.primary:hover, button.icon-btn.primary:hover { color: var(--accent-hover); background: var(--accent-soft); }
.icon-btn.danger:hover, button.icon-btn.danger:hover { color: var(--error); border-color: var(--error); background: #fef2f2; }
/* Подсказка при наведении на иконку. */
[data-tip] { position: relative; }
[data-tip]:hover::after, [data-tip]:focus-visible::after {
  content: attr(data-tip); position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: var(--fs-note); font-weight: 500; line-height: 1.3; white-space: nowrap;
  padding: 5px 9px; border-radius: var(--radius); z-index: 50; pointer-events: none; }
.panel .close-x[data-tip]:hover::after { left: auto; right: 0; transform: none; }
.icon { display: block; }
.row-actions { display: inline-flex; gap: 6px; align-items: center; flex-wrap: nowrap; }
/* «Выбрать файл» — в стиле обычной кнопки сайта. */
input[type=file] { border: none; padding: 0; background: none; font-size: var(--fs-note); color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-weight: 500; font-size: var(--fs-main); color: #fff;
  background: var(--accent); border: 1px solid var(--accent); border-radius: var(--radius);
  padding: 7px 14px; margin-right: 12px; cursor: pointer; }
input[type=file]::file-selector-button:hover { background: var(--accent-hover); }
/* Название ЖК — золотым, как главные кнопки. */
.brand { color: var(--accent); }
/* Крестик «закрыть» в правом верхнем углу панели. */
.panel { position: relative; }
.panel .close-x { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border: none; background: none; color: var(--accent); }
.panel .close-x:hover { color: var(--accent-hover); background: var(--accent-soft); }
.panel h2 { padding-right: 32px; }
/* Платежи: выбранное помещение залито, а не только при наведении. */
.asset-switch a.current { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Платежи администратора: четыре показателя ОСББ карточками. */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; margin: 8px 0 16px; max-width: 1240px; }
.kpi { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 16px 18px; }
.kpi-value { font-family: var(--serif); font-size: var(--fs-amount); margin: 6px 0 4px; white-space: nowrap; }
/* Знак ЖК перед названием — золотой, как название. */
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand .logo { flex: none; }
.login-box h1.brand, h1.brand { display: flex; }
.login-box h1.brand { justify-content: center; }
/* Название ЖК — всегда в одну строку и заглавными: знак + ОБОЛОНЬ РЕЗИДЕНСИС. */
.brand span { white-space: nowrap; text-transform: uppercase; }
.date-range label { display: inline-flex; align-items: center; gap: 6px; }
.kpi .eyebrow { white-space: nowrap; }
/* Заявки: дата, статус, иконки и текст — по центру строки. */
table.list.middle td { vertical-align: middle; }
/* Кнопки-иконки без рамки, пиктограмма крупнее (24 px вместо 18). */
.icon-btn, button.icon-btn, .button.icon-btn { border-color: transparent; background: transparent; }
.icon-btn:hover, button.icon-btn:hover, .button.icon-btn:hover, .icon-btn.primary, button.icon-btn.primary { border-color: transparent; }
.icon-btn .icon { width: 24px; height: 24px; }
/* Календарь (static/js/datepicker.js): поле «дд.мм.гггг» и всплывающий месяц в стиле сайта. */
.dp { display: inline-flex; gap: 6px; align-items: center; }
.dp-date { width: 7.5em; }
.dp-time { width: 4.2em; }
.dp-pop { position: absolute; z-index: 100; width: 252px; padding: 10px; background: var(--surface); border: 1px solid var(--hair-strong);
  border-radius: var(--radius); box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08); font-size: var(--fs-main); }
.dp-pop button { border: none; background: none; color: var(--ink); padding: 0; font-weight: 400; }
.dp-pop button:hover { background: var(--accent-soft); color: var(--ink); }
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-family: var(--serif); font-size: var(--fs-main); }
.dp-head .dp-nav { width: 30px; height: 30px; font-size: var(--fs-title); color: var(--accent); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.dp-dow { font-size: var(--fs-note); color: var(--muted); text-transform: lowercase; padding: 4px 0; }
.dp-day { height: 30px; border-radius: var(--radius); }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--accent); }
.dp-pop .dp-day.selected, .dp-pop .dp-day.selected:hover { background: var(--accent); color: #fff; }
.dp-foot { margin-top: 6px; text-align: center; }
.dp-pop .dp-today { color: var(--accent); font-weight: 500; padding: 4px 10px; }
.kpi-value.muted { color: var(--subtle); }
button:disabled, button:disabled:hover { opacity: 0.45; cursor: default; background: var(--accent); }
.button.disabled { opacity: 0.45; cursor: default; pointer-events: none; }
.receipts-admin { margin-top: 8px; }

/* ===== Телефон (до 760 px). Компьютерный вид выше не меняется. ===== */
@media (max-width: 760px) {
  /* Единственное исключение из шкалы: 16 px в полях — иначе iPhone увеличивает страницу при вводе. */
  input, select, textarea { font-size: 16px; }
  .actions > label select, .actions > label input { font-size: 16px; }
  button, .button { min-height: 40px; }
  .icon-btn, button.icon-btn, .button.icon-btn { width: 40px; height: 40px; }

  /* Шапка: название, переключатель вида и вход — друг под другом. */
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 10px 14px; }
  /* Языки — по центру строки, «Выйти» — справа. */
  .who { width: 100%; justify-content: center; position: relative; min-height: 40px; }
  .who .who-name { display: none; }
  .who form[action*="logout"] { position: absolute; right: 0; top: 0; }
  .lang-switch button { min-height: 34px; padding: 4px 12px; }
  /* Переключатель вида — только для проверки с компьютера. */
  .view-switch { display: none; }

  /* Меню разделов — горизонтальная прокручиваемая лента над содержимым. */
  .layout { display: block; min-height: 0; }
  .tabs { width: auto; display: flex; gap: 6px; overflow-x: auto; padding: 10px 14px; border-right: none;
    border-bottom: 1px solid var(--hair); scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: none; height: 38px; margin: 0; border-right: 1px solid var(--hair); border-radius: var(--radius); white-space: nowrap; }
  .tab.active { margin-right: 0; box-shadow: inset 0 -3px 0 var(--accent); }
  .content { padding: 16px 14px 32px; }
  h1 { margin-bottom: 12px; }

  /* Таблицы-списки — карточками: строка = карточка, у значения подпись колонки (static/js/tables.js).
     Таблицы сумм (Платежи) остаются таблицами и прокручиваются вбок. */
  table.list:not(.money), table.list:not(.money) tbody, table.list:not(.money) tr, table.list:not(.money) td { display: block; width: 100%; }
  table.list:not(.money) { border: none; background: none; }
  table.list:not(.money) tr:first-child:has(th) { display: none; }
  table.list:not(.money) tr { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); margin-bottom: 10px; padding: 6px 12px; }
  table.list:not(.money) td { border: none; padding: 4px 0; white-space: normal; display: flex; gap: 10px; align-items: baseline; }
  table.list:not(.money) td[data-label]::before { content: attr(data-label); flex: 0 0 32%; font-size: var(--fs-note); color: var(--muted); }
  table.list:not(.money) td:empty { display: none; }
  table.list:not(.money) td .cell-wrap { max-width: none !important; }
  table.list:not(.money) td .row-actions, table.list:not(.money) td form { flex-wrap: wrap; }
  table.list:not(.money) tr:hover td { background: none; }
  table.money { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

  /* Формы: подпись над полем, поля во всю ширину. */
  table.form, table.form tbody, table.form tr, table.form th, table.form td { display: block; width: 100%; }
  table.form th { padding: 8px 0 4px; white-space: normal; }
  table.form td { padding: 0 0 6px; }
  table.form input[type=text], table.form input[type=password], table.form input[type=email], table.form input[type=number],
  table.form select, table.form textarea { width: 100%; max-width: 100%; }
  table.form tr:has(textarea, select[multiple], ul) > th { padding-top: 8px; }
  table.form.hours td label { margin: 4px 12px 0 0; }
  .panel table.form th { width: 100%; }

  /* Резервирование: карточка помещения — фото сверху; панель брони — над календарём. */
  .room-card { flex-direction: column; gap: 0; }
  .room-card img { width: 100%; height: 180px; }
  .room-card .room-info { padding: 12px 14px; }
  .booking-layout { flex-direction: column; gap: 14px; }
  .booking-layout .panel { order: -1; width: 100%; }
  .booking-layout .calendar { width: 100%; }
  table.grid thead th:not(.time) { width: 112px; }
  table.grid th.time { width: 46px; }

  /* Платежи и дашборд */
  .kpis { grid-template-columns: minmax(0, 1fr); }
  .kpi-value { white-space: normal; }
  .kpi .eyebrow { white-space: normal; }
  .date-range { flex-wrap: wrap; }

  /* Вход: рисунок дома — узкой полосой сверху, форма во всю ширину. */
  .login-page { flex-direction: column; }
  .login-image { flex: none; height: 180px; margin: 12px 14px 0; }
  .login-side { width: 100%; padding: 16px 14px 28px; border-left: none; align-items: flex-start; }
  .login-box { width: 100%; padding: 22px 18px; }
  .rules-page { padding: 18px 14px; }
  .stub { padding: 18px; }
}

/* Новости */
.news-list { max-width: 820px; }
.news-item { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 16px 20px; margin-bottom: 14px; }
.news-item.hidden-news { border-style: dashed; background: var(--canvas); }
.news-meta { display: flex; gap: 10px; align-items: center; font-size: var(--fs-note); color: var(--muted); }
.news-meta .icon-btn { margin-left: auto; }
.news-item h2 { margin: 6px 0 8px; }
.news-item h2 a { text-decoration: none; }
.news-item h2 a:hover { color: var(--accent); }
/* Первые 4 строки текста */
.news-excerpt { white-space: pre-line; margin: 0 0 12px; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; line-clamp: 4; overflow: hidden; }
.badge { font-size: var(--fs-note); border: 1px solid var(--hair-strong); border-radius: var(--radius); padding: 1px 8px; }
.news-full { max-width: 820px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 20px 24px; }
.news-full h1 { margin: 6px 0 14px; }
.news-body img, .editor-area img { max-width: 100%; height: auto; border-radius: var(--radius); display: block; margin: 10px 0; }
.news-body h3, .editor-area h3 { font-family: var(--serif); font-weight: 400; font-size: var(--fs-title); margin: 18px 0 8px; }
.news-body a, .editor-area a { color: var(--accent); }
.news-form { max-width: 820px; }
.news-form .field { display: flex; flex-direction: column; gap: 4px; margin: 0 0 14px; }
.news-form .field > label { font-size: var(--fs-note); color: var(--muted); }
.news-form input[type=text] { width: 100%; }
.news-form .checkbox-field label { display: inline-flex; gap: 8px; align-items: center; font-size: var(--fs-main); color: var(--ink); }
.editor { border: 1px solid var(--hair-mid); border-radius: var(--radius); background: var(--surface); }
.editor-toolbar { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px; border-bottom: 1px solid var(--hair); background: var(--canvas); }
.editor-toolbar button { background: var(--surface); border-color: var(--hair-strong); color: var(--ink); padding: 4px 10px; }
.editor-toolbar button:hover { background: var(--wash); border-color: var(--hair-strong); color: var(--ink); }
.editor-area { min-height: 260px; padding: 12px 14px; outline: none; }
.editor-area:focus { box-shadow: inset 0 0 0 2px var(--accent-soft); }
.editor-area p { margin: 0 0 10px; }
