/* Рабочие места CRM: вход, календарь, правки, анкета на планшете. Палитра и шрифт — в brand.css. Вид — как у
   страниц для клиентов (D-138, D-144): тёплый фон-фото сайта, шапка-«стекло» с логотипом по центру, крупные
   тонкие заголовки, стеклянные карточки и поля, кнопки-таблетки. */

:root {
  --desk-hh: 72px;
  --desk-glass: rgba(255, 255, 255, 0.46);
  --desk-edge: rgba(255, 255, 255, 0.72);
  --desk-shadow: 0 12px 40px rgba(90, 64, 44, 0.1);
}

body.desk {
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  background: var(--sand);
}

/* Фон — то же тёплое фото, что на сайте и в записи, осветлённое кремом; у шапки и внизу растворяется. */
body.desk::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(rgba(243, 232, 218, 0.76), rgba(243, 232, 218, 0.76)),
    #d9b98f url("/assets/sky-gold.jpg") center 40% / cover no-repeat;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 80%, transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 16%, #000 80%, transparent 100%);
}

/* Скрытое атрибутом hidden скрыто всегда — даже у кнопок со своим display. */
[hidden] {
  display: none !important;
}

/* Шапка — «стекло» сайта: логотип слева, меню-таблетки в одну строку посередине, «Выйти» справа; на
   планшете в режиме анкеты — только логотип по центру, как у страниц для клиентов. */
.desk-top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.6rem 1.25rem;
  min-height: var(--desk-hh);
  padding: 0.6rem 1.5rem;
  background: rgba(243, 232, 218, 0.74);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6),
    0 8px 30px rgba(90, 64, 44, 0.06);
}
.desk-top .brand {
  grid-column: 1;
  grid-row: 1;
  text-decoration: none;
}
.kiosk .desk-top {
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
}
.kiosk .desk-top .brand {
  grid-column: 2;
}
.desk-top .brand-main {
  font-size: 20px;
  letter-spacing: 0.3em;
  margin-right: -0.3em;
}
.desk-top .brand-sub {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 0.38em;
  margin-right: -0.38em;
  color: var(--ink);
  opacity: 0.75;
}
/* Меню — «таблетки», как вкладки на сайте; открытый раздел — светлая таблетка с тенью. */
.desk-nav {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.15rem;
  justify-self: center;
}
.desk-nav a {
  color: var(--mocha-soft);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  border-radius: var(--pill);
  font-size: 0.9rem;
  white-space: nowrap;
  transition:
    background-color 0.2s,
    color 0.2s;
}
.desk-nav a:hover {
  background: rgba(255, 255, 255, 0.6);
  color: var(--ink);
}
.desk-nav a.current {
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-weight: 500;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.95),
    0 4px 14px rgba(90, 64, 44, 0.08);
}
.desk-top form {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  margin: 0;
}
.desk-top form button.link {
  padding: 0.45rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  font-size: 0.9rem;
}

.desk-main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 2.25rem 1.5rem 3.5rem;
}
.desk-main h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.1rem, 3.8vw, 3rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
  margin: 0 0 1.4rem;
}
.desk-main h2 {
  font-weight: 500;
  font-size: 1.2rem;
  margin: 1.75rem 0 0.75rem;
}

/* Карточки — «стекло» сайта: полупрозрачные, со светлой каймой и мягкой тенью. */
.card {
  background: var(--desk-glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid var(--desk-edge);
  border-radius: 22px;
  box-shadow: var(--desk-shadow);
  padding: 1.3rem 1.5rem;
  margin: 0 0 1.1rem;
}
.desk-main .card > h2:first-child {
  margin-top: 0.25rem;
}
.languages {
  display: flex;
  gap: 1rem;
}
.lead {
  color: var(--mocha-soft);
  margin: 0 0 1rem;
}
.desk-main a:not(.button):not(.time) {
  color: var(--ink);
  text-decoration-color: var(--gold-soft);
  text-underline-offset: 0.18em;
}
.muted {
  color: var(--muted);
}

label.field {
  display: block;
  margin: 0 0 0.9rem;
}
label.field span {
  display: block;
  font-size: 0.88rem;
  color: var(--mocha-soft);
  margin-bottom: 0.3rem;
}
input,
select,
textarea {
  font: inherit;
  width: 100%;
  max-width: 28rem;
  padding: 0.7rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: 0 6px 20px rgba(90, 64, 44, 0.05);
  color: var(--ink);
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(205, 185, 149, 0.35);
}
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Кнопки — «таблетки» сайта: тёмно-коричневая главная, светлая второстепенная. */
button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  font: inherit;
  font-weight: 500;
  padding: 0.6rem 1.4rem;
  border: 1px solid transparent;
  border-radius: var(--pill);
  background: rgba(59, 42, 33, 0.92);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  transition:
    background-color 0.2s,
    box-shadow 0.2s;
}
button:hover,
.button:hover {
  background: var(--ink-deep);
}
button.secondary,
.button.secondary {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  box-shadow: 0 6px 20px rgba(90, 64, 44, 0.08);
}
button.secondary:hover,
.button.secondary:hover {
  background: #fff;
}
button.danger {
  background: var(--danger);
}
button.link {
  min-height: 0;
  background: none;
  border: 0;
  color: var(--ink);
  padding: 0.25rem 0;
  font-weight: 400;
  text-decoration: underline;
  text-decoration-color: var(--gold-soft);
  text-underline-offset: 0.18em;
}
button.link:hover {
  background: none;
  color: var(--ink-deep);
}
button[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
}

.error {
  padding: 0.85rem 1.15rem;
  border: 1px solid var(--desk-edge);
  border-radius: 16px;
  background: rgba(246, 227, 223, 0.9);
  color: var(--danger);
}
.notice {
  padding: 0.85rem 1.15rem;
  border: 1px solid var(--desk-edge);
  border-radius: 16px;
  background: rgba(234, 238, 223, 0.9);
  color: var(--ok);
}

