@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@1,500;1,600&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --burgundy: #5a2420;
  --burg-a: #6e3127;
  --burg-b: #461b18;
  --copper: #c0673a;
  --cream: #f5ede2;
  --surface: #fffdf9;
  --ink: #2c211d;
  --muted: #8d7d72;
  --hair: #ece0d2;
  --brand: #fe4704;
  --brand-2: #ff7c33;
  --brand-soft: #fdeadf;
  --brand-ink: #b23708;
  --danger: #c0392b;
  --warning: #b8730a;
  --ok: #2f7d4f;
  --maxw: 1360px;
  --pad: 28px;
  --radius: 18px;
  --radius-sm: 12px;
  --radius-lg: 26px;
  --shadow-sm: 0 3px 14px rgba(74, 28, 25, .07);
  --font-sans: 'Inter', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

* { box-sizing: border-box; }

/* Запрещаем двойной тап-зум и прочие «не-двупальцевые» жесты; пинч двумя
   пальцами (continuous zoom) и обычный скролл при manipulation остаются. */
html { touch-action: manipulation; }
/* Страница никогда не шире экрана: iOS расширяет область просмотра, если какой-то элемент
   (например, внутри открытой карточки) вылез за край, и потом не сужает её обратно —
   страница выглядит «отзумленной» и появляется горизонтальный скролл. */
html, body { overflow-x: hidden; max-width: 100%; }
.modal-card { overflow-x: hidden; }

body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--font-sans); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