.codes {
  columns: 2;
  font:
    1.1rem / 2 ui-monospace,
    "SF Mono",
    Menlo,
    monospace;
  padding-left: 1.5rem;
}

@media print {
  .desk-top,
  button,
  .no-print {
    display: none;
  }
  body {
    background: #fff;
  }
}

/* Календарь дня и записи (G1). */
.day-nav,
.weeks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 0.5rem;
}
.day-nav a,
.weeks a {
  color: var(--mocha);
}
.bookings {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
  display: grid;
  gap: 0.5rem;
}
.booking-link {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.15rem 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 4px solid var(--gold);
  border-radius: var(--r);
  color: var(--ink);
  text-decoration: none;
}
.booking.pending .booking-link {
  border-left-color: var(--taupe);
}
.booking.cancelled .booking-link,
.booking.no_show .booking-link {
  border-left-color: var(--line);
  color: var(--muted);
}
.booking .slot {
  font-weight: 600;
  grid-row: span 3;
}
.booking .what,
.booking .meta {
  font-size: 0.9rem;
  color: var(--mocha);
}
.badge {
  display: inline-block;
  padding: 0 0.5rem;
  border-radius: 999px;
  background: var(--cashmere);
  color: var(--mocha);
  font-size: 0.8rem;
}
.badge.confirmed,
.badge.done {
  background: #e6ede2;
  color: var(--ok);
}
.badge.cancelled,
.badge.no_show,
.badge.low {
  background: #f6e3df;
  color: var(--danger);
}
.lines {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
}
.lines li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--line);
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.actions form {
  margin: 0;
}
.times {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.times form {
  margin: 0;
}
.time {
  display: inline-block;
  min-width: 4.5rem;
  padding: 0.5rem 0.75rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
  color: var(--ink);
  font-weight: 500;
  text-decoration: none;
}
button.time {
  color: var(--ink);
}
fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 1rem;
}
legend {
  font-weight: 500;
  margin-bottom: 0.5rem;
}
/* Выбор зон в «Записать клиентку» — как на странице записи (D-116): карточки-«стекло» в две колонны. */
form[data-selection] legend {
  margin-bottom: 0.6rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--gold);
}
.items {
  display: grid;
  gap: 0.55rem;
}
@media (min-width: 40rem) {
  .items {
    grid-template-columns: 1fr 1fr;
  }
}
label.item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.1rem 0.85rem;
  align-items: center;
  padding: 0.8rem 1rem;
  margin: 0;
  background: var(--glass);
  border: 1px solid var(--glass-line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition:
    background-color 0.2s,
    border-color 0.2s,
    box-shadow 0.2s;
}
label.item:hover {
  background: rgba(255, 255, 255, 0.85);
}
label.item:has(input:checked) {
  background: #fff;
  border-color: var(--gold);
  box-shadow:
    0 0 0 1px var(--gold),
    var(--shadow-soft);
}
label.item input {
  width: 1.2rem;
  height: 1.2rem;
  margin: 0;
  grid-row: span 2;
  accent-color: var(--ink);
}
label.item .name {
  font-family: var(--display);
  font-weight: 500;
}
label.item .meta {
  font-size: 0.85rem;
  color: var(--muted);
}
/* Пояснение у позиции (D-112, D-140): «вместо …» — что она сняла; «уже входит в …». */
label.item .hint {
  grid-column: 2;
  color: var(--mocha-soft);
  font-size: 0.84rem;
}
/* Уже входит в отмеченную позицию: спокойнее, но нажать можно — тогда снимется большая. */
label.item.included {
  background: rgba(255, 255, 255, 0.3);
  box-shadow: none;
}
/* Вся группа уже входит в выбранное (D-112): одна подсказка под заголовком. */
.group-hint {
  margin: 0 0 0.5rem;
  color: var(--mocha-soft);
  font-size: 0.9rem;
}
/* Итог и «дальше» (D-117) — панель-«стекло» внизу экрана, как на странице записи: слева что выбрано
   и цена, справа кнопка. Едет вместе с прокруткой, пока видна форма; в конце формы встаёт под ней. */
.next {
  position: sticky;
  bottom: calc(0.75rem + env(safe-area-inset-bottom));
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1rem;
  margin: 1.25rem 0 0;
  padding: 0.55rem 0.55rem 0.55rem 1.15rem;
  background: rgba(255, 255, 255, 0.84);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  backdrop-filter: blur(16px) saturate(1.15);
  border: 1px solid var(--glass-line);
  border-radius: 22px;
  box-shadow: 0 12px 32px rgba(59, 42, 33, 0.16);
}
/* Итог занимает свободное место, кнопка — по своему тексту; не хватает места — кнопка ниже во всю ширину. */
.next-total {
  display: grid;
  flex: 999 1 8.5rem;
  min-width: 0;
  margin: 0;
  line-height: 1.3;
}
.next-line {
  color: var(--mocha-soft);
  font-size: 0.85rem;
}
.next-price {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
}
.next-price:empty {
  display: none;
}
.next button {
  flex: 1 0 auto;
  transition:
    background-color 0.25s,
    color 0.25s,
    box-shadow 0.25s,
    transform 0.25s;
}
/* «Дальше» приглушена, пока идти дальше нельзя (D-118): на «Зонах» не отмечено ни одной позиции,
   на «Контактах» не заполнены обязательные поля и согласие. Нажать можно — подскажут, чего не хватает. */
form[data-selection]:not(:has(input[name="items"]:checked)) .next button,
form:invalid .next button {
  background: var(--cashmere);
  color: var(--muted);
  box-shadow: none;
}
/* Можно идти дальше — кнопка «загорается»: бронзовое свечение и одна вспышка. */
form[data-selection]:has(input[name="items"]:checked) .next button,
form:not([data-selection]):valid .next button {
  box-shadow:
    0 0 0 3px rgba(205, 185, 149, 0.55),
    0 10px 24px rgba(59, 42, 33, 0.3);
}
@media (prefers-reduced-motion: no-preference) {
  form[data-selection]:has(input[name="items"]:checked) .next button,
  form:not([data-selection]):valid .next button {
    animation: next-ready 0.7s ease-out;
  }
}
@keyframes next-ready {
  0% {
    transform: scale(0.97);
    box-shadow:
      0 0 0 0 rgba(205, 185, 149, 0.9),
      0 10px 24px rgba(59, 42, 33, 0.3);
  }
  55% {
    transform: scale(1.04);
    box-shadow:
      0 0 0 12px rgba(205, 185, 149, 0),
      0 10px 24px rgba(59, 42, 33, 0.3);
  }
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 3px rgba(205, 185, 149, 0.55),
      0 10px 24px rgba(59, 42, 33, 0.3);
  }
}
/* Прокрутка к полю (Tab, подсказка браузера) — не под панель. */
html:has(.next) {
  scroll-padding-bottom: 8rem;
}
/* Шаги новой записи (D-113, D-122) — полоса-«стекло», как на странице записи: номер в кружке, под ним
   название. Шаг, для которого всё выбрано, нажимается — назад и вперёд; текущий — тёмный; недоступный — бледный. */
.steps ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.25rem;
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0.3rem;
  background: rgba(255, 255, 255, 0.5);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
  backdrop-filter: blur(14px) saturate(1.1);
  border: 1px solid var(--glass-line);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}
.steps li > a,
.steps li > button,
.steps li > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  min-height: 3.5rem;
  margin: 0;
  padding: 0.45rem 0.25rem;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.15;
  text-align: center;
  text-decoration: none;
  transition:
    background-color 0.2s,
    color 0.2s,
    opacity 0.2s;
}
.steps .step-n {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(235, 226, 214, 0.8);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}
.desk-main .steps li.step-open > a,
.steps .step-open > button {
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.desk-main .steps li.step-open > a:hover,
.steps .step-open > button:hover {
  background: rgba(255, 255, 255, 0.85);
}
.steps .step-open .step-n {
  background: var(--gold-soft);
  color: var(--ink);
}
.steps .step-current > span {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 18px rgba(59, 42, 33, 0.25);
}
.steps .step-current .step-n {
  background: var(--gold);
  color: #fff;
}
.steps .step-closed > span {
  opacity: 0.6;
}
/* Шаги впереди на «Зонах» приглушены, пока ничего не отмечено (D-122). */
form[data-selection]:not(:has(input[name="items"]:checked)) .step-ahead > button {
  opacity: 0.45;
  pointer-events: none;
}
/* Время, выбранное раньше, и выбранное «для кого» — с бронзовой каймой (D-122). */
.desk-main a.time.chosen {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: 0 0 0 3px rgba(205, 185, 149, 0.55);
}
.audiences .chosen {
  box-shadow:
    0 0 0 3px rgba(205, 185, 149, 0.55),
    0 10px 24px rgba(59, 42, 33, 0.25);
}
label.consent {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0.5rem 0 1rem;
}
label.consent input {
  width: auto;
  margin-top: 0.3rem;
}
.invalid input,
.invalid select {
  border-color: var(--danger);
}
.audiences {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* Каталог и график (G2). */
.catalog {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
}
.catalog-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.1rem 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.catalog-item .meta {
  font-size: 0.85rem;
  color: var(--mocha);
  grid-column: 1;
}
.catalog-item .row-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.catalog-item .row-actions form {
  margin: 0;
}
.catalog-item.off {
  opacity: 0.55;
}
.weekday {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: center;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.weekday .day-name {
  min-width: 8rem;
  font-weight: 500;
}
.ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.range input {
  width: 7.5rem;
}
.exceptions {
  list-style: none;
  padding: 0;
}
.exceptions li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--line);
}
.exceptions form {
  margin: 0;
}
.exception-form {
  margin-top: 1rem;
}
/* Приём на планшете (G1, часть 2): крупно, без меню; подпись пальцем. */
.kiosk .desk-main {
  max-width: 48rem;
  font-size: 1.1rem;
}
/* Раздел анкеты — стеклянная карточка; название раздела — крупно над ней (D-144). */
.form-section {
  min-width: 0;
  margin: 1.25rem 0;
  padding: 1rem 1.5rem 0.75rem;
  background: var(--desk-glass);
  border: 1px solid var(--desk-edge);
  border-radius: 22px;
  box-shadow: var(--desk-shadow);
}
.form-section legend {
  float: left;
  width: 100%;
  margin: 0.25rem 0 0.5rem;
  padding: 0;
  font-family: var(--display);
  font-size: 1.35rem;
  font-weight: 500;
  line-height: 1.25;
}
.form-section legend + * {
  clear: both;
}
.form-section .form-item:last-child {
  border-bottom: 0;
}
/* Документ на двух языках (D-132): немецкий — основной, русский перевод — под ним мельче. */
.kiosk .tr {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.86em;
  font-weight: 400;
  color: var(--muted);
}
/* Текст раздела документа (D-147): абзацы с отступом; перевод — весь под немецким текстом, блоком. */
.form-info p {
  margin: 0 0 0.6rem;
  line-height: 1.5;
}
.form-info p:last-child {
  margin-bottom: 0;
}
.kiosk .form-info .tr {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}
/* Язык анкеты — «таблетка», как у страниц для клиентов; выбранный — белая вкладка (D-144). */
.kiosk .languages {
  display: inline-flex;
  gap: 0.15rem;
  margin: 0 0 1.25rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: var(--pill);
  background: rgba(255, 255, 255, 0.45);
  font-size: 0.95rem;
}
.kiosk .languages > * {
  padding: 0.35rem 1rem;
  border-radius: var(--pill);
  text-decoration: none;
}
.kiosk .languages strong {
  background: rgba(255, 255, 255, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.95),
    0 4px 14px rgba(90, 64, 44, 0.08);
  font-weight: 500;
}
.kiosk .title-tr {
  margin: -0.5rem 0 1rem;
  font-size: 1.05rem;
  color: var(--muted);
}
.choice.options {
  flex-direction: column;
  gap: 0.6rem;
}
.choice.options label {
  align-items: flex-start;
}
/* Язык документа выбирают кнопками DE / RU (D-135). */
.choose-language {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.kiosk .notice.prefilled {
  margin-bottom: 1rem;
}
/* Несколько галочек (D-133): на планшете — колонками, на телефоне — столбиком. */
.choice.options.multi {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr));
  gap: 0.6rem 1.5rem;
}
.form-item {
  display: block;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
}
.form-item.invalid {
  border-left: 4px solid var(--danger);
  padding-left: 0.75rem;
}
.form-item.check {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}
.form-item input[type="checkbox"],
.choice input[type="radio"] {
  width: 1.6rem;
  height: 1.6rem;
  flex: none;
}
.choice {
  display: flex;
  gap: 2rem;
  margin: 0.5rem 0;
}
.lines.messages li span {
  white-space: pre-line;
}
form.inline {
  display: inline;
  margin: 0;
}
.period-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.75rem;
  align-items: flex-end;
}
.period-form button {
  margin-bottom: 0.9rem;
}
.norm-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 0 0.75rem;
  margin: 0;
}
.choice.wrap {
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}
.lines li.reversed {
  color: var(--muted);
}
.choice label {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  font-size: 1.1rem;
}
.form-item textarea,
.details textarea {
  width: 100%;
  margin-top: 0.4rem;
}
.signature {
  margin: 1.5rem 0;
}
.signature {
  padding: 1rem 1.5rem 1.25rem;
  background: var(--desk-glass);
  border: 1px solid var(--desk-edge);
  border-radius: 22px;
  box-shadow: var(--desk-shadow);
}
.signature canvas {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 1;
  border: 1px solid rgba(168, 143, 104, 0.35);
  border-radius: 16px;
  background: #fff;
  touch-action: none;
}
.signature button {
  margin-top: 0.5rem;
}
.kiosk .submit {
  width: 100%;
  font-size: 1.15rem;
  padding: 1rem;
}
.forms {
  list-style: none;
  padding: 0;
}
.forms li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
/* Процедура (G1, часть 2): параметры по зонам в одну строку на широком экране. */
.zone-params {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0.5rem 1rem;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 0.75rem 0;
  margin: 0;
}
.zone-params legend {
  font-weight: 600;
  padding-top: 0.75rem;
}
.zone-params label > input {
  width: 100%;
}
/* Фото до/после (G1, часть 2): маленькие снимки в карточке, крупный — при удалении. */
.photos {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  gap: 1rem;
}
.photos li {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
}
.photos img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: var(--r);
  border: 1px solid var(--line);
}
.photo-large {
  max-width: 100%;
  max-height: 60vh;
  border-radius: var(--r);
}