/* ── Герой (градиентная шапка-зона на каждой странице) ── */
.hero {
  background:
    radial-gradient(135% 165% at 10% 135%, rgba(255, 178, 105, .9) 0%, rgba(240, 105, 40, 0) 48%),
    linear-gradient(116deg, #ff7e3a 0%, #f1530c 46%, #bf3a07 100%);
  padding-bottom: 58px;
}
/* Шапка по ширине контентных блоков (как .wrap и .hero-title). */
.hero-inner { max-width: var(--maxw); margin: 0 auto; padding: 16px var(--pad) 0; }

.appbar {
  display: flex; align-items: center; gap: 16px;
  background: var(--surface); border-radius: 999px;
  padding: 9px 12px 9px 20px; box-shadow: 0 10px 30px rgba(40, 12, 10, .22);
}
/* Лого и дата из шапки убраны — навигация начинается слева. */
.nav { display: flex; gap: 2px; flex: 1; flex-wrap: wrap; }
.navlink {
  font-size: 13px; color: #6b5e53; text-decoration: none;
  padding: 8px 10px; border-radius: 999px; white-space: nowrap; transition: background .15s, color .15s;
}
/* Ховер только там, где есть мышь: на телефоне :hover «залипает» после тапа
   и пункты выглядят подсвеченными не к месту. */
@media (hover: hover) { .navlink:hover { background: #f4ebdf; color: var(--ink); } }
.navlink.on, .navlink.on:hover { background: var(--burgundy); color: #fff; font-weight: 500; }
.appbar-right { display: flex; align-items: center; gap: 12px; flex: none; }
.appbar-add {
  font-size: 14px; font-weight: 500; color: #fff; text-decoration: none;
  background: linear-gradient(135deg, #ff6a2b, #fe4704); padding: 9px 16px; border-radius: 999px;
  box-shadow: 0 5px 14px rgba(254, 71, 4, .28); white-space: nowrap;
}
.appbar-user { display: inline-flex; align-items: center; gap: 4px; background: #f4ebdf; border-radius: 999px; padding: 5px 9px 5px 11px; max-width: 170px; color: var(--ink); }
.appbar-user svg { flex: none; color: var(--muted); }
.appbar-user-sel { border: none; background: none; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; max-width: 124px; padding: 2px 0; text-overflow: ellipsis; }
.appbar-user-sel:focus { outline: none; }
.nav-toggle {
  display: none; flex: none; width: 40px; height: 40px; padding: 0;
  flex-direction: column; justify-content: center; gap: 5px;
  background: var(--surface); border: 1px solid var(--hair); border-radius: 12px; cursor: pointer;
}
.nav-toggle span { display: block; width: 18px; height: 2px; margin: 0 auto; border-radius: 2px; background: var(--ink); transition: transform .2s ease, opacity .2s ease; }
.appbar.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.appbar.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.appbar.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.hero-title { max-width: var(--maxw); margin: 40px auto 0; padding: 0 var(--pad); }
.hero-title h1 { margin: 0; font-size: 48px; font-weight: 700; color: #fff; letter-spacing: -.7px; line-height: 1.04; }

/* ── Контент ── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 28px var(--pad) 64px; }

/* Метрики — тёмно-бордовые карточки */
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
/* Плашки метрик: белая подложка как у остальных карточек + фирменная оранжевая обводка. */
.metric { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 20px 22px; color: var(--ink); box-shadow: var(--shadow-sm); }
.metric-label { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.metric-value { font-size: 32px; font-weight: 700; line-height: 1; letter-spacing: -.5px; color: var(--brand); }
.metric-value.is-danger { color: var(--danger); }

/* Кликабельные карточки дашборда — ведут на свою страницу */
a.metric, a.panel { display: block; text-decoration: none; color: inherit; transition: transform .14s, box-shadow .14s, background .14s, border-color .14s; }
/* Обводочная плашка: при наведении только лёгкий подъём — заливка не появляется. */
a.metric:hover { transform: translateY(-2px); }
a.panel:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(74, 28, 25, .12); border-color: #e6d8c8; }

/* ── Появление страницы ──
   Без затухания «ухода» (которое выглядело как пауза/загрузка): шапка приходит
   сразу, а содержимое мягко всплывает поверх фона. Браузер держит старую
   страницу до готовности новой, так что «пустого» кадра нет. */
@keyframes pg-enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
main.wrap, .login-card, .rev-wrap { animation: pg-enter .38s cubic-bezier(.22, .61, .36, 1) both; }

@media (prefers-reduced-motion: reduce) {
  main.wrap, .login-card, .rev-wrap { animation: none; }
}

/* ── Скелет загрузки (мерцающие плейсхолдеры, пока едут данные) ── */
@keyframes sk-shimmer { from { background-position: 450px 0; } to { background-position: -450px 0; } }
.skeleton {
  display: block;
  background: linear-gradient(100deg, #ece3d6 25%, #f7f1e7 50%, #ece3d6 75%);
  background-size: 900px 100%;
  animation: sk-shimmer 1.3s ease-in-out infinite;
  border-radius: 7px;
}
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }

/* ── Модалка «Работы ученика» (галерея фото + загрузка) ── */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(40, 12, 10, .45); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
/* Пока открыта любая модалка — фон не скроллится (как у чата). Класс вешает shell.js. */
body.modal-open { position: fixed; width: 100%; overflow: hidden; }
.modal-card { position: relative; background: var(--surface); border-radius: var(--radius-lg); width: min(640px, 100%); max-height: 86vh; overflow-y: auto; box-shadow: 0 24px 70px rgba(40, 12, 10, .4); padding: 22px; }
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-title { font-size: 18px; font-weight: 600; color: var(--burgundy); }
.modal-close { background: none; border: none; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; padding: 4px 6px; border-radius: 8px; }
.modal-close:hover { background: #f4ebdf; color: var(--ink); }
.works-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.work-item { position: relative; border: 1px solid var(--hair); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.work-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; background: #f0e8db; }
.work-cap { font-size: 12px; color: var(--ink); padding: 7px 9px; line-height: 1.3; }
/* Работы без фото: компактные пилюли по ширине названия (ряд над плитками с фото) */
.works-chips { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
.work-chip { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 6px 6px 6px 13px; border: 1px solid var(--hair); border-radius: 999px; background: #fbf7f1; color: var(--ink); font-size: 14px; line-height: 1.3; }
.work-chip-name { overflow-wrap: anywhere; }
.work-del { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--muted); font: inherit; font-size: 13px; line-height: 26px; text-align: center; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.work-del:hover { color: #c0392b; }
.work-chip .work-del { position: static; width: 22px; height: 22px; line-height: 22px; font-size: 12px; background: transparent; box-shadow: none; flex: none; }
.works-empty { grid-column: 1 / -1; color: var(--muted); font-size: 14px; padding: 22px 4px; text-align: center; }
.works-upload { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--hair); display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.works-file { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--hair); border-radius: 999px; padding: 11px 16px; cursor: pointer; font-size: 14px; color: var(--ink); background: var(--surface); white-space: nowrap; }
.works-file:hover { background: #f4ebdf; }
.works-title-input { flex: 1; min-width: 160px; height: 44px; border: 1px solid var(--hair); border-radius: 999px; padding: 0 16px; font: inherit; font-size: 16px; background: #fff; color: var(--ink); }
.works-title-input:focus { outline: none; border-color: var(--brand); }

/* Клик по строке клиента → попап */
.data-table.clickable tbody tr.client-row { cursor: pointer; }
.data-table.clickable tbody tr.client-row:hover td { background: #fbf4ec; }
/* Равномерное распределение колонок (Клиенты/Абонементы): Имя слева, Статус справа */
.data-table.clients th:nth-child(1) { width: 36%; }
.data-table.clients th:nth-child(2) { width: 24%; }
.data-table.clients th:nth-child(3) { width: 16%; }
.data-table.clients th:nth-child(4) { width: 24%; }
.data-table.clients th:nth-child(4),
.data-table.clients td:nth-child(4) { text-align: right; }

/* Таблица «Клиенты» с колонкой «Таймер» (5 колонок): статус слева, кнопка справа */
.data-table.clients-t th:nth-child(1) { width: 22%; }
.data-table.clients-t th:nth-child(2) { width: 22%; }
.data-table.clients-t th:nth-child(3) { width: 10%; }
.data-table.clients-t th:nth-child(4) { width: 16%; }
.data-table.clients-t th:nth-child(5) { width: 15%; }
.data-table.clients-t th:nth-child(6) { width: 15%; }
.data-table.clients-t td.lv-cell { color: var(--muted); }
.data-table.clients-t th:nth-child(4),
.data-table.clients-t td:nth-child(4) { text-align: left; }
/* «Тип занятий» может быть длинным — разрешаем перенос строки */
.data-table.clients-t td.st-types-col { white-space: normal; color: var(--muted); }
.data-table.clients-t th.st-act-col,
.data-table.clients-t td.st-act-col { text-align: right; white-space: nowrap; }

/* Информация клиента в попапе */
.cm-info { margin-bottom: 16px; }
.cm-row { display: flex; gap: 14px; padding: 9px 0; border-top: 1px solid var(--hair); font-size: 14px; }
.cm-row:first-child { border-top: none; padding-top: 2px; }
.cm-label { color: var(--muted); flex: none; width: 124px; }
.cm-val { color: var(--ink); flex: 1; word-break: break-word; }
.cm-val a { color: var(--brand-ink); }
.add-link.cm-edit-btn { background: var(--surface); color: var(--burgundy); border: 1px solid var(--hair); box-shadow: none; }
.add-link.cm-edit-btn:hover { background: #f4ebdf; }
.cm-section-label { margin: 20px 0 12px; font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-ink); }
.cm-hours { font-size: 16px; font-weight: 500; color: var(--ink); padding: 8px 0 2px; }
.cm-hint { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.35; }
.cm-hint.new-hint { color: var(--brand-ink); }
.del-link { display: block; margin: 12px auto 0; background: none; border: none; color: var(--danger); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.del-link[hidden] { display: none; }
.del-link:hover { color: #8f1c1c; }
.del-link:disabled { opacity: .5; cursor: default; }

/* Выпадающий мультиселект (статусы/типы клиента) */
.ms-toggle { width: 100%; min-height: 46px; border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 8px 14px; background: #fff; color: var(--ink); font: inherit; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; }
.ms-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-text.is-empty { color: var(--muted); }
/* Стрелка как у нативных select/комбобоксов сайта (SVG-шеврон), а не текстовый глиф. */
.ms-caret { flex: none; width: 12px; height: 8px; font-size: 0; background-repeat: no-repeat; background-position: center; background-size: 12px 8px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%232c211d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.ms-menu { margin-top: 6px; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface); padding: 6px; max-height: 230px; overflow-y: auto; box-shadow: var(--shadow-sm); }
.ms-menu[hidden] { display: none; }
.ms-opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.ms-opt:hover { background: #f4ebdf; }
.ms-opt input { width: 17px; height: 17px; flex: none; accent-color: var(--brand); cursor: pointer; }
.ms-empty { padding: 10px 10px; color: var(--muted); font-size: 13px; }
.ms-add { padding: 6px 4px 2px; margin-top: 4px; border-top: 1px solid var(--hair); }
.ms-add-in { width: 100%; box-sizing: border-box; border: 1px solid var(--hair); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 16px; }
.ms-add-in:focus { outline: none; border-color: var(--brand); }
/* Одиночный выбор (мастер / тип занятия в записи): строка-вариант + крестик удаления. */
.ms-opt-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms-opt.is-sel { background: var(--brand-soft); color: var(--brand-ink); font-weight: 500; }
.ms-opt.is-sel:hover { background: var(--brand-soft); }
.ms-del { flex: none; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 3px 6px; border-radius: 6px; opacity: .55; }
.ms-del:hover { color: var(--danger); background: #f6e3df; opacity: 1; }
.ms-lock { flex: none; font-size: 11px; opacity: .45; padding: 3px 6px; cursor: default; }   /* системное значение — без крестика */
/* В пикерах записи поле «+ своё значение» липнет к низу меню — всегда видно (даже при скролле списка). */
.ms-pick .ms-add { position: sticky; bottom: 0; background: var(--surface); margin-top: 0; }

/* «Записи»: переключатель режима — вкладки с подчёркиванием (легче, чем сегмент-пилюля). */
.rec-tabs { display: flex; gap: 26px; border-bottom: 1px solid var(--hair); margin-bottom: 18px; }
.rec-tab { background: none; border: none; padding: 8px 2px 12px; margin-bottom: -1px; font: inherit; font-size: 16px; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; transition: color .15s ease; }
.rec-tab:hover { color: var(--ink); }
.rec-tab.is-active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 500; }

/* «Записи» → режим «Период»: сводка количества + список по дням. */
.range-summary { padding: 18px 20px; margin-bottom: 16px; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.range-summary[hidden] { display: none; }
.rs-total { font-size: 28px; font-weight: 600; color: var(--brand-ink); line-height: 1.1; }
.rs-sub { color: var(--muted); font-size: 14px; margin-top: 6px; }
.day-head { font-weight: 600; color: var(--ink); font-size: 14px; padding: 14px 12px 6px; border-top: 1px solid var(--hair); }
.day-group:first-child .day-head { border-top: none; }
.cm-works { border-top: 1px solid var(--hair); margin-top: 20px; }
.cm-works .cm-section-label { margin-top: 16px; }

/* Пагинация */
.pager { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 18px; }
.pg-btn { background: var(--surface); border: 1px solid var(--hair); color: var(--ink); font: inherit; font-size: 14px; padding: 9px 16px; border-radius: 999px; cursor: pointer; }
.pg-btn:hover:not(:disabled) { background: #f4ebdf; }
.pg-btn:disabled { opacity: .45; cursor: default; }
.pg-info { font-size: 14px; color: var(--muted); }

/* На телефоне в таблице клиентов видно только имя */
@media (max-width: 640px) {
  .col-hide-mobile { display: none; }

  /* Широкие таблицы (.data-table.cards) → вертикальные карточки «Колонка: значение»,
     без горизонтального скролла. Подпись слева берётся из data-label ячейки. */
  .data-table.cards thead { display: none; }
  .data-table.cards tbody, .data-table.cards tr, .data-table.cards td { display: block; }
  .data-table.cards tr { border: 1px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface); box-shadow: var(--shadow-sm); padding: 2px 14px; margin-bottom: 10px; }
  .data-table.cards tbody tr:hover td { background: transparent; }
  .data-table.cards td { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border: none; border-top: 1px solid var(--hair); white-space: normal; text-align: right; }
  .data-table.cards td:first-child { border-top: none; }
  .data-table.cards td.col-hide-mobile { display: flex; }   /* в карточке места по вертикали хватает — показываем всё */
  .data-table.cards td:empty { display: none; }             /* пустые поля не показываем */
  .data-table.cards td::before { content: attr(data-label); flex: none; margin-right: auto; padding-right: 12px; text-align: left; color: var(--muted); font-size: 13px; font-weight: 500; }
  .data-table.cards td:not([data-label])::before, .data-table.cards td[data-label='']::before { content: none; }
  .data-table.cards td.row-edit-cell { justify-content: flex-end; width: auto; }   /* width:1% из табличного режима выталкивала кнопку за карточку */
  /* На телефоне остаток не правится в списке — только текстом; изменения через попап. */
  .data-table.cards .stock-in { display: none; }
  .data-table.cards .stock-ro { display: inline; }

  /* Доски (заказы/задачи): колонки в один столбец вместо горизонтального скролла. */
  .board { flex-direction: column; overflow-x: visible; }
  .board-col { min-width: 0; width: 100%; flex: 0 0 auto; }
}

/* Панели */
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 18px; align-items: stretch; }
.panel { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 20px 22px; box-shadow: var(--shadow-sm); }
.panel-wide { margin-top: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.panel-title { font-size: 16px; font-weight: 600; display: flex; align-items: center; gap: 8px; color: var(--brand); }

.row { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-top: 1px solid var(--hair); font-size: 14px; }
.row:first-of-type { border-top: none; }
.row .time { font-weight: 600; width: 46px; flex: none; color: var(--burgundy); }
#panel-today .row .time { color: var(--brand); }   /* время в блоке «Сегодня» — оранжевое */
.row .main { flex: 1; min-width: 0; }
.row .sub { color: var(--muted); }
.row .meta { font-size: 12px; color: var(--muted); flex: none; }
.row.panel-more { font-size: 13px; color: var(--brand-ink); justify-content: flex-start; }
/* Заказы в обзоре: имя сверху, статус-плашка (+ дата) под ним — иначе широкий статус наезжает на название. */
.row-order { flex-direction: column; align-items: stretch; gap: 5px; }
.row-order-sub { display: flex; align-items: center; gap: 10px; }
.row-order-sub .meta { margin-left: auto; }
a.panel:hover .row.panel-more { text-decoration: underline; }

.chip { font-size: 12px; font-weight: 500; padding: 3px 11px; border-radius: 999px; white-space: nowrap; flex: none; }
.qty { font-size: 13px; font-weight: 600; flex: none; }
.qty.is-danger { color: var(--danger); }
.qty.is-warning { color: var(--warning); }
.stars { color: #e0902f; letter-spacing: 1px; flex: none; font-size: 14px; }
.stars .off { color: #ddccba; }
.source-note { margin-top: 22px; font-size: 12px; color: var(--muted); }

/* Списки, поиск, кнопки */
.list-head { display: flex; gap: 12px; align-items: center; margin: 0 0 20px; flex-wrap: wrap; }
.search-input { flex: 1; min-width: 240px; height: 46px; border: 1px solid var(--hair); border-radius: 999px; padding: 0 20px; font: inherit; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.search-input:focus { outline: none; border-color: var(--brand); }
.muted-line { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.add-link { font-size: 14px; font-weight: 500; color: #fff; text-decoration: none; background: linear-gradient(135deg, #ff6a2b, #fe4704); padding: 12px 18px; border-radius: 999px; cursor: pointer; border: none; box-shadow: 0 5px 14px rgba(254, 71, 4, .24); white-space: nowrap; }
.add-link:hover { box-shadow: 0 8px 20px rgba(254, 71, 4, .32); }
.add-link.is-ghost { background: transparent; color: var(--brand-ink); border: 1px solid var(--brand); box-shadow: none; }
.add-link.is-ghost:hover { background: var(--brand-soft); box-shadow: none; }
/* Управление справочниками (типы и т.п.): список с кнопкой «Удалить» */
.manage-list { list-style: none; margin: 14px 0 0; padding: 0; max-height: 360px; overflow-y: auto; }
.manage-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 4px; border-bottom: 1px solid var(--hair); }
.manage-row:last-child { border-bottom: none; }
.manage-name { font-size: 15px; color: var(--ink); }
.manage-del { flex: none; background: none; border: none; color: var(--danger); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.manage-del:hover { color: #8f1c1c; }
.manage-section-title { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin: 18px 0 0; }

/* ── Страница «Настройки» ── */
.set-panel { margin-bottom: 16px; }
.set-head { margin-bottom: 2px; }
.set-title { margin: 0 0 3px; font-size: 17px; font-weight: 600; color: var(--burgundy); }
.set-head .cm-hint { margin-top: 0; }
.set-panel .manage-list { max-height: 320px; }
.set-add { display: flex; gap: 8px; margin-top: 12px; align-items: stretch; }
.set-add-in { flex: 1; min-width: 0; height: 44px; border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 0 14px; font: inherit; background: #fff; color: var(--ink); }
.set-add-in:focus { outline: none; border-color: var(--brand); }
.set-add-btn { flex: none; padding: 10px 18px; }
.set-panel .form-msg { margin-top: 8px; min-height: 16px; }
.set-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.set-save { width: auto; margin-top: 0; padding: 0 26px; }
.set-actions .form-msg { margin-top: 0; }
/* База знаний: карточки записей */
.kb-entry { border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 12px; margin-bottom: 10px; background: #fffdfa; }
.kb-entry-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.kb-title { flex: 1; min-width: 0; height: 40px; border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 0 12px; font: inherit; font-weight: 500; background: #fff; color: var(--ink); }
.kb-title:focus { outline: none; border-color: var(--brand); }
.kb-del { flex: none; }
.kb-text { display: block; width: 100%; box-sizing: border-box; border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 10px 12px; font: inherit; background: #fff; color: var(--ink); resize: vertical; min-height: 64px; line-height: 1.4; }
.kb-text:focus { outline: none; border-color: var(--brand); }
.kb-add-btn { margin-top: 4px; }
/* Расписание преподавателей: строка «преподаватель · день · с–до · ✕» */
.roster-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.roster-row select, .roster-row input[type="time"] { height: 42px; border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 0 12px; font: inherit; background: #fff; color: var(--ink); }
.roster-row select:focus, .roster-row input[type="time"]:focus { outline: none; border-color: var(--brand); }
.roster-row select { -webkit-appearance: none; -moz-appearance: none; appearance: none; padding-right: 34px; background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%232c211d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.roster-row .ro-teacher { flex: 1; min-width: 130px; }
.roster-row .ro-day { flex: none; width: 152px; }
.roster-row input[type="time"] { width: 104px; flex: none; }
.ro-dash { color: var(--muted); flex: none; }
.ro-del { flex: none; margin-left: auto; }
/* Поставщики: строка кликается и открывает карточку */
.sup-row { cursor: pointer; border-radius: 8px; transition: background .12s; }
.sup-row:hover { background: #faf4ec; }
.sup-status { font-size: 11px; font-weight: 600; color: var(--brand-ink); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; margin-left: 6px; white-space: nowrap; }
.sup-contact { flex: none; font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 45%; }

/* Таблицы */
.table-wrap { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow-sm); }
.data-table th, .data-table td { white-space: nowrap; }

/* Кнопка «Изменить» в строках/карточках */
.row-edit {
  background: none; border: 1px solid var(--hair); color: #6b5e53;
  font: inherit; font-size: 12px; padding: 4px 11px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; transition: background .14s, border-color .14s, color .14s;
}
.row-edit:hover { background: #f4ebdf; border-color: #e0d2c2; color: var(--ink); }
td.row-edit-cell { text-align: right; width: 1%; }
/* «Вкл. таймер» в «Записях» — как на «Клиентах» (мягкая оранжевая пилюля). «идёт» — занятие активно. */
.row-timer { background: var(--brand-soft); border: none; color: var(--brand-ink); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; flex: none; }
.row-timer:hover { filter: brightness(.97); }
.row-timer:disabled { opacity: .6; cursor: default; }
.row-timer-on { font-size: 12px; font-weight: 500; color: #1d9e75; white-space: nowrap; flex: none; }
/* Строка «Записей»: время | имя + (тип · мастер) | таймер. Вся карточка кликабельна (правка). */
.sch-row { gap: 12px; align-items: center; }
/* Запись с запущенным таймером (клиент пришёл) — зелёная; ожидаемые остаются белыми. */
/* Без полоски слева: только мягкая зелёная заливка. Отрицательные поля — чтобы текст
   остался на одной вертикали с обычными строками, а фон чуть выступал за них. */
.sch-row.is-arrived { background: #eef8f1; border-radius: 8px; padding-left: 8px; padding-right: 8px; margin-left: -8px; margin-right: -8px; }
.sch-row.is-arrived .time { color: #1f5c39; }
/* Группы «Пришли» / «Ожидаются» на странице «Записи» */
.sch-group + .sch-group { margin-top: 6px; }
.sch-group-head { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 14px 2px 6px; }
.sch-group:first-child .sch-group-head { padding-top: 4px; }
.sch-group-head.is-arrived { color: var(--ok); }
.sch-group-head.is-noshow { color: #b3311f; }
/* Плановая запись, которую так и не запустили в прошедший день (человек не пришёл). */
.row-noshow { font-size: 12px; font-weight: 500; color: #b3311f; white-space: nowrap; flex: none; opacity: .85; }
.rs-came { color: var(--ok); font-weight: 600; }
.rs-noshow { color: #b3311f; font-weight: 600; }
.sch-group .sch-row:first-of-type { border-top: none; }
.row-clickable { cursor: pointer; }
.row-body { flex: 1; min-width: 0; }
.row-name { font-weight: 500; color: var(--ink); line-height: 1.25; }
.row-line2 { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.25; }
.order-card { position: relative; }
.oc-edit {
  position: absolute; top: 9px; right: 9px; opacity: 0; transition: opacity .14s;
  background: var(--surface); border: 1px solid var(--hair); color: #6b5e53;
  font: inherit; font-size: 11px; padding: 3px 9px; border-radius: 999px; cursor: pointer;
}
.order-card:hover .oc-edit { opacity: 1; }
.oc-edit:hover { background: #f4ebdf; color: var(--ink); }
/* Подсветка формы в режиме редактирования */
.card-form.is-editing { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }

/* Drag-and-drop карточек на доске (Задачи) */
/* Не выделять текст карточки при нажатии — иначе выделение мешает перетаскиванию. */
.order-card { -webkit-user-select: none; -moz-user-select: none; user-select: none; -webkit-touch-callout: none; }
/* Ручка-захват слева: на ТАЧ перетаскивать можно только за неё (touch-action:none — касание ручки
   браузер не считает скроллом, поэтому едет карточка, а не страница). Свайп по остальной карточке
   листает доску как обычно. На десктопе мышью тащим за всю карточку. */
.board .order-card { padding-left: 34px; }
.oc-grip {
  position: absolute; left: 0; top: 0; bottom: 0; width: 28px; touch-action: none; cursor: grab;
  display: flex; align-items: center; justify-content: center; color: var(--muted);
  border-right: 1px solid var(--hair); -webkit-user-select: none; user-select: none;
}
.oc-grip::before { content: '⋮'; font-size: 22px; line-height: 1; }
.order-card.dnd-source { opacity: .35; }            /* «поднятая» карточка-исходник */
.dnd-ghost {                                         /* карточка-призрак, едет за указателем */
  position: fixed; left: 0; top: 0; z-index: 1000; width: 240px; padding-left: 34px; pointer-events: none;
  opacity: .96; box-shadow: 0 16px 34px rgba(40, 12, 10, .3); will-change: transform; cursor: grabbing;
}
body.dnd-active { -webkit-user-select: none; user-select: none; touch-action: none; cursor: grabbing; }
.board-col.drop-target { outline: 2px dashed var(--brand); outline-offset: 3px; border-radius: var(--radius); }
.board-col.drop-target .board-col-head { background: var(--brand-soft); }
/* На тач-устройствах (нет ховера) кнопка «Изменить» видна всегда — иначе её не нажать. */
@media (hover: none) { .oc-edit { opacity: 1; } }
.board-col-body.is-drop { min-height: 46px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; padding: 15px 18px; border-bottom: 1px solid var(--hair); background: #fbf4ec; }
.data-table th.num, .data-table td.num { text-align: right; }
.data-table td { padding: 14px 18px; border-bottom: 1px solid var(--hair); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #fbf3ea; }
.data-table td.num.low { color: var(--danger); font-weight: 500; }
.data-table td.num.debt { color: var(--danger); font-weight: 600; } /* отрицательный остаток = долг */
.data-table a { color: var(--brand-ink); text-decoration: none; }
.tag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); }
.filter-select { height: 46px; border: 1px solid var(--hair); border-radius: 999px; padding: 0 44px 0 18px; font: inherit; background-color: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%232c211d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 18px center; background-size: 12px 8px; }
.filter-select:focus { outline: none; border-color: var(--brand); }

/* Чипы-переключатели */
.chips-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick { border: 1px solid var(--hair); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 8px 15px; font: inherit; font-size: 13px; cursor: pointer; transition: all .12s; }
.pick.is-on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); font-weight: 500; }
.chip-add-in { width: 120px; border: 1px dashed var(--hair); background: transparent; color: var(--ink); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 16px; }
.chip-add-in::placeholder { color: var(--muted); }
.chip-add-in:focus { outline: none; border-color: var(--brand); border-style: solid; }

/* Формы */
.back-link { font-size: 14px; color: #fff; text-decoration: none; opacity: .9; }
.form-wrap { max-width: 620px; }
.form-title { font-family: var(--font-serif); font-style: italic; font-size: 30px; font-weight: 600; color: var(--burgundy); margin: 0 0 22px; }
.card-form { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 26px; box-shadow: var(--shadow-sm); }
.field { margin-bottom: 18px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field select { height: 46px; border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 0 14px; font: inherit; background: #fff; color: var(--ink); }
.field input:focus, .field select:focus { outline: none; border-color: var(--brand); }
/* Единый шеврон во всех выпадающих полях форм (как у .filter-select на «Отзывах»):
   и у обычных select, и у кастомных комбобоксов (.cbx-input — бывшие datalist). */
.field select,
.field input.cbx-input {
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%232c211d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
  padding-right: 40px;
}
/* Поля даты и времени — тот же вид, что у select: на Android нативные инпуты
   рисуются короткими и со своей мелкой стрелкой. Растягиваем на всю ширину,
   рисуем наш шеврон, а нативный индикатор растягиваем невидимым поверх поля —
   тап в любом месте открывает пикер. */
.field input[type="date"],
.field input[type="time"] {
  width: 100%; min-width: 100%; max-width: 100%; box-sizing: border-box; position: relative; display: block;
  height: 46px; line-height: 44px;   /* центрируем значение по вертикали (iOS прибивал его к верху) */
  -webkit-appearance: none; -moz-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%232c211d' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
  padding-right: 40px;
}
.field input[type="date"]::-webkit-calendar-picker-indicator,
.field input[type="time"]::-webkit-calendar-picker-indicator {
  position: absolute; left: 0; top: 0; right: 0; bottom: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
/* WebKit (iPhone): значение слева и по центру высоты, как в остальных полях */
.field input[type="date"]::-webkit-date-and-time-value,
.field input[type="time"]::-webkit-date-and-time-value { text-align: left; line-height: 44px; margin: 0; }

/* Кастомный комбобокс вместо нативного <datalist> — единый вид во всех браузерах
   (нативную стрелку datalist в Firefox через CSS не убрать). shell.js навешивает. */
.cbx { position: relative; width: 100%; }
.field input.cbx-input { width: 100%; box-sizing: border-box; }
.cbx-menu { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60; margin: 0; padding: 4px; list-style: none; max-height: 220px; overflow-y: auto; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.cbx-menu[hidden] { display: none; }
.cbx-opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 8px; cursor: pointer; font-size: 14px; color: var(--ink); }
.cbx-opt:hover, .cbx-opt.is-active { background: #f4ebdf; }
.cbx-del { flex: none; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 3px 5px; border-radius: 6px; opacity: .6; }
.cbx-del:hover { color: var(--danger); background: #f6e3df; opacity: 1; }
/* На части мобильных браузеров нативный индикатор выпадашки рисуется ПОВЕРХ нашего кастомного
   шеврона («вторая, синяя стрелка»). Прячем его у комбобоксов — и до enhanceCombobox (input[list]),
   и после (.cbx-input). Дату/время НЕ трогаем: там нативный пикер нужен. */
.field input[list]::-webkit-calendar-picker-indicator,
.field input[list]::-webkit-list-button,
.field input.cbx-input::-webkit-calendar-picker-indicator,
.field input.cbx-input::-webkit-list-button,
.cbx-input::-webkit-calendar-picker-indicator,
.cbx-input::-webkit-list-button {
  display: none !important; -webkit-appearance: none; appearance: none; opacity: 0; pointer-events: none;
}
.row2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.seg { display: flex; width: 100%; border: 1px solid var(--hair); border-radius: 999px; overflow: hidden; background: var(--surface); }
.seg-btn { flex: 1; text-align: center; border: none; background: transparent; padding: 10px 18px; font: inherit; color: var(--muted); cursor: pointer; }
.seg-btn.is-active { background: var(--brand-soft); color: var(--brand-ink); font-weight: 500; }
.submit-btn { margin-top: 6px; width: 100%; height: 50px; border: none; border-radius: 999px; background: linear-gradient(135deg, #ff6a2b, #fe4704); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 6px 16px rgba(254, 71, 4, .24); transition: transform .1s, box-shadow .15s; }
.submit-btn:hover { box-shadow: 0 9px 24px rgba(254, 71, 4, .32); }
.submit-btn:active { transform: scale(.99); }
.submit-btn:disabled { opacity: .6; cursor: default; box-shadow: none; }
.form-msg { margin-top: 12px; font-size: 14px; min-height: 18px; }
.form-msg.is-ok { color: var(--ok); }
.form-msg.is-error { color: var(--danger); }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 14px; margin-bottom: 16px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; }

/* Вход */
.login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(135% 130% at 12% 120%, rgba(255, 178, 105, .9) 0%, rgba(240, 105, 40, 0) 48%),
    linear-gradient(116deg, #ff7e3a 0%, #f1530c 46%, #bf3a07 100%);
}
.login-card { background: var(--surface); border-radius: var(--radius-lg); padding: 38px 34px; width: 100%; max-width: 400px; box-shadow: 0 24px 60px rgba(40, 12, 10, .34); text-align: center; }
.login-logo { display: block; width: 132px; height: 52px; margin: 0 auto 26px; background: url(logo.svg) center / contain no-repeat; }
.login-card .field { text-align: left; }

/* Остаток (Материалы) */
.stock-in { width: 86px; height: 36px; border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 0 8px; font: inherit; text-align: right; background: #fff; color: var(--ink); }

/* Поля ввода ≥16px — чтобы iOS Safari не зумил при фокусе (пинч двумя пальцами остаётся) */
.search-input, .filter-select, .stock-in, .field input, .field select, input, select, textarea { font-size: 16px; }
.stock-in:focus { outline: none; border-color: var(--brand); }
.stock-in.low { color: var(--danger); font-weight: 500; border-color: #f0c0b6; }

/* Материалы: единица рядом с остатком + бейдж статуса (из формулы Notion). */
.mat-unit { color: var(--muted); font-size: 12px; }
.mat-stock { font-weight: 500; }
.stock-ro { display: none; }   /* текстовый остаток — показывается только на телефоне */
.mat-stock.low { color: var(--danger); }
.mat-badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.mat-badge.ok { background: #e6f4ea; color: #1f7a3d; }
.mat-badge.warn { background: var(--brand-soft); color: var(--brand-ink); }
.mat-badge.none { background: #fbe0db; color: #b3311f; }

/* Доска заказов */
.board { display: flex; gap: 16px; overflow-x: auto; padding-bottom: 8px; align-items: flex-start; }
.board-col { flex: 1 1 240px; min-width: 240px; background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
/* Телефон: колонки друг под другом во всю высоту. Мобильное правило выше по файлу перебивалось
   этим базовым — колонка получала высоту 240px и обрезала карточки после второй-третьей. */
@media (max-width: 640px) { .board-col { min-width: 0; width: 100%; flex: 0 0 auto; } }
.board-col-head { display: flex; align-items: center; justify-content: space-between; padding: 13px 16px; font-size: 13px; font-weight: 600; color: var(--burgundy); }
.bc-count { font-size: 12px; color: var(--muted); font-weight: 500; }
.board-col-body { padding: 0 11px 13px; display: flex; flex-direction: column; gap: 9px; }
.bc-empty { color: var(--muted); font-size: 13px; padding: 4px; }
.order-card { background: #fffaf3; border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 12px 14px; }
.oc-name { font-weight: 500; font-size: 14px; line-height: 1.35; }
.oc-client { font-size: 12px; color: var(--brand-ink); margin-top: 3px; }
.oc-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 9px; }
.oc-due { font-size: 12px; color: var(--muted); }
.oc-ass { font-size: 12px; color: var(--muted); margin-top: 6px; }

/* Карточки отзывов */
.rcard { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.rcard-head { display: flex; align-items: center; justify-content: space-between; }
.rcard-date { font-size: 13px; color: var(--muted); }
.rcard-comment { margin-top: 11px; font-size: 15px; line-height: 1.55; }
.rcard-contact { margin-top: 11px; display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--brand-ink); background: var(--brand-soft); border-radius: var(--radius-sm); padding: 7px 12px; }
.rcard-contact a { color: inherit; text-decoration: none; }
.rcard-contact a:hover { text-decoration: underline; }
.rcard-tags { margin-top: 13px; display: flex; flex-wrap: wrap; gap: 8px; }
.rtag { font-size: 12px; color: var(--ink); background: var(--brand-soft); border-radius: 999px; padding: 4px 11px; }
.rtag b { font-weight: 500; color: var(--brand-ink); }

/* Фильтры отзывов */
.filters-box { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.filter-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.filter-lbl { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.star-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.q-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.qf { display: flex; flex-direction: column; gap: 6px; }
.qf .filter-select { width: 100%; box-shadow: none; }
.cnt { color: var(--muted); font-size: 12px; }
.pick.is-on .cnt { color: var(--brand-ink); }
.reset-link { margin-top: 16px; background: none; border: none; color: var(--brand-ink); font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.reset-link:hover { text-decoration: underline; }

/* Адаптив */
@media (max-width: 1180px) {
  /* меню (9 пунктов) переносим на свою строку, чтобы шапка не теснилась */
  .appbar { flex-wrap: wrap; border-radius: var(--radius-lg); padding: 11px 18px; }
  .nav { order: 3; flex-basis: 100%; justify-content: flex-start; gap: 2px; margin-top: 2px; }
}
@media (max-width: 900px) {
  .hero-title h1 { font-size: 34px; }
}
@media (max-width: 560px) {
  :root { --pad: 16px; }
  .metric-value { font-size: 27px; }
  .hero-title h1 { font-size: 27px; }
  .navlink { padding: 7px 11px; font-size: 13px; }
  .appbar-add { padding: 8px 13px; }
  .appbar { gap: 10px; }
  .appbar-user { max-width: 132px; padding: 5px 7px 5px 9px; gap: 3px; }
  .appbar-user-sel { max-width: 86px; }
}

/* Бургер-меню на телефоне/маленьком планшете (перекрывает перенос меню выше) */
@media (max-width: 880px) {
  .appbar { flex-wrap: nowrap; position: relative; }
  .appbar-right { margin-left: auto; }
  .nav-toggle { display: inline-flex; }
  .hero { position: relative; z-index: 20; }
  .nav {
    order: 0; flex: none; flex-basis: auto; margin: 0;
    position: absolute; top: calc(100% + 10px); right: 0;
    width: min(280px, 82vw); max-height: 72vh; overflow-y: auto;
    flex-direction: column; flex-wrap: nowrap; align-items: stretch; justify-content: flex-start; gap: 2px;
    padding: 8px;
    background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius);
    box-shadow: 0 18px 44px rgba(40, 12, 10, .24);
    display: none; z-index: 60;
  }
  .appbar.nav-open .nav { display: flex; }
  .nav .navlink { padding: 12px 14px; border-radius: var(--radius-sm); font-size: 15px; }
}

/* ── ИИ-ассистент: плавающая кнопка + панель чата ── */
.ai-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 120;
  width: 58px; height: 58px; border: none; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #fff;
  background: linear-gradient(135deg, #ff6a2b, #fe4704);
  box-shadow: 0 10px 26px rgba(254, 71, 4, .42);
  transition: transform .15s, box-shadow .15s;
}
.ai-fab:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(254, 71, 4, .5); }
.ai-fab.on { background: var(--burgundy); box-shadow: 0 10px 26px rgba(40, 12, 10, .35); }

/* Подложка под чатом ассистента: затемнение + блюр страницы; клик закрывает чат. */
.ai-backdrop {
  position: fixed; inset: 0; z-index: 118;
  background: rgba(40, 12, 10, .26);
  -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.ai-backdrop[hidden] { display: none; }
/* Пока чат открыт — страница под ним не скроллится (позицию сохраняет/возвращает assistant.js). */
body.ai-open { position: fixed; width: 100%; overflow: hidden; }

.ai-panel {
  position: fixed; right: 22px; bottom: 92px; z-index: 121;
  width: min(384px, calc(100vw - 32px)); height: min(580px, calc(100vh - 130px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius-lg);
  box-shadow: 0 24px 70px rgba(40, 12, 10, .4);
}
.ai-panel[hidden] { display: none; } /* класс display:flex иначе перебивает атрибут hidden */
.ai-head {
  display: flex; align-items: center; gap: 8px; padding: 13px 14px;
  background: linear-gradient(116deg, #6a2620, #481b18); color: #fff;
}
.ai-head .ai-title { font-weight: 600; flex: 1; font-size: 15px; }
.ai-icon-btn {
  background: rgba(255, 255, 255, .12); color: #fff; border: none; cursor: pointer;
  width: 28px; height: 28px; border-radius: 8px; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: background .15s;
}
.ai-icon-btn:hover { background: rgba(255, 255, 255, .25); }

.ai-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ai-empty { color: var(--muted); font-size: 13.5px; line-height: 1.5; text-align: center; margin: auto 6px; }
.ai-msg {
  max-width: 86%; padding: 9px 13px; border-radius: 16px; font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.ai-user { align-self: flex-end; background: var(--brand-soft); color: var(--brand-ink); border-bottom-right-radius: 5px; }
.ai-bot { align-self: flex-start; background: var(--cream); color: var(--ink); border: 1px solid var(--hair); border-bottom-left-radius: 5px; }
.ai-err { background: #fbeae7; color: var(--danger); border-color: #f3cfc9; }

.ai-typing { display: inline-flex; gap: 4px; align-items: center; }
.ai-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .5; animation: ai-blink 1.2s infinite both; }
.ai-typing span:nth-child(2) { animation-delay: .2s; }
.ai-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes ai-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: .9; } }

.ai-confirm {
  align-self: stretch; background: #fff8f0; border: 1px solid #f0d9c2; border-radius: 14px; padding: 12px 13px;
}
.ai-confirm-title { font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 5px; }
.ai-confirm-sum { font-size: 13.5px; color: #6b5e53; line-height: 1.45; margin-bottom: 11px; }
.ai-confirm-row { display: flex; gap: 8px; }
.ai-btn { border: none; cursor: pointer; border-radius: 10px; padding: 8px 16px; font-size: 13.5px; font-weight: 600; font-family: inherit; }
.ai-btn-yes { background: linear-gradient(135deg, #ff6a2b, #fe4704); color: #fff; }
.ai-btn-yes:hover { filter: brightness(1.04); }
.ai-btn-no { background: transparent; color: var(--muted); border: 1px solid var(--hair); }
.ai-btn-no:hover { background: #f4ebdf; color: var(--ink); }

.ai-input-row { display: flex; align-items: flex-end; gap: 8px; padding: 10px; border-top: 1px solid var(--hair); }
.ai-text {
  flex: 1; resize: none; border: 1px solid var(--hair); border-radius: 14px; padding: 9px 12px;
  font: inherit; font-size: 16px; line-height: 1.4; max-height: 120px; overflow-y: hidden;
  background: #fff; color: var(--ink);
}
.ai-text:focus { outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }
.ai-send {
  flex: none; width: 38px; height: 38px; border: none; border-radius: 50%; cursor: pointer;
  background: linear-gradient(135deg, #ff6a2b, #fe4704); color: #fff; font-size: 18px; line-height: 1;
  display: flex; align-items: center; justify-content: center; transition: filter .15s;
}
.ai-send:hover { filter: brightness(1.06); }
.ai-mic {
  flex: none; width: 38px; height: 38px; border: 1px solid var(--hair); border-radius: 50%; cursor: pointer;
  background: var(--surface); color: var(--muted);
  display: flex; align-items: center; justify-content: center; transition: color .15s, border-color .15s, background .15s;
}
.ai-mic:hover { color: var(--brand-ink); border-color: var(--brand-2); }
.ai-mic.on { background: var(--brand); border-color: var(--brand); color: #fff; animation: ai-mic-pulse 1.3s ease-in-out infinite; }
.ai-mic.busy { opacity: .55; cursor: progress; } /* идёт распознавание на сервере */
@keyframes ai-mic-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(254, 71, 4, .45); } 50% { box-shadow: 0 0 0 7px rgba(254, 71, 4, 0); } }

@media (max-width: 560px) {
  .ai-panel { right: 12px; left: 12px; bottom: 84px; width: auto; height: min(70vh, calc(100vh - 110px)); }
  .ai-fab { right: 16px; bottom: 16px; }
}

/* ── Календарь записей по дням (главная) ── */
.cal { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); margin-bottom: 18px; }
.cal-head { display: flex; align-items: center; justify-content: center; gap: 16px; margin-bottom: 14px; }
.cal-title { font-size: 19px; font-weight: 600; color: var(--brand); min-width: 190px; text-align: center; }
.cal-nav {
  width: 36px; height: 36px; flex: none; border-radius: 50%; border: 1px solid var(--hair);
  background: var(--surface); color: var(--burgundy); font-size: 20px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: background .15s, border-color .15s, color .15s;
}
.cal-nav:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-bottom: 6px; }
.cal-weekdays span { text-align: center; font-size: 12px; font-weight: 500; color: var(--muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.cal-cell {
  min-height: 96px; border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 6px 7px;
  background: #fffaf3; position: relative; display: flex; flex-direction: column; gap: 4px; overflow: hidden;
}
.cal-cell.is-empty { background: transparent; border: none; }
.cal-cell.is-today { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.cal-cell.has-items { cursor: pointer; }
.cal-cell.has-items:hover { border-color: var(--copper); }
.cal-cell.is-selected { background: var(--brand-soft); border-color: var(--brand); }
.cal-daynum { font-size: 13px; font-weight: 600; color: var(--ink); }
.cal-cell.is-today .cal-daynum { color: var(--brand-ink); }
.cal-count {
  position: absolute; top: 6px; right: 7px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 600;
  display: none; align-items: center; justify-content: center;
}
.cal-entries { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
/* Плашки чистые: без цветной полоски слева (источник виден по бейджу в попапе дня). */
.cal-entry {
  font-size: 11px; line-height: 1.35; padding: 2px 7px; border-radius: 6px; background: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* Таймер запускали (клиент пришёл) → зелёная. Запланированные остаются белыми. */
.cal-entry.is-arrived { background: #e8f5ec; color: #1f5c39; }
.cal-more { font-size: 11px; color: var(--muted); padding-left: 4px; }

.cal-detail { margin-top: 14px; border-top: 1px solid var(--hair); padding-top: 12px; }
.cal-detail-head { font-weight: 600; color: var(--burgundy); margin-bottom: 6px; text-transform: capitalize; }
.cal-drow { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--hair); font-size: 14px; }
.cal-drow:first-of-type { border-top: none; }
/* Запись с запущенным таймером — зелёная плашка (запланированные остаются белыми). */
.cal-drow.is-arrived { background: #e8f5ec; border-radius: 8px; padding-left: 8px; padding-right: 8px; margin-left: -8px; margin-right: -8px; border-top-color: transparent; }
.cal-drow.is-arrived + .cal-drow { border-top-color: transparent; }
.cal-drow.is-arrived + .cal-drow.is-arrived { margin-top: 10px; }   /* зелёные карточки не слипаются */
.cal-drow.is-arrived .cal-dtime { color: #1f5c39; }
/* Крестик удаления записи (попап календаря и страница «Записи»). */
.cal-ddel, .row-del { flex: none; border: none; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 6px 8px; border-radius: 8px; opacity: .5; transition: color .12s, background .12s, opacity .12s; }
.cal-ddel:hover, .row-del:hover { color: var(--danger); background: #f6e3df; opacity: 1; }
/* «Вкл. таймер» в попапе календаря — как на странице «Записи». */
/* Строка попапа кликабельна → правка записи (время/дата/мастер) */
.cal-drow-edit { cursor: pointer; }
@media (hover: hover) { .cal-drow-edit:hover .cal-dname { color: var(--brand-ink); } }
.cal-dstart { flex: none; background: var(--brand-soft); border: none; color: var(--brand-ink); font: inherit; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.cal-dstart:hover { background: #fbdcca; }
.cal-dstart:disabled { opacity: .6; cursor: default; }
/* Идущее занятие: пара «Пауза | Завершить» на месте «Вкл. таймер». */
.cal-dact { flex: none; display: flex; gap: 6px; }
.cal-dpause, .cal-ddone { border: none; font: inherit; font-size: 12px; font-weight: 600; padding: 5px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.cal-dpause { background: #faeeda; color: #633806; }
.cal-dpause:hover { background: #f5e3c2; }
.cal-ddone { background: var(--brand-soft); color: var(--brand-ink); }
.cal-ddone:hover { background: #fbdcca; }
.cal-dpause:disabled, .cal-ddone:disabled { opacity: .6; cursor: default; }
.cal-dtime { width: 46px; flex: none; font-weight: 600; color: var(--burgundy); }
.cal-dmain { flex: 1; min-width: 0; overflow-wrap: break-word; }
.cal-dname { overflow-wrap: break-word; }
.cal-dlesson { color: var(--muted); }
.cal-dname + .cal-dlesson::before { content: ' · '; }
/* Категория (Бот/Занятие/МК) — просто приглушённый текст, БЕЗ фона-пилюли:
   иначе бейдж выглядел как вторая кнопка рядом с «Вкл. таймер». */
.cal-badge { font-size: 11px; font-weight: 500; color: var(--muted); flex: none; text-transform: uppercase; letter-spacing: .03em; }
.cal-note { margin-top: 10px; font-size: 12.5px; color: var(--muted); }

@media (max-width: 640px) {
  .cal { padding: 14px; }
  .cal-grid, .cal-weekdays { gap: 4px; }
  .cal-cell { min-height: 56px; padding: 5px 5px 4px; align-items: center; }
  .cal-entries { display: none; }
  /* Счётчик записей — ПОД датой и по центру ячейки (раньше был absolute в углу и наезжал на число). */
  .cal-count { display: flex; position: static; margin-top: 2px; }
  .cal-title { font-size: 19px; min-width: 150px; }
  /* Попап дня на телефоне — сетка «время | текст | ✕», чтобы ничего не слипалось:
     занятие и метка (ЗАНЯТИЕ/МК/БОТ) — строками под именем, крестик по центру записи,
     «Вкл. таймер» — полосой на всю ширину внизу. */
  .cal-drow { display: grid; grid-template-columns: 46px 1fr auto; column-gap: 10px; row-gap: 1px; align-items: start; padding: 10px 0; }
  .cal-dtime { width: auto; }
  .cal-dmain { grid-column: 2; display: flex; flex-direction: column; gap: 1px; }
  .cal-dname + .cal-dlesson::before { content: none; }
  .cal-dlesson { font-size: 12px; line-height: 1.25; }
  .cal-badge { grid-column: 2; font-size: 10px; margin-top: 2px; }
  .cal-ddel { grid-column: 3; grid-row: 1 / span 2; align-self: center; }
  .cal-dstart { grid-column: 1 / -1; text-align: center; padding: 8px 12px; margin-top: 6px; }
  /* «Пауза | Завершить» — полосой на всю ширину, кнопки поровну. */
  .cal-dact { grid-column: 1 / -1; margin-top: 6px; }
  .cal-dact .cal-dpause, .cal-dact .cal-ddone { flex: 1; text-align: center; padding: 8px 12px; }
}

/* ── Студия: таймер занятий ── */
.st-now { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 20px 22px; margin-bottom: 22px; box-shadow: var(--shadow-sm); }
.st-now-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.st-now-title { margin: 0; font-size: 17px; font-weight: 600; color: var(--ink); }
.st-master { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.st-master select { height: 38px; border: 1px solid var(--hair); border-radius: 999px; padding: 0 14px; font: inherit; font-size: 14px; background: var(--surface); color: var(--ink); }
.st-master select:focus { outline: none; border-color: var(--brand); }

.st-active-list { display: flex; flex-direction: column; gap: 10px; }
.st-empty { padding: 18px 4px; color: var(--muted); font-size: 14px; }

.st-session { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: linear-gradient(180deg, #fffdf9, #fff7ee); }
.st-session-main { flex: 1; min-width: 0; }
.st-session-name { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-session-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.st-session-timer { font-size: 22px; font-weight: 600; color: var(--brand-ink); font-variant-numeric: tabular-nums; min-width: 92px; text-align: right; }
.st-session-acts { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.st-pause { height: 40px; padding: 0 16px; border: none; border-radius: 999px; background: #faeeda; color: #633806; font: inherit; font-weight: 600; cursor: pointer; }
.st-pause:hover { background: #f5e3c2; }
.st-pause:disabled { opacity: .6; cursor: default; }
.st-paused-label { font-size: 13px; font-weight: 600; color: #9a6b06; background: #faeeda; padding: 8px 14px; border-radius: 999px; white-space: nowrap; }
.st-done { height: 40px; padding: 0 18px; border: none; border-radius: 999px; background: linear-gradient(135deg, #ff6a2b, #fe4704); color: #fff; font: inherit; font-weight: 600; cursor: pointer; box-shadow: 0 5px 14px rgba(254, 71, 4, .22); }
.st-done:disabled { opacity: .6; cursor: default; }
.st-cancel { width: 40px; height: 40px; border: 1px solid var(--hair); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 15px; cursor: pointer; flex-shrink: 0; }
.st-cancel:hover { color: var(--danger); border-color: #f0c0b6; }

.data-table.st-clients th:nth-child(1) { width: 60%; }
.data-table.st-clients th:nth-child(2) { width: 20%; }
.data-table.st-clients th.st-act-col, .data-table.st-clients td.st-act-col { text-align: right; width: 20%; }
.st-start { height: 38px; padding: 0 16px; border: none; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font: inherit; font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap; }
.st-start:hover { background: #fbdcca; }
.st-start:disabled { opacity: .6; cursor: default; }
/* Статус «Занимается» — такая же пилюля, как «Вкл. таймер», но зелёная */
.st-busy { display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border-radius: 999px; background: #e4f3ea; color: var(--ok); font-weight: 600; font-size: 13px; white-space: nowrap; }
.st-on-badge { font-size: 13px; color: var(--warning); white-space: nowrap; }

.st-result-card { max-width: 380px; text-align: center; }
.st-result-body { padding: 8px 0 18px; }
.st-result-name { font-size: 16px; font-weight: 600; color: var(--ink); }
.st-result-spent { margin-top: 16px; font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.st-result-time { font-size: 40px; font-weight: 600; color: var(--brand-ink); font-variant-numeric: tabular-nums; margin-top: 2px; }
.st-result-hint { margin: 14px 0 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

/* История посещений в карточке клиента */
.visits-summary { font-size: 13px; color: var(--muted); margin: 2px 0 8px; }
.visits-list { max-height: 280px; overflow-y: auto; }
/* Визит — две строки: «дата · время от–до», ниже «длительность · мастер». */
.v-row { display: grid; grid-template-columns: max-content 1fr; column-gap: 12px; row-gap: 3px; align-items: baseline; padding: 8px 0; border-top: 1px solid var(--hair); font-size: 13px; }
.v-row:first-of-type { border-top: none; }
.v-date { font-weight: 600; color: var(--ink); min-width: 110px; }
.v-time { color: var(--ink); font-variant-numeric: tabular-nums; justify-self: end; }   /* время и мастер — по правому краю */
.v-dur { color: var(--brand-ink); font-weight: 600; }
.v-live { color: var(--ok); }
.v-master { color: var(--muted); justify-self: end; }
.v-up .v-date, .v-up .v-time { color: var(--brand-ink); }
.visits-more { margin-top: 8px; background: none; border: none; color: var(--brand-ink); font: inherit; font-size: 13px; cursor: pointer; padding: 0; }
.visits-more:hover { text-decoration: underline; }

/* Таймер внутри карточки клиента */
.cm-timer { margin: 0 0 16px; }
.cm-timer-on { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: linear-gradient(180deg, #fffdf9, #fff7ee); }
.cm-timer-label { font-size: 14px; font-weight: 600; color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.cm-timer-val { font-size: 20px; font-weight: 600; color: var(--brand-ink); font-variant-numeric: tabular-nums; }
.cm-timer-acts { display: inline-flex; align-items: center; gap: 8px; }
.st-start-wide { width: 100%; height: 46px; font-size: 15px; }

@media (max-width: 640px) {
  .st-session { flex-wrap: wrap; }
  .st-session-timer { min-width: auto; font-size: 20px; }
  .st-session-acts { width: 100%; justify-content: flex-end; }
  .data-table.st-clients th:nth-child(1) { width: auto; }
}

/* ── Мобильные доводки: шапка, фильтры, карточки-аккордеоны ── */
.data-table td.acc-head { display: none; }   /* ячейка-заголовок аккордеона: на ПК скрыта */

@media (max-width: 880px) {
  /* Шапка на телефоне: «+ Запись» слева, выбор мастера справа у бургера */
  .appbar-right { display: contents; }
  .appbar-add { order: -1; margin-right: auto; }
  .appbar-user { order: 1; }
  .nav-toggle { order: 2; }
}

@media (max-width: 640px) {
  /* Выпадающий фильтр («Все типы») не шире экрана — без горизонтального скролла */
  .list-head .filter-select { flex: 1 1 100%; width: 100%; max-width: 100%; min-width: 0; }

  /* Формы на телефоне: жёсткие 2 колонки вместо auto-fit — некоторые Android-браузеры
     считали сетку криво, и поля даты/времени выходили короткими и вразнобой. */
  .row2 { grid-template-columns: 1fr 1fr; }
  .row2 .field { min-width: 0; }

  /* Сегмент-фильтры (Абонементы и др.): ужимаем и делим ширину по тексту вкладок,
     чтобы все помещались на экран («Заканчиваются» шире четверти — flex:1 её резал) */
  .seg-btn { min-width: 0; flex: 1 1 auto; padding: 9px 5px; font-size: 13px; }

  /* Попап записи: без внутренней рамки-карточки — вся ширина попапа под поля */
  #zapis-modal .card-form { border: none; background: transparent; box-shadow: none; padding: 0; }

  /* Клиенты-карточки: имя крупно слева, кнопка таймера на всю ширину */
  .data-table.cards td.st-name-cell { font-weight: 600; font-size: 15px; text-align: left; justify-content: flex-start; }
  .data-table.cards td.st-act-col .st-start,
  .data-table.cards td.st-act-col .st-busy { width: 100%; justify-content: center; }

  /* Аккордеон (Сертификаты/МК): свернуто — только заголовок, тап по нему раскрывает */
  .data-table.cards.acc td { display: none; }
  .data-table.cards.acc td.acc-head { display: flex; align-items: center; text-align: left; justify-content: flex-start; font-weight: 600; font-size: 15px; padding: 13px 0; }
  .data-table.cards.acc td.acc-head::after { content: ''; margin-left: auto; flex: none; width: 8px; height: 8px; border-right: 1.8px solid var(--muted); border-bottom: 1.8px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
  .data-table.cards.acc tr.is-open td.acc-head::after { transform: rotate(-135deg); }
  .data-table.cards.acc tr.is-open td { display: flex; }
  .data-table.cards.acc tr.is-open td:empty { display: none; }
}

/* ── Срок абонемента и покупка часов ── */
.valid-till { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 2px; white-space: nowrap; }
.valid-till.is-expired { color: #b3311f; }
.data-table.cards td .valid-till { display: inline; margin-left: 8px; }
.cm-valid { font-size: 13px; color: var(--ink); margin: 2px 0 12px; }
.cm-valid.is-expired { color: #b3311f; font-weight: 500; }
.cm-section-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.add-link-sm { font-size: 12px; padding: 6px 12px; }
.hour-presets { display: flex; gap: 6px; margin-top: 8px; }
.hour-presets button { border: 1px solid var(--hair); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.hour-presets button:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
/* Кнопки-действия в виде сегмента (как «Абонемент | Почасовая оплата» в форме):
   две равные половины пилюли на всю ширину, без «активного» состояния. */
/* Две оранжевые пилюли-кнопки (стиль «+ Новый клиент»): рядом, поровну; на узком экране
   каждая на всю ширину. */
.cm-buy-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 2px 0 12px; }
.cm-buy-row .add-link { flex: 1 1 150px; min-width: 0; justify-content: center; text-align: center; white-space: normal; font-size: 13px; padding: 10px 14px; }
.v-buy { color: var(--ok); }
.v-row.v-purchase .v-date { color: var(--muted); font-weight: 500; }
.v-del { width: 22px; height: 22px; padding: 0; border: 1px solid var(--hair); border-radius: 50%; background: #fff; color: var(--muted); font: inherit; font-size: 11px; line-height: 20px; text-align: center; vertical-align: middle; cursor: pointer; }
.v-del:hover { color: #c0392b; border-color: #c0392b; }
.v-del:disabled { opacity: .5; cursor: default; }
#buy-kind .seg-btn { padding: 8px 10px; font-size: 13px; }
/* Панель продления срока абонемента (внутри карточки клиента) */
.ext-panel { border: 1px solid var(--hair); border-radius: var(--radius-sm); background: #fffaf3; padding: 12px 14px; margin: 0 0 12px; }
/* Всё в панели — на всю её ширину: три месяца поровну, дата строкой, две кнопки поровну. */
.ext-row { display: flex; gap: 8px; align-items: center; }
.ext-preset { flex: 1 1 0; text-align: center; border: 1px solid var(--hair); background: var(--surface); color: var(--ink); font: inherit; font-size: 13px; padding: 9px 10px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.ext-preset:hover, .ext-preset.is-on { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-ink); }
.ext-date { margin: 10px 0 0; }
.ext-panel .cm-hint { margin: 8px 0 0; }
.ext-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.ext-actions .ext-save, .ext-actions .ext-preset { flex: 1 1 0; font-size: 13px; padding: 9px 10px; box-shadow: none; text-align: center; }
.ext-panel .form-msg { margin: 0; }
.ext-panel .form-msg:empty { display: none; }   /* пустое сообщение не оставляет воздуха снизу */

/* «Мастер-классы»: вкладки «Группы и курсы» / «Отдельные записи», карточки групп, окно группы */
.mk-views { max-width: 460px; margin: 0 0 20px; }
.grp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.grp-card { background: var(--surface); border: 1px solid var(--hair); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); cursor: pointer; display: flex; flex-direction: column; gap: 6px; transition: border-color .12s; }
.grp-card:hover, .grp-card:focus-visible { border-color: var(--brand); outline: none; }
.grp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.grp-name { font-weight: 600; font-size: 16px; color: var(--ink); line-height: 1.3; overflow-wrap: anywhere; }
.grp-top .tag { flex: none; }
.grp-meta { font-size: 13px; color: var(--muted); }
.grp-sched { font-size: 14px; color: var(--ink); }
.grp-next { font-size: 13px; color: var(--brand-ink); font-weight: 500; }
.grp-next.is-none { color: var(--muted); font-weight: 400; }
.grp-members { font-size: 13px; color: var(--muted); padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--hair); }
.grp-empty { grid-column: 1 / -1; padding: 18px 4px; }
.gd-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.gd-head, .gd-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) 40px; gap: 8px; align-items: center; }
.gd-head { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.gd-row .field { margin: 0; min-width: 0; }
/* В узкой строке «дата + время + ✕» шеврон и большие отступы съедали значение («18:3»):
   убираем шеврон (тап по полю всё равно открывает пикер) и ужимаем отступы. */
.gd-row .field input[type="date"], .gd-row .field input[type="time"] { min-width: 0; padding: 0 10px; background-image: none; }
.gd-del { width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--hair); background: var(--surface); color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; }
.gd-del:hover { color: var(--danger); border-color: var(--danger); }
.gd-add { background: none; border: 1px dashed var(--brand); color: var(--brand-ink); border-radius: 999px; padding: 9px 16px; font: inherit; font-size: 14px; cursor: pointer; margin-bottom: 18px; }
.gd-add:hover { background: var(--brand-soft); }
.g-days .pick { min-width: 48px; text-align: center; }
.g-mcount { color: var(--muted); }
.gm-list { display: flex; flex-direction: column; }
.gm-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--hair); font-size: 14px; }
.gm-row:first-child { border-top: none; }
.gm-name { overflow-wrap: anywhere; }
.gm-from { margin-left: 8px; font-size: 12px; color: var(--muted); }
.g-settings-label { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--hair); }
.gm-del { width: 28px; height: 28px; padding: 0; border-radius: 50%; border: 1px solid var(--hair); background: #fff; color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; flex: none; }
.gm-del:hover { color: var(--danger); border-color: var(--danger); }
.gm-add { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; }
.gm-add .field { flex: 1; margin: 0; min-width: 0; }
.gm-add .add-link { height: 46px; flex: none; }
.gm-empty { margin: 4px 0; }
.gs-list { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.gs-row { padding: 8px 12px; background: #fbf7f1; border-radius: var(--radius-sm); }
#g-mmsg:empty, #g-msg:empty { display: none; }

/* «Задачи»: комментарии в окне задачи и счётчик на карточке */
.oc-cm { font-size: 12px; color: var(--muted); margin-top: 6px; }
.tc-sec { margin-top: 6px; }
.tc-count { color: var(--muted); }
.tc-list { display: flex; flex-direction: column; gap: 10px; }
.tc-item { background: #fbf7f1; border-radius: var(--radius-sm); padding: 10px 12px; }
.tc-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.tc-author { font-weight: 600; font-size: 13px; color: var(--ink); overflow-wrap: anywhere; min-width: 0; }
.tc-when { flex: none; white-space: nowrap; }
.tc-del { margin-left: auto; width: 26px; height: 26px; padding: 0; border-radius: 50%; border: 1px solid var(--hair); background: #fff; color: var(--muted); font: inherit; font-size: 11px; cursor: pointer; flex: none; }
.tc-del:hover { color: var(--danger); border-color: var(--danger); }
.tc-text { margin-top: 4px; font-size: 14px; line-height: 1.45; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.tc-empty { margin: 4px 0; }
.tc-new { margin-bottom: 12px; }
.tc-new textarea { display: block; width: 100%; box-sizing: border-box; min-height: 70px; resize: vertical; border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 10px 14px; font: inherit; font-size: 16px; line-height: 1.4; background: #fff; color: var(--ink); }
.tc-new textarea:focus { outline: none; border-color: var(--brand); }
.tc-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px; }
.tc-who { font-size: 12px; color: var(--muted); min-width: 0; }
.tc-actions .add-link { flex: none; }
#tc-msg:empty { display: none; }

/* «Сертификаты»: телефон получателя под именем в списке */
.cert-rec { display: inline-block; }
.cert-phone { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
#c-recipient-phone[readonly] { background: #f6f1ea; color: var(--muted); cursor: default; }

/* Группы МК: вкладки «Ученики / Мастер-класс», сводка по оплатам, карточки учеников */
.g-tabs { margin: 2px 0 16px; }
.g-tab-count { color: var(--muted); font-weight: 400; }
.gs-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 6px; }
.gs-tile { background: #fbf7f1; border-radius: var(--radius-sm); padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; }
.gs-tile span { font-size: 12px; color: var(--muted); }
.gs-tile b { font-size: 17px; font-weight: 600; color: var(--ink); }
.gs-tile.is-due b { color: var(--brand-ink); }
.gs-tile.is-paid b { color: var(--ok); }
.gs-hint:empty { display: none; }
.seg[hidden] { display: none; }
/* вкладки остаются под рукой при прокрутке длинного списка учеников */
.g-tabs { position: sticky; top: -16px; z-index: 3; box-shadow: 0 -6px 0 10px var(--surface); }
#g-mmsg, .gm-editor, .gm-card { scroll-margin-top: 76px; }
.gm-card.is-saving .gm-editor { opacity: .75; }
#g-mmsg:empty, .ge-msg:empty { display: none; }
#g-mmsg { margin-top: 8px; }
.ge-msg { margin-top: 10px; }
.gm-flash { margin-top: 8px; }
.gm-former { margin-top: 14px; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: #fbf7f1; }
.gm-former > summary { cursor: pointer; padding: 10px 14px; font-size: 13px; color: var(--muted); }
.gf-row { padding: 8px 14px; border-top: 1px solid var(--hair); }
.gf-row .gm-name { font-size: 14px; }
.gf-meta { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.grp-money { font-size: 13px; color: var(--muted); }
.grp-money b { color: var(--ink); font-weight: 600; }
.grp-money b.is-due { color: var(--brand-ink); }
.gm-list { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.gm-card, .cg-item { border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 12px 14px; background: #fff; }
.gm-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.gm-name { font-weight: 600; font-size: 15px; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.gm-name::after { content: ' ›'; color: var(--brand); }
.gm-name:hover { color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; }
.gm-status { flex: none; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.gm-status.is-paid { background: #eaf3de; color: #27500a; }
.gm-status.is-due { background: var(--brand-soft); color: var(--brand-ink); }
.gm-status.is-none { background: #f1efe8; color: var(--muted); }
.gm-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.gm-fact { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gm-fact span { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.gm-fact b { font-size: 14px; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.gm-note { margin-top: 8px; font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.gm-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.gm-foot .gm-from { margin-left: 0; }
.gm-edit-btn { background: none; border: 1px solid var(--hair); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; color: var(--brand-ink); cursor: pointer; flex: none; }
.gm-edit-btn:hover { border-color: var(--brand); background: var(--brand-soft); }
.gm-editor { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--hair); }
.gm-editor .field { margin-bottom: 12px; }
.ge-btns { display: flex; gap: 10px; }
.ge-btns > * { flex: 1; }
.gm-add { margin-top: 14px; }
@media (max-width: 640px) {
  .gm-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gm-editor .row2 { grid-template-columns: 1fr; gap: 0; }
  #g-form > .row2 { grid-template-columns: 1fr; gap: 0; }   /* «Тип» на всю ширину, не обрезается */
}

/* Карточка клиента: свёрнутый блок «Мастер-классы и курсы» */
.cm-groups { margin-top: 18px; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface); }
.cm-groups > summary { list-style: none; cursor: pointer; padding: 12px 40px 12px 14px; position: relative; line-height: 1.5; }
.cm-groups > summary::-webkit-details-marker { display: none; }
.cm-groups > summary::after { content: ''; position: absolute; right: 18px; top: 17px; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
.cm-groups[open] > summary::after { transform: rotate(-135deg); top: 21px; }
.cm-groups-sum { white-space: nowrap; }
.cm-groups-title { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-ink); }
.cm-groups-sum { font-size: 13px; color: var(--muted); }
.cm-groups-list { display: flex; flex-direction: column; gap: 10px; padding: 0 12px 12px; }
.cg-meta { margin-top: 4px; font-size: 13px; color: var(--muted); }

/* «Клиенты»: вкладки «Клиенты / Лист ожидания» */
.kl-tabs { max-width: 460px; margin: 0 0 18px; }
.kl-tab-count { color: var(--muted); font-weight: 400; }
.kl-tab-due { display: inline-block; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; vertical-align: 1px; }
.kl-tab-due[hidden] { display: none; }

/* Лист ожидания */
.w-list { display: flex; flex-direction: column; gap: 10px; }
.wl-sec { margin: 6px 0 2px; }
.wl-sec.is-due { color: var(--brand); }
.wl-empty { background: var(--surface); border: 1px dashed var(--hair); border-radius: var(--radius-sm); padding: 22px 20px; font-size: 14px; color: var(--muted); line-height: 1.55; }
.wl-empty b { color: var(--ink); font-weight: 600; }
.wl-card { background: #fff; border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 14px 16px; }
.wl-card.is-due { border-color: rgba(254, 71, 4, .45); box-shadow: 0 0 0 3px var(--brand-soft); }
.wl-card.is-closed { background: #fbf7f1; }
.wl-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.wl-name { font-weight: 600; font-size: 15px; color: var(--ink); overflow-wrap: anywhere; }
.wl-chip { flex: none; font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 999px; background: #f1efe8; color: var(--ink); white-space: nowrap; }
.wl-chip.is-due { background: var(--brand); color: #fff; }
.wl-chip.is-ok { background: #eaf3de; color: #27500a; }
.wl-chip.is-none { color: var(--muted); }
.wl-wants { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.wl-note { margin-top: 8px; font-size: 14px; color: var(--ink); white-space: pre-line; overflow-wrap: anywhere; }
.wl-phone { margin-top: 8px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; font-size: 14px; }
.wl-phone-num { color: var(--ink); white-space: nowrap; }
.wl-link { color: var(--brand-ink); font-weight: 500; text-decoration: none; border-bottom: 1px solid rgba(254, 71, 4, .35); }
.wl-link:hover { color: var(--brand); }
.wl-due-hint { margin-top: 10px; font-size: 13px; color: var(--brand-ink); }
.wl-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.wl-btn { background: var(--surface); border: 1px solid var(--hair); border-radius: 999px; padding: 7px 14px; font: inherit; font-size: 13px; color: var(--ink); cursor: pointer; }
.wl-btn:hover { border-color: var(--brand); color: var(--brand-ink); }
.wl-btn.is-ok { background: #eaf3de; border-color: #c5dfa8; color: #27500a; font-weight: 500; }
.wl-btn.is-ok:hover { border-color: #7fb34c; }
.wl-btn.wl-x { padding: 7px 11px; color: var(--muted); }
.wl-btn small { color: var(--muted); font-size: 12px; margin-left: 2px; }
.wl-btn:disabled { opacity: .55; cursor: default; }
.wl-snooze { background: var(--brand-soft); border-radius: var(--radius-sm); padding: 8px; }
.wl-snooze-label { font-size: 13px; color: var(--brand-ink); font-weight: 500; }
.wl-meta { margin-top: 10px; font-size: 12px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.wl-edit { flex: none; background: none; border: 1px solid var(--hair); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; color: var(--brand-ink); cursor: pointer; }
.wl-edit:hover { border-color: var(--brand); background: var(--brand-soft); }
#w-status-field[hidden] { display: none; }
.w-closed { margin-top: 18px; border: 1px solid var(--hair); border-radius: var(--radius-sm); background: var(--surface); }
.w-closed > summary { cursor: pointer; padding: 12px 16px; font-size: 14px; color: var(--muted); }
.w-closed > .w-list { padding: 0 12px 12px; }
.w-msg-top:empty { display: none; }
.wl-warn { color: var(--danger); }
.wl-ok { color: var(--ok); }
#w-when { margin-bottom: 8px; }
#w-when-field.is-flash { animation: wl-flash 1.6s ease; border-radius: var(--radius-sm); }
@keyframes wl-flash { 0%, 60% { background: var(--brand-soft); } 100% { background: transparent; } }
#w-status { max-width: 420px; }
.field textarea { border: 1px solid var(--hair); border-radius: var(--radius-sm); padding: 12px 14px; font: inherit; background: #fff; color: var(--ink); resize: vertical; min-height: 84px; }
.field textarea:focus { outline: none; border-color: var(--brand); }

/* Подсказка внизу экрана (действия листа ожидания, с «Вернуть») */
.wl-toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 20px); z-index: 400; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  max-width: min(560px, calc(100vw - 32px)); padding: 12px 14px 12px 18px; border-radius: 14px; background: #2b1d18; color: #fff; font-size: 14px;
  box-shadow: 0 14px 40px rgba(40, 12, 10, .35); opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; }
.wl-toast.is-show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.wl-toast.is-error { background: #7a1e1e; }
.wl-toast-text { flex: 1; min-width: 0; line-height: 1.45; }
.wl-toast-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.wl-toast-btn { background: rgba(255, 255, 255, .14); border: none; color: #fff; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.wl-toast-btn:hover { background: rgba(255, 255, 255, .24); }
.wl-toast-x { flex: none; background: none; border: none; color: rgba(255, 255, 255, .7); font-size: 15px; cursor: pointer; padding: 4px; }
@media (max-width: 640px) {
  .kl-tabs { max-width: none; }
  .wl-phone-num { flex-basis: 100%; }   /* номер строкой выше, «Позвонить» и «WhatsApp» — рядом под ним */
  .wl-card { padding: 12px 14px; }
  .wl-btn { padding: 8px 13px; }
}

/* Лист ожидания — доработки после проверки */
.kl-tabs .seg-btn { white-space: nowrap; }
.w-due-banner { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; margin: 0 0 16px; padding: 12px 16px; border: 1px solid rgba(254, 71, 4, .4); border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.w-due-banner[hidden] { display: none; }
.w-due-banner b { font-weight: 600; }
.w-due-banner span { margin-left: auto; font-weight: 500; }
.wl-call { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid rgba(254, 71, 4, .35); background: #fff; color: var(--brand-ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.wl-call:hover { background: var(--brand-soft); }
.wl-card.is-busy { opacity: .8; }
.wl-busy { margin-top: 8px; font-size: 13px; color: var(--muted); }
.wl-hint-btn { background: none; border: none; padding: 0; font: inherit; font-size: 12px; color: var(--brand-ink); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.w-name-hint { line-height: 1.5; }
.w-name-hint:empty { display: none; }
/* «Добавить в лист» всегда видна внизу окна */
.w-save-bar { position: sticky; bottom: -22px; z-index: 2; margin: 0 -22px; padding: 12px 22px 14px; background: var(--surface); box-shadow: 0 -10px 14px -12px rgba(40, 12, 10, .35); }
.w-save-bar .form-msg { margin-top: 8px; }
.w-save-bar .form-msg:empty { display: none; }
#w-modal { z-index: 210; }   /* поверх карточки клиента («+ В лист ожидания» из неё) */
.cm-wl { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin: 14px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: #fbf7f1; }
.cm-wl[hidden] { display: none; }
.cm-wl-text { font-size: 14px; color: var(--brand-ink); font-weight: 500; }
.cm-wl .cm-hint { margin: 0; }
/* подсказка: фиксированная ширина (не сжимается в узкую колонку), под окнами */
.wl-toast { width: min(560px, calc(100vw - 32px)); max-width: none; z-index: 150; }
.wl-toast-sub { display: block; margin-top: 4px; font-size: 13px; color: rgba(255, 255, 255, .78); }
.wl-toast-btn { min-height: 40px; padding: 8px 16px; font-size: 14px; }
.wl-toast-x { min-width: 40px; min-height: 40px; }
body.wl-toast-on #view-wait { padding-bottom: 170px; }
/* значок «пора связаться» в меню */
.nav-due { display: inline-block; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; vertical-align: 1px; }
.nav-toggle.has-due { position: relative; }
.nav-toggle.has-due::after { content: ''; position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 2px #fff; }

/* Лист ожидания — после повторной проверки */
.w-due-banner { flex-wrap: nowrap; white-space: nowrap; }
.w-due-banner span { overflow: hidden; text-overflow: ellipsis; }
.wl-due-hint { margin: -4px 0 4px; font-size: 13px; color: var(--brand-ink); }
.wl-note.is-clamped { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.wl-more { margin-top: 2px; padding: 4px 0; background: none; border: none; font: inherit; font-size: 13px; color: var(--brand-ink); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.wl-edit:disabled { opacity: .55; cursor: default; }
.wl-edit:disabled:hover { border-color: var(--hair); background: none; }
/* «Перенести»: ровная сетка, дата под вариантом */
.wl-snooze { margin-top: 10px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) auto auto; gap: 8px; align-items: stretch; background: var(--brand-soft); border-radius: var(--radius-sm); padding: 10px; }
.wl-snooze-label { grid-column: 1 / -1; font-size: 13px; color: var(--brand-ink); font-weight: 500; }
.wl-sz { display: flex; flex-direction: column; align-items: center; gap: 1px; line-height: 1.25; }
.wl-sz small { margin: 0; }
/* кнопки в подсказке под именем — настоящие кнопки, не мелкие ссылки */
.wl-hint-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.wl-hint-btn { min-height: 34px; padding: 6px 14px; border: 1px solid rgba(254, 71, 4, .4); border-radius: 999px; background: #fff; font-size: 13px; color: var(--brand-ink); text-decoration: none; }
.wl-hint-btn:hover { background: var(--brand-soft); }
#w-modal .modal-card { scroll-padding-bottom: 96px; }   /* поле в фокусе не прячется под кнопкой «Сохранить» */
.cm-wl { margin: 0 0 14px; }
@media (max-width: 640px) {
  .wl-snooze { grid-template-columns: 1fr 1fr; }
}

/* «Абонементы»: номер ученика слева (в таблице — колонка «№», на телефоне — цифра слева от карточки) */
/* своя раскладка колонок: общие ширины .clients рассчитаны без колонки «№» */
.data-table.clients.ab-t th:nth-child(1) { width: 52px; }
.data-table.clients.ab-t th:nth-child(2) { width: 32%; }
.data-table.clients.ab-t th:nth-child(3) { width: 22%; }
.data-table.clients.ab-t th:nth-child(4) { width: 13%; }
.data-table.clients.ab-t th:nth-child(5) { width: 17%; }
.data-table.clients.ab-t th:nth-child(5), .data-table.clients.ab-t td:nth-child(5) { text-align: right; }
.ab-t th.ab-num-h, .ab-t td.ab-num { white-space: nowrap; text-align: center; padding-left: 8px; padding-right: 4px; font-variant-numeric: tabular-nums; }
.ab-t td.ab-num { color: var(--ink); font-weight: 600; }
/* при прокрутке таблицы вбок (узкое окно, планшет) номер остаётся на месте */
@media (min-width: 641px) {
  .ab-t th.ab-num-h, .ab-t td.ab-num { position: sticky; left: 0; z-index: 1; padding-right: 12px; }
  .ab-t th.ab-num-h { background: #fbf4ec; }
  .ab-t td.ab-num { background: var(--surface); }
  .data-table.clickable.ab-t tbody tr.client-row:hover td.ab-num { background: #fbf4ec; }
}
@media (max-width: 640px) {
  .ab-wrap { background: none; border: none; box-shadow: none; overflow: visible; }   /* карточки без общей подложки — цифры на фоне страницы */
  .data-table.cards.ab-t tr { position: relative; margin-left: 34px; }
  .data-table.cards.ab-t td.ab-num { position: absolute; left: -34px; top: 12px; width: 28px; display: block; padding: 0; border: none; text-align: center; font-size: 15px; color: var(--ink); }
  .data-table.cards.ab-t td.ab-num + td { border-top: none; }   /* имя — верхняя строка карточки */
}