/* Побочные эффекты процедуры (D-094): выделены, чтобы их было видно сразу. */
.side-effects {
  padding: 0.6rem 0.8rem;
  border-left: 3px solid var(--danger);
  background: #fbf1ee;
  border-radius: 0 var(--r) var(--r) 0;
}

/* «Клиенты» (G1, часть 5): поиск, карточка, визиты, «До/После». */
.client-search input[type="search"] {
  max-width: none;
  font-size: 1.1rem;
}
.client-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}
.client-list a {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding: 0.75rem 1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  text-decoration: none;
}
.client-list a:hover,
.client-list a:focus-visible {
  border-color: var(--gold);
}
.client-list .who {
  font-weight: 600;
  color: var(--ink);
}
.sms-toggle {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.25rem 0.75rem;
  margin: 0 0 1rem;
}
.client-head h2 {
  margin-top: 0;
}
.client-stats {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2rem;
}
.client-stats li {
  display: flex;
  flex-direction: column;
}
.client-stats .stat-label {
  font-size: 0.85rem;
  color: var(--muted);
}
/* Вкладки — «таблетки» в светлой капсуле, как меню сайта; открытая — белая, с тенью (D-116). */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 1.25rem;
  padding: 0.3rem;
  border: 1px solid var(--glass-line);
  border-radius: 1.6rem;
  background: rgba(255, 255, 255, 0.45);
  box-shadow: var(--shadow-soft);
}
.desk-main .tabs a {
  padding: 0.5rem 1.05rem;
  border-radius: var(--pill);
  color: var(--mocha-soft);
  text-decoration: none;
  transition:
    background-color 0.2s,
    color 0.2s;
}
.desk-main .tabs a:hover {
  background: rgba(255, 255, 255, 0.75);
  color: var(--ink);
}
.desk-main .tabs a.current {
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.95),
    0 4px 14px rgba(90, 64, 44, 0.1);
}
.visit h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.visit.cancelled,
.visit.no_show {
  opacity: 0.75;
}
.zone-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.75rem;
}
.zone-pick label.field {
  margin: 0;
  flex: 1 1 14rem;
}
.photos.gallery {
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
}
.compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.compare figure {
  margin: 0;
}
.compare img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--r);
  border: 1px solid var(--line);
}
.compare figcaption {
  font-size: 0.9rem;
  margin-top: 0.3rem;
}

/* Фото на весь экран (assets/gallery.js). */
body.viewing {
  overflow: hidden;
}
.viewer {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20, 16, 13, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y pinch-zoom;
}
.viewer-image {
  max-width: 100vw;
  max-height: calc(100vh - 5.5rem);
  object-fit: contain;
  user-select: none;
}
.viewer button {
  position: absolute;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  padding: 0;
  font-size: 1.8rem;
  line-height: 1;
}
.viewer button[disabled] {
  opacity: 0.25;
}
.viewer-close {
  top: 0.75rem;
  right: 0.75rem;
}
.viewer-previous {
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}
.viewer-next {
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
}
.viewer-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 1rem;
  align-items: baseline;
  padding: 0.75rem 1.25rem;
  color: #fff;
}
.viewer-caption {
  margin: 0;
}
.viewer-counter {
  color: rgba(255, 255, 255, 0.7);
  font-variant-numeric: tabular-nums;
}

/* Календарь на всю ширину (G1, шаг 13): «День — Неделя — Месяц». Место блоков — calendar.css. */
.desk-main.wide {
  max-width: none;
}
.cal-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  margin: 0 0 0.75rem;
}
.cal-nav {
  display: flex;
  gap: 0.35rem;
}
.cal-nav .button {
  padding: 0.5rem 0.9rem;
}
.cal-title {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 1.2rem;
}
.cal-views {
  display: inline-flex;
  background: var(--cashmere);
  border-radius: 999px;
  padding: 0.2rem;
}
.cal-views a {
  padding: 0.4rem 1rem;
  border-radius: 999px;
  text-decoration: none;
  color: var(--mocha);
}
.cal-views a.current {
  background: var(--bg);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}
.cal-actions {
  margin: 0 0 1rem;
}
.calendar {
  --slot: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.calendar.day {
  --slot: 6px;
}
.cal-grid {
  display: grid;
}
.cal-grid.cols-1 {
  grid-template-columns: 3.5rem minmax(0, 1fr);
}
.cal-grid.cols-7 {
  grid-template-columns: 3.5rem repeat(7, minmax(0, 1fr));
}
.cal-corner,
.cal-head {
  border-bottom: 1px solid var(--line);
}
.cal-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.15rem 0.4rem;
  padding: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  border-left: 1px solid var(--line);
  min-width: 0;
}
.cal-head .dow {
  color: var(--muted);
  text-transform: uppercase;
  font-size: 0.8rem;
}
.cal-head .dnum {
  font-size: 1.15rem;
  font-weight: 600;
}
.cal-head.today .dnum {
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  padding: 0 0.45rem;
}
.cal-fill {
  font-size: 0.8rem;
  color: var(--mocha);
  width: 100%;
}
.calendar meter {
  width: 100%;
  height: 0.4rem;
}
.cal-hours,
.cal-col {
  position: relative;
}
.cal-hours span {
  position: absolute;
  right: 0.4rem;
  font-size: 0.75rem;
  color: var(--muted);
  transform: translateY(-50%);
}
.cal-hours span.at-0 {
  transform: none;
}
.cal-col {
  border-left: 1px solid var(--line);
  background-image: repeating-linear-gradient(
    to bottom,
    var(--line) 0,
    var(--line) 1px,
    transparent 1px,
    transparent calc(var(--slot) * 12)
  );
}
.cal-col.today {
  background-color: rgba(255, 255, 255, 0.55);
}
.cal-off,
.cal-closed,
.cal-booking,
.cal-now {
  position: absolute;
  left: 0;
  right: 0;
}
.cal-off {
  background: rgba(163, 147, 132, 0.12);
}
.cal-closed {
  left: 2px;
  right: 2px;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.8rem;
  color: var(--mocha);
  text-decoration: none;
  background: repeating-linear-gradient(
    135deg,
    rgba(94, 75, 63, 0.14) 0,
    rgba(94, 75, 63, 0.14) 6px,
    rgba(94, 75, 63, 0.05) 6px,
    rgba(94, 75, 63, 0.05) 12px
  );
  border: 1px dashed var(--taupe);
}
.cal-booking {
  left: 3px;
  right: 3px;
  z-index: 1;
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.8rem;
  line-height: 1.25;
  text-decoration: none;
  color: var(--ink);
  background: #f3ead9;
  border-left: 3px solid var(--gold);
}
.cal-booking.pending {
  background: #fbf8f2;
  border: 1px dashed var(--taupe);
  border-left: 3px solid var(--taupe);
}
.cal-booking.done {
  background: #e6ede2;
  border-left-color: var(--ok);
}
.cal-booking.no_show {
  background: #f1eeec;
  border-left-color: var(--muted);
  color: var(--muted);
}
.cal-booking .what {
  color: var(--mocha);
}
.calendar.day .cal-booking,
.calendar.day .cal-closed {
  font-size: 0.95rem;
  padding: 0.3rem 0.6rem;
}
.cal-now {
  z-index: 2;
  height: 2px;
  background: var(--danger);
}
.month-head,
.month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}
.month-head span {
  padding: 0.4rem 0.5rem;
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
}
.month-day {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 7.5rem;
  min-width: 0;
  padding: 0.35rem 0.45rem;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}
.month-day.other {
  background: #faf8f5;
  color: var(--muted);
}
.month-day.dayOff,
.month-day.closed {
  background-color: #f6f3ef;
}
.month-day.closed {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(94, 75, 63, 0.08) 0,
    rgba(94, 75, 63, 0.08) 6px,
    transparent 6px,
    transparent 12px
  );
}
.month-day .day-top {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.month-day .dnum {
  font-weight: 600;
}
.month-day .count {
  display: none;
}
.month-day.today .dnum {
  color: #fff;
  background: var(--ink);
  border-radius: 999px;
  padding: 0 0.45rem;
}
.month-day .chips {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  display: grid;
  gap: 0.1rem;
}
.month-day .chips li {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-left: 3px solid var(--gold);
  padding-left: 0.3rem;
}
.month-day .chips li.pending {
  border-left-color: var(--taupe);
}
.month-day .chips li.done {
  border-left-color: var(--ok);
}
.month-day .chips li.more {
  border-left-color: transparent;
  color: var(--muted);
}
.cal-cancelled {
  margin-top: 1rem;
}
.time-off-form .time-range {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}
.time-off-form .time-range label.field {
  flex: 1 1 9rem;
}
/* Видны поля только выбранного вида; без поддержки :has() видны оба — сервер возьмёт нужные. */
.time-off-form:has(input[value="hours"]:checked) .time-off-days,
.time-off-form:has(input[value="days"]:checked) .time-off-hours {
  display: none;
}

/* Телефон: те же виды, плотнее — неделя и месяц без подписей, только время, число и заполненность. */
@media (max-width: 640px) {
  .cal-grid.cols-7,
  .cal-grid.cols-1 {
    grid-template-columns: 2.4rem repeat(7, minmax(0, 1fr));
  }
  .cal-grid.cols-1 {
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }
  .cal-head {
    flex-direction: column;
    align-items: center;
    gap: 0.1rem;
    padding: 0.3rem 0.15rem;
    text-align: center;
  }
  .week .cal-booking .end {
    display: none;
  }
  .week .cal-head .cal-fill {
    display: none;
  }
  .week .cal-booking {
    left: 1px;
    right: 1px;
    padding: 0.1rem 0.15rem;
    font-size: 0.65rem;
  }
  .week .cal-booking .who,
  .week .cal-booking .what,
  .week .cal-closed span {
    display: none;
  }
  .week .cal-closed {
    font-size: 0.6rem;
    padding: 0.1rem;
  }
  .cal-hours span {
    font-size: 0.65rem;
    right: 0.2rem;
  }
  .month-day {
    min-height: 4.2rem;
    padding: 0.25rem;
  }
  .month-day .chips,
  .month-day .cal-fill {
    display: none;
  }
  .month-day .count {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--cashmere);
    color: var(--mocha);
    border-radius: 999px;
    padding: 0 0.35rem;
  }
}

/* Цены материала и «Чек или накладная» (G2, шаг 14). */
.catalog-item .meta.prices {
  color: var(--mocha);
}
.prices-fields {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
}
.delivery-upload label.button {
  cursor: pointer;
}
.delivery-line legend {
  font-weight: 600;
}
.delivery-line .time-range {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1rem;
}
.delivery-line .time-range label.field {
  flex: 1 1 10rem;
}
/* Поля нового материала нужны, только если выбран «новый материал»; без :has() видны всегда. */
.delivery-line:has(select[name^="material-"] option:not([value=""]):checked) .new-material {
  display: none;
}

/* Телефон: строки каталога, склада и норм — в один столбец, действия под названием. */
@media (max-width: 640px) {
  .catalog-item {
    grid-template-columns: minmax(0, 1fr);
  }
  .catalog-item .row-actions {
    grid-column: 1;
    grid-row: auto;
    flex-wrap: wrap;
    gap: 0.25rem 0.9rem;
    padding-top: 0.25rem;
  }
}

/* Страница во всю высоту окна (D-105): «День» календаря растягивается до низа экрана. */
body.fill {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}
body.fill .desk-main {
  flex: 1;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 1rem;
}
body.fill .calendar.day {
  flex: 1;
  min-height: 16rem;
  display: flex;
  flex-direction: column;
}
body.fill .calendar.day .cal-grid {
  flex: 1;
  min-height: 0;
  grid-template-rows: auto minmax(0, 1fr);
}
/* Заголовок календаря виден в меню — на странице он только для чтения с экрана. */
.desk-main.wide > h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.cal-pick {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}
.cal-pick select {
  width: auto;
  padding: 0.45rem 0.6rem;
}
.cal-title {
  flex: 0 1 auto;
}
.calendar.day .cal-head {
  padding: 0.35rem 0.5rem;
}

/* Телефон: меню — одной строкой с прокруткой вбок; календарь — плотнее, чтобы день помещался. */
@media (max-width: 640px) {
  .desk-top {
    padding: 0.5rem 0.75rem;
    gap: 0.4rem 0.75rem;
  }
  .desk-top .logo {
    height: 28px;
  }
  .desk-top form {
    margin-left: auto;
  }
  .desk-nav {
    order: 3;
    flex: 1 0 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    white-space: nowrap;
    gap: 0 1rem;
    scrollbar-width: none;
  }
  .desk-main {
    padding: 0.75rem 0.75rem 1.5rem;
  }
  .cal-toolbar {
    gap: 0.4rem 0.5rem;
    margin-bottom: 0.4rem;
  }
  .cal-nav .button {
    padding: 0.35rem 0.7rem;
  }
  .cal-title {
    order: 4;
    flex: 1 0 100%;
    font-size: 1rem;
  }
  .cal-pick {
    order: 5;
  }
  .cal-views a {
    padding: 0.3rem 0.7rem;
  }
  .cal-actions {
    margin-bottom: 0.5rem;
  }
  .cal-actions .button {
    padding: 0.4rem 0.75rem;
    font-size: 0.9rem;
  }
  body.fill .desk-main > p.muted {
    margin: 0 0 0.4rem;
    font-size: 0.85rem;
  }
}

/* Панель календаря (D-105): период, вид, месяц и год, действия — одной полосой, переносится по ширине. */
.cal-when {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.75rem;
}
.cal-toolbar .cal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 0 auto;
}
.cal-cancelled {
  position: relative;
}
.cal-cancelled summary {
  cursor: pointer;
  color: var(--mocha);
  padding: 0.4rem 0.6rem;
}
.cal-cancelled ul {
  position: absolute;
  right: 0;
  z-index: 5;
  min-width: 14rem;
  margin: 0.25rem 0 0;
  padding: 0.5rem 0.75rem;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--r);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.calendar.day .cal-head {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  text-align: left;
}
.calendar.day .cal-head .cal-fill {
  width: auto;
}
.calendar.day .cal-head meter {
  flex: 1 0 100%;
}
/* Запись — не тоньше строки текста, даже короткая. */
.calendar.day .cal-booking,
.calendar.day .cal-closed {
  min-height: 1.4em;
  padding-top: 0.1rem;
  padding-bottom: 0.1rem;
  white-space: nowrap;
  text-overflow: ellipsis;
}

@media (max-width: 640px) {
  .cal-toolbar .cal-actions {
    margin: 0;
  }
  .cal-when {
    flex: 1 0 100%;
    justify-content: space-between;
  }
  .cal-when .cal-title {
    order: 0;
    flex: 0 1 auto;
    font-size: 0.95rem;
  }
  .cal-pick select {
    padding: 0.3rem 0.4rem;
    font-size: 0.9rem;
  }
  .cal-views a {
    padding: 0.3rem 0.55rem;
    font-size: 0.9rem;
  }
  .cal-nav .button {
    padding: 0.3rem 0.55rem;
  }
  .calendar.day .cal-booking,
  .calendar.day .cal-closed {
    font-size: 0.8rem;
  }
}

/* Склад таблицей и «батарейка» запаса (шаг 16, D-106, D-107). */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
/* Таблице склада нужно место: страница шире обычной. */
.desk-main:has(> .stock-card) {
  max-width: 72rem;
}
.tab-count {
  display: inline-block;
  min-width: 1.5em;
  margin-left: 0.3rem;
  padding: 0 0.45em;
  border-radius: 999px;
  background: var(--cashmere);
  color: var(--mocha);
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.5em;
  text-align: center;
}
.tabs a.current .tab-count {
  background: var(--gold);
  color: #fff;
}
.stock-card {
  padding: 0.25rem 0;
  overflow: hidden;
}
.stock-card > p {
  padding: 0 1.25rem;
}
.stock-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.stock-table thead th {
  padding: 0.7rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.stock-table tbody th,
.stock-table tbody td {
  padding: 0.8rem 0.75rem;
  text-align: left;
  font-weight: 400;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
}
.stock-table tbody td {
  white-space: nowrap;
}
.stock-table tr > :first-child {
  padding-left: 1.25rem;
}
.stock-table tr > :last-child {
  padding-right: 1.25rem;
}
.stock-table tbody tr:last-child > * {
  border-bottom: 0;
}
.stock-table tbody tr {
  transition: background-color 0.15s;
}
.stock-table tbody tr:hover {
  background: #fbf8f4;
}
.stock-table tbody th a {
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
}
.stock-table tbody th a:hover {
  text-decoration: underline;
}
.stock-table .muted {
  display: block;
  margin-top: 0.1rem;
  font-size: 0.8rem;
}
.stock-table tr.off {
  opacity: 0.55;
}
.stock-table td.row-actions {
  text-align: right;
}
.stock-table td.row-actions a + a {
  margin-left: 0.9rem;
}
.stock-level {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  white-space: nowrap;
}
.stock-level b {
  font-weight: 600;
}

/* Батарейка: корпус с «плюсом» справа; заряд — зелёный, жёлтый, красный. */
.battery {
  --battery: #5f9a4c;
  --battery-light: #8cc075;
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 2.5rem;
  height: 1.15rem;
  padding: 2px;
  margin-right: 4px;
  border: 1.5px solid #b9aea3;
  border-radius: 5px;
  background: var(--bg);
  vertical-align: middle;
}
.battery::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -5px;
  width: 3px;
  height: 0.45rem;
  border-radius: 0 2px 2px 0;
  background: #b9aea3;
  transform: translateY(-50%);
}
.battery.soon {
  --battery: #e0a92e;
  --battery-light: #f2cd6b;
}
.battery.low {
  --battery: #c94f3d;
  --battery-light: #e5806f;
  border-color: #d9a49b;
}
.battery.low::after {
  background: #d9a49b;
}
.battery .charge {
  display: block;
  height: 100%;
  border-radius: 2.5px;
  background: linear-gradient(180deg, var(--battery-light), var(--battery));
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}
.battery .charge.w-0 {
  width: 0%;
}
.battery .charge.w-5 {
  width: 5%;
}
.battery .charge.w-10 {
  width: 10%;
}
.battery .charge.w-15 {
  width: 15%;
}
.battery .charge.w-20 {
  width: 20%;
}
.battery .charge.w-25 {
  width: 25%;
}
.battery .charge.w-30 {
  width: 30%;
}
.battery .charge.w-35 {
  width: 35%;
}
.battery .charge.w-40 {
  width: 40%;
}
.battery .charge.w-45 {
  width: 45%;
}
.battery .charge.w-50 {
  width: 50%;
}
.battery .charge.w-55 {
  width: 55%;
}
.battery .charge.w-60 {
  width: 60%;
}
.battery .charge.w-65 {
  width: 65%;
}
.battery .charge.w-70 {
  width: 70%;
}
.battery .charge.w-75 {
  width: 75%;
}
.battery .charge.w-80 {
  width: 80%;
}
.battery .charge.w-85 {
  width: 85%;
}
.battery .charge.w-90 {
  width: 90%;
}
.battery .charge.w-95 {
  width: 95%;
}
.battery .charge.w-100 {
  width: 100%;
}

/* Инвентаризация: столбцы всех разделов на одной линии; отмеченная строка подсвечена. */
.inventory-table {
  table-layout: fixed;
}
.inventory-table thead th:nth-child(1) {
  width: 7rem;
}
.inventory-table thead th:nth-child(3),
.inventory-table thead th:nth-child(4) {
  width: 14rem;
}
.inventory-table input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--mocha);
}
.inventory-table tbody tr:has(input[type="checkbox"]:checked) {
  background: #fbf7f1;
}
.inventory-table .actual {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  white-space: nowrap;
}
.inventory-table .actual input {
  width: 7.5rem;
  padding: 0.45rem 0.6rem;
}
.inventory-form .card h2 {
  margin: 0.75rem 1.25rem 0.25rem;
}
.inventory-form .card.stock-card {
  padding-bottom: 0;
}

/* Вкладки разделов: в ряд, пока помещаются; уже — плитками. */
@media (max-width: 960px) {
  .stock-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
    gap: 0.4rem;
    width: auto;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }
  .desk-main .stock-tabs a {
    padding: 0.55rem 0.8rem;
    border: 1px solid var(--glass-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.45);
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.3;
  }
}

/* Планшет и телефон: строка таблицы — карточка с подписями полей. */
@media (max-width: 860px) {
  .stock-table thead {
    display: none;
  }
  .stock-table,
  .stock-table tbody,
  .stock-table tr,
  .stock-table tbody th,
  .stock-table tbody td {
    display: block;
  }
  .stock-table tbody tr {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
    gap: 0.6rem 1rem;
    padding: 0.9rem 1rem;
    border-bottom: 1px solid var(--line);
  }
  .stock-table tbody tr:last-child {
    border-bottom: 0;
  }
  .stock-table tbody th,
  .stock-table tbody td,
  .stock-table tr > :first-child,
  .stock-table tr > :last-child {
    padding: 0;
    border: 0;
  }
  .stock-table tbody th {
    grid-column: 1 / -1;
    font-size: 1.02rem;
  }
  .stock-table td[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 0.15rem;
    font-size: 0.7rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .stock-table td.row-actions {
    grid-column: 1 / -1;
    text-align: left;
  }
  .stock-table td.row-actions a {
    display: inline-block;
    padding: 0.25rem 0;
  }
  .inventory-table tbody tr {
    grid-template-columns: 1.6rem 1fr 1fr;
    align-items: end;
  }
  .inventory-table tbody td:first-child {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
  }
  .inventory-table tbody td:first-child::before {
    content: none;
  }
  .inventory-table tbody th {
    grid-column: 2 / -1;
    grid-row: 1;
    align-self: center;
  }
  .inventory-table tbody td:nth-child(3) {
    grid-column: 2;
  }
  .inventory-table tbody td:nth-child(4) {
    grid-column: 3;
  }
  .inventory-table .actual input {
    width: 100%;
    min-width: 0;
  }
  .inventory-form .card h2 {
    margin: 0.75rem 1rem 0.25rem;
  }
}

/* Телефон: кнопки склада — плитками по две. */
@media (max-width: 640px) {
  .stock-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .stock-actions .button {
    padding: 0.65rem 0.5rem;
    text-align: center;
  }
}

/* Вкладки карточек записи и клиентки (шаг 18, D-109). */
.tab-count.alert {
  background: #f6e3df;
  color: var(--danger);
}
.tabs a.current .tab-count.alert {
  background: var(--danger);
  color: #fff;
}
.booking-head .actions {
  margin-top: 0.75rem;
}
.card-tabs {
  flex-wrap: wrap;
}
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0 0 1rem;
}
.subtabs a {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg);
  text-decoration: none;
}
.subtabs a.current {
  border-color: var(--gold);
  background: #fbf7f1;
  font-weight: 600;
}
.doc-list li span {
  color: var(--muted);
  text-align: right;
}
.forms li .muted {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.85rem;
}

/* Просмотр документа: PDF во всю высоту, большой ✕ справа (D-110). */
.doc-viewer {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.doc-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 0 0 0.75rem;
}
.doc-name {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  margin: 0;
}
.doc-name strong {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
}
.doc-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--mocha);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(94, 75, 63, 0.25);
}
/* Цвет ссылок рабочих мест (mocha) крестику не подходит: на тёмном круге он белый. */
.desk-main a.doc-close:not(.button):not(.time) {
  color: #fff;
}
.doc-close:hover {
  background: var(--ink);
}
.doc-frame {
  flex: 1;
  width: 100%;
  min-height: 60vh;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--bg);
}

/* Повторная анкета на планшете: вопрос и два больших ответа (D-111). */
.repeat-choice {
  margin: 1.5rem 0;
}
.repeat-question {
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}
.repeat-answers {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1.5rem;
}
.repeat-answers .button {
  flex: 1 1 14rem;
  padding: 1rem 1.25rem;
  font-size: 1.1rem;
  text-align: center;
}

@media (max-width: 640px) {
  .card-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(6.5rem, 1fr));
    gap: 0.4rem;
    width: auto;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }
  .desk-main .card-tabs a {
    position: relative;
    padding: 0.55rem 0.4rem;
    border: 1px solid var(--glass-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.45);
    margin: 0;
    font-size: 0.9rem;
    text-align: center;
  }
  .card-tabs .tab-count {
    position: absolute;
    top: -0.45rem;
    right: -0.35rem;
    margin: 0;
  }
  .doc-list li {
    flex-direction: column;
    gap: 0.1rem;
  }
  .doc-list li span {
    text-align: left;
  }
  .doc-frame {
    min-height: 70vh;
  }
}

/* Пометка у необязательного поля (D-141). */
.field .optional {
  margin-left: 0.3rem;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 400;
}

/* Телефон и узкий планшет (D-144): логотип сверху по центру, «Выйти» справа, меню — строкой ниже. */
@media (max-width: 899.98px) {
  :root {
    --desk-hh: 64px;
  }

  .desk-top {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    padding: 0.5rem 1rem;
  }

  .desk-top .brand {
    grid-column: 2;
  }

  .desk-nav {
    grid-column: 1 / -1;
    grid-row: 2;
    flex-wrap: nowrap;
    justify-content: flex-start;
    justify-self: stretch;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .desk-nav::-webkit-scrollbar {
    display: none;
  }

  .desk-nav a {
    flex: none;
    white-space: nowrap;
  }

  .desk-top .brand-main {
    font-size: 17px;
    letter-spacing: 0.26em;
    margin-right: -0.26em;
  }

  .desk-top .brand-sub {
    font-size: 8px;
  }

  .desk-main {
    padding: 1.25rem 1rem 3rem;
  }

  .desk-main h1 {
    font-size: 2rem;
  }

  .form-section,
  .signature {
    padding: 0.85rem 1.1rem 0.6rem;
    border-radius: 20px;
  }

  /* Фото на высоком экране — только небо. */
  body.desk::before {
    background-size:
      auto,
      auto 150%;
    background-position:
      0 0,
      center 18%;
  }
}
