/* ===================================================================
   style.css — стили SPA Mini App «Быстрый заказ»
   Переписан полностью под новую архитектуру (11 экранов, tab bar, bottom sheet)
   =================================================================== */

/* === CSS-переменные — единая палитра Bistro === */
:root {
  /* Бренд */
  --brand-primary: #B7472A;        /* терракотовый акцент */
  --brand-primary-soft: #F3DDD3;   /* подсветка-подложка */
  --brand-primary-hover: #9D3A20;  /* нажатое состояние */

  /* Поверхности */
  --bg: #F4EFE6;        /* молочный/бумажный фон экрана */
  --surface: #FFFDF8;   /* фон карточек, чуть теплее белого */
  --surface-2: #EBE4D6; /* вложенные поля, фон segmented */

  /* Текст */
  --fg: #1A1410;        /* основной (тёплый чёрный) */
  --fg-muted: #7A6E62;  /* подзаголовки, мета */
  --fg-subtle: #A89E91; /* плейсхолдеры, шевроны */
  --fg-inverse: #FFFDF8; /* текст на тёмном/акцентном */

  /* Границы */
  --border: #E2D9C9;
  --border-strong: #C9BFAB;

  /* Семантика */
  --success: #5B7A3D;
  --warning: #C2832A;
  --danger: #C73E1D;
  --info: #4C6A82;

  /* Тени */
  --shadow-sm: 0 1px 2px rgba(26,20,16,0.05);
  --shadow-md: 0 4px 12px rgba(26,20,16,0.08);

  /* Обратная совместимость со старыми именами (постепенно вычистим) */
  --muted: var(--fg-muted);
  --disabled: var(--fg-subtle);
  --primary: var(--brand-primary);
  --primary-hover: var(--brand-primary-hover);
  --primary-bg: var(--brand-primary-soft);
  --overlay: rgba(26, 20, 16, 0.5);
}

/* === Сброс === */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.4;
  color: var(--fg);
  background: var(--bg);
  min-height: 100vh;
  font-variant-numeric: tabular-nums;
}

.font-spectral { font-family: 'Spectral', serif; }

/* === Контейнер приложения — центрируем и ограничиваем ширину === */
#app {
  max-width: 600px;
  margin: 0 auto;
}

/* === Экран загрузки === */
#loading {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
  font-size: 16px;
}

/* === Экран ошибки === */
#error {
  padding: 24px 16px;
  color: var(--danger);
  text-align: center;
  font-size: 16px;
  line-height: 1.5;
}

/* ===================================================================
   Шапка экрана — sticky, с кнопкой «Назад» и заголовком
   =================================================================== */
.screen-header {
  padding: 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.screen-header__title {
  font-size: 20px;
  font-weight: 600;
  flex: 1;
}

/* Кнопка «Назад» в шапке */
.screen-header__back {
  font-size: 16px;
  color: var(--primary);
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

/* ===================================================================
   Brand Header (Bistro) — верхняя бренд-полоска 64px
   =================================================================== */
.brand-header {
  height: 72px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex-shrink: 0;
}

.brand-header__logo {
  /* Логотип-робот в круге. Высота строки 72px → круг 56px с полями ~8px.
     Картинка уже обрезана до робота; круглая маска прячет остатки колец в углах. */
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;       /* вписать квадратную картинку в круг без искажений */
  background: var(--surface);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.brand-header__close {
  /* Кнопка закрытия — справа в строке шапки. */
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--fg-muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.brand-header__close:active {
  background: var(--surface-2);
  color: var(--fg);
}

.brand-header__title {
  font-family: 'Spectral', serif;
  font-weight: 600;
  font-size: 22px;
  color: var(--fg);
  flex: 1;
  text-align: center;       /* по центру строки между логотипом и крестиком */
}

.brand-header__back {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  color: var(--fg);
  cursor: pointer;
  border-radius: 6px;
  -webkit-tap-highlight-color: transparent;
}

.brand-header__back:active {
  background: var(--surface-2);
}

/* ===================================================================
   Tab Bar (Bistro) — нижняя навигация: monoline-иконки + полоска сверху
   =================================================================== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(56px + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--surface);
  border-top: 1px solid var(--border);
  z-index: 50;
  display: flex;
  max-width: 600px;
  margin: 0 auto;
}

.tab-bar__item {
  flex: 1;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: none;
  border: none;
  cursor: pointer;
  position: relative;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.tab-bar__icon {
  width: 22px;
  height: 22px;
  stroke: var(--fg-muted);
  stroke-width: 1.5;
  fill: none;
}

.tab-bar__label {
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-muted);
}

.tab-bar__item.is-active .tab-bar__icon { stroke: var(--brand-primary); }
.tab-bar__item.is-active .tab-bar__label { color: var(--brand-primary); }

.tab-bar__item.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 2px;
  background: var(--brand-primary);
  border-radius: 1px;
}

/* ===================================================================
   Bistro: page-title (заголовок экрана), chip-row, action-card,
   action-btn, empty-state-card, footer-note
   =================================================================== */

.page-title {
  padding: 20px 16px 16px;
  background: var(--bg);
}
.page-title__title {
  font-weight: 700;
  font-size: 28px;
  color: var(--fg);
  line-height: 1.2;
  letter-spacing: -0.02em;
}
.page-title__meta {
  font-size: 16px;
  color: var(--fg-muted);
  margin-top: 4px;
}

.chip-row {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  margin: 0 0 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }

.chip {
  height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--fg);
  font-size: 14px;
  font-weight: 500;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.chip.is-active {
  background: var(--brand-primary);
  color: var(--fg-inverse);
  border-color: var(--brand-primary);
}
.chip.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.action-card {
  background: var(--surface);
  border-radius: 10px;
  margin: 0 16px 16px;
  overflow: hidden;
}
.action-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 8px;
  font-weight: 600;
  font-size: 20px;
  color: var(--fg);
}
.action-card__status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 400;
  color: var(--fg-muted);
}
.action-card__status .check {
  color: var(--success);
  font-weight: 700;
}
.action-card__divider {
  height: 1px;
  background: var(--border);
  margin: 0 16px;
}
.action-card__info {
  padding: 16px;
  font-size: 16px;
  color: var(--fg-muted);
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 20px 16px;
  background: var(--brand-primary);
  color: var(--fg-inverse);
  border: none;
  font-size: 18px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.action-btn:active { background: var(--brand-primary-hover); }
.action-btn--secondary {
  background: var(--surface);
  color: var(--fg);
  border-top: 1.5px solid var(--border);
}
.action-btn--secondary:active { background: var(--surface-2); }
.action-btn__sub {
  display: block;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.85;
  margin-top: 2px;
}
.action-btn__icon {
  font-size: 18px;
  flex-shrink: 0;
}

.empty-state-card {
  background: var(--surface);
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
  padding: 32px 24px;
  text-align: center;
  margin: 24px 16px;
}
.empty-state-card__title {
  font-weight: 600;
  font-size: 22px;
  color: var(--fg);
  margin-bottom: 8px;
}
.empty-state-card__text {
  font-size: 16px;
  color: var(--fg-muted);
  line-height: 1.5;
}

.footer-note {
  padding: 24px 16px;
  text-align: center;
  font-size: 14px;
  color: var(--fg-muted);
}

/* Учёт fixed tab-bar для содержимого экрана */
.has-tab-bar {
  padding-bottom: calc(56px + env(safe-area-inset-bottom, 0) + 16px);
}

/* ===================================================================
   Bistro: back-header (на экранах с возвратом), sticky subcategory-divider,
   list-item-stepper (форма подачи), inline-stepper 44×44
   =================================================================== */

.back-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.back-header__main { flex: 1; }
.back-header__title {
  font-weight: 700;
  font-size: 20px;
  color: var(--fg);
  line-height: 1.2;
}
.back-header__meta {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 2px;
}

.subcategory-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 8px;
  padding: 8px 16px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
}
.subcategory-divider::before,
.subcategory-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
  max-width: 40px;
}
.subcategory-divider__text {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--fg-muted);
}

.list-item-stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  min-height: 88px;
}
.list-item-stepper.is-zero { opacity: 0.55; }
.list-item-stepper.is-disabled { opacity: 0.4; }
.list-item-stepper__content { flex: 1; min-width: 0; }
.list-item-stepper__title {
  font-weight: 500;
  font-size: 18px;
  color: var(--fg);
}
.list-item-stepper__sub {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 2px;
}
.list-item-stepper__danger {
  font-size: 14px;
  font-weight: 500;
  color: var(--danger);
  margin-top: 4px;
}

/* «Отказ» — обнулить позицию одним тапом. Прижата к названию (margin-right),
   чтобы случайный тап по минусу не попадал по ней. Видна только при qty>0. */
.stepper-zero {
  background: none;
  border: 1px solid var(--border);
  color: var(--fg-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  margin-right: 16px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.stepper-zero:active { background: var(--surface-2, rgba(0,0,0,0.05)); }
.stepper-zero.is-hidden { visibility: hidden; }
.stepper-zero[disabled] { opacity: 0.4; cursor: not-allowed; }

/* Inline-степпер 44×44 для формы подачи (override базового 56×56) */
.stepper--inline .stepper__btn {
  width: 44px;
  height: 44px;
  font-size: 20px;
  border-radius: 10px;
}
.stepper--inline .stepper__value {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 24px;
  text-align: center;
}

/* Bistro: sticky-search (поиск с инпутом 48px) */
.sticky-search {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding: 8px 16px 12px;
}
.sticky-search__input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 16px;
  color: var(--fg);
  font-family: inherit;
  outline: none;
  -webkit-appearance: none;
}
.sticky-search__input::placeholder { color: var(--fg-subtle); }
.sticky-search__input:focus { border-color: var(--border-strong); }

/* Bistro: list-card (строка списка 64px с шевроном/action) */
.list-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  min-height: 64px;
  -webkit-tap-highlight-color: transparent;
}
.list-card:active { background: var(--surface-2); }
.list-card__title {
  font-weight: 500;
  font-size: 18px;
  color: var(--fg);
}
.list-card__sub {
  font-size: 14px;
  color: var(--fg-muted);
  margin-top: 2px;
}
.list-card__chevron {
  font-size: 18px;
  color: var(--fg-subtle);
  flex-shrink: 0;
}

/* Bistro: days-grid 7 колонок × 2 ряда, кружки 36×36 */
.days-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  padding: 8px 16px;
}
.day-pill {
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
  background: transparent;
  border: none;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font-variant-numeric: tabular-nums;
}
.day-pill.is-today { box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.day-pill.is-active {
  background: var(--brand-primary);
  color: var(--fg-inverse);
}
.day-pill.is-active.is-today {
  box-shadow: none;
}
.days-grid__caption {
  padding: 0 16px 16px;
  font-size: 14px;
  color: var(--fg-muted);
}

/* Bistro: baseline-input (поле «база» для суперадмина на экране «По дням») */
.baseline-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
}
.baseline-input__label {
  font-size: 12px;
  color: var(--fg-muted);
}
.baseline-input {
  width: 56px;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  font-size: 14px;
  font-family: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--fg);
}
.baseline-input:focus {
  outline: none;
  border-color: var(--brand-primary);
}
/* Убираем стрелки spin у number input */
.baseline-input::-webkit-inner-spin-button,
.baseline-input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Bistro: ghost-btn (легковесная кнопка действия в строке списка, 32×32) */
.ghost-btn {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--fg);
  font-size: 20px;
  font-family: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 6px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.ghost-btn:active { background: var(--surface-2); }

/* Расширенный list-card: main-блок для клика по названию */
.list-card__main {
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

/* Bistro: success/no-access — empty-state-card в центре экрана */
.success-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 64px - 80px);
  padding: 32px 16px;
}
.success-wrap .empty-state-card {
  margin: 0;
  width: 100%;
  max-width: 360px;
}
.success-btn {
  margin-top: 24px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  border-top: 1.5px solid var(--border);
}
.no-access-id {
  margin-top: 24px;
  font-size: 14px;
  color: var(--fg-muted);
}
.no-access-id strong {
  color: var(--fg);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* Bistro: кнопка «Удалить» в back-header карточки блюда (danger-окраска) */
.dish-card-delete {
  color: var(--danger);
}

/* Bistro: FAB — справа-снизу над таб-баром */
.fab {
  position: fixed;
  right: 16px;
  bottom: calc(72px + env(safe-area-inset-bottom, 0));
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: var(--brand-primary);
  color: var(--fg-inverse);
  border: none;
  display: grid;
  place-items: center;
  font-size: 28px;
  font-weight: 400;
  font-family: inherit;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 40;
  -webkit-tap-highlight-color: transparent;
}
.fab:active { background: var(--brand-primary-hover); }

/* Segmented control (Bistro): «По блюдам / По дням», «Еда / Выпечка» */
.segmented {
  height: 40px;
  background: var(--surface-2);
  border-radius: 10px;
  padding: 3px;
  display: flex;
  gap: 3px;
  margin: 0 16px 16px;
}
.segmented__item {
  flex: 1;
  display: grid;
  place-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg-muted);
  border-radius: 7px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s, color 0.15s;
}
.segmented__item.is-active {
  background: var(--surface);
  color: var(--fg);
  box-shadow: var(--shadow-sm);
}

/* Bistro: action-btn-card (двустрочная, со скруглением 10px) */
.action-btn--card {
  border-radius: 10px;
  margin: 0 16px 12px;
}
.action-btn--card.action-btn--secondary {
  border-top: none;
  border: 1.5px solid var(--border);
}
.action-btn--card:disabled {
  background: var(--surface-2);
  color: var(--fg-subtle);
  cursor: default;
}

/* Bistro: summary-table — сетка через CSS grid */
.summary-table {
  margin: 16px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.summary-table__head,
.summary-table__row {
  display: grid;
  grid-template-columns: 1.6fr repeat(var(--cols, 3), 0.7fr) 0.8fr;
  gap: 8px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
}
.summary-table__head {
  color: var(--fg-muted);
  font-weight: 600;
}
.summary-table__row { color: var(--fg); }
.summary-table__row--total {
  font-weight: 700;
  background: var(--surface-2);
  border-radius: 6px;
  border-bottom: none;
  margin-top: 8px;
}
.summary-table__cell--point { text-align: center; }
.summary-table__cell--point.is-empty { color: var(--fg-subtle); }
.summary-table__cell--total {
  text-align: right;
  font-weight: 600;
}
.summary-table__cell--dish {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Sticky-footer формы подачи */
.order-form-content {
  padding-bottom: 160px;
}
.order-form-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
  z-index: 40;
  max-width: 600px;
  margin: 0 auto;
}
.order-form-footer__stats {
  font-size: 14px;
  color: var(--fg-muted);
  text-align: center;
  margin-bottom: 8px;
}
.order-form-footer__stats strong {
  color: var(--fg);
  font-weight: 600;
}
.order-form-footer .action-btn {
  border-radius: 10px;
}
.order-form-footer .action-btn:disabled {
  background: var(--surface-2);
  color: var(--fg-subtle);
  cursor: default;
}

/* ===================================================================
   Stepper — блок управления количеством [−] число [+]
   =================================================================== */
.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Кнопки stepper — минимальный размер 56×56 для удобства пожилых */
.stepper__btn {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font-size: 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.2s;
}

.stepper__btn:active {
  background: var(--bg);
}

/* Недоступная кнопка — дедлайн истёк */
.stepper__btn--disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Число в stepper — крупное, табличные цифры чтобы не прыгало */
.stepper__value {
  font-size: 20px;
  font-weight: 700;
  min-width: 60px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

/* ===================================================================
   Bottom Sheet — модальная панель снизу
   =================================================================== */
.bottom-sheet-overlay {
  position: fixed;
  inset: 0;
  background: var(--overlay);
  z-index: 200;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-radius: 16px 16px 0 0;
  z-index: 201;
  max-height: 80vh;
  overflow-y: auto;
  padding: 20px 16px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
}

/* Полоска-ручка сверху sheet — визуальный якорь для свайпа */
.bottom-sheet__handle {
  width: 36px;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.bottom-sheet__title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.bottom-sheet__actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

/* ===================================================================
   Toast — всплывающее уведомление
   =================================================================== */
.toast {
  position: fixed;
  bottom: calc(60px + env(safe-area-inset-bottom, 0));
  left: 16px;
  right: 16px;
  background: var(--fg);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  z-index: 300;
  font-size: 14px;
  text-align: center;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
}

/* Toast видим — плавно выезжает */
.toast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Toast с кнопкой undo: текст слева, кнопка справа */
.toast--undo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
}
.toast--undo .toast__msg { flex: 1; min-width: 0; }
.toast__undo {
  background: none;
  border: none;
  color: var(--brand-primary, #ff7a45);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 8px;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}

/* ===================================================================
   Status Card — карточка статуса заказа (цветная полоска слева)
   =================================================================== */
.status-card {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin: 16px;
}

.status-card--success {
  border-left: 4px solid var(--success);
}

.status-card--warning {
  border-left: 4px solid var(--warning);
}

.status-card--danger {
  border-left: 4px solid var(--danger);
}

.status-card--disabled {
  border-left: 4px solid var(--disabled);
}

.status-card__title {
  font-size: 18px;
  font-weight: 600;
}

.status-card__status {
  font-size: 14px;
  margin-top: 4px;
}

.status-card__deadline {
  font-size: 13px;
  color: var(--muted);
  margin-top: 4px;
}

/* ===================================================================
   Buttons — основные стили кнопок
   =================================================================== */
.btn {
  height: 56px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: background 0.2s, opacity 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn--primary {
  background: var(--primary);
  color: white;
  border: none;
}

.btn--primary:hover {
  background: var(--primary-hover);
}

.btn--primary:active {
  background: var(--primary-hover);
}

.btn--primary:disabled {
  background: var(--disabled);
  cursor: default;
}

.btn--secondary {
  background: var(--surface);
  color: var(--fg);
  border: 1.5px solid var(--border);
}

.btn--danger {
  background: var(--danger);
  color: white;
  border: none;
}

.btn--small {
  height: 48px;
  font-size: 14px;
}

/* FAB-кнопка — круглая, фиксированная ширина */
.btn--icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
}

/* ===================================================================
   Forms — поля ввода
   =================================================================== */
.input {
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 16px;
  width: 100%;
  background: var(--surface);
  color: var(--fg);
  outline: none;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--primary);
}

/* ===================================================================
   Dish Row — строка блюда в форме заказа
   =================================================================== */
.dish-row {
  display: flex;
  align-items: center;
  padding: 16px;
  gap: 8px;
}

/* Не заказано (qty=0) — приглушаем */
.dish-row--zero {
  opacity: 0.5;
}

.dish-row__name {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.dish-row__unit {
  font-size: 13px;
  color: var(--muted);
}

/* Бейдж «дедлайн истёк» на блюде */
.dish-row__deadline-badge {
  font-size: 12px;
  color: var(--danger);
  background: #FEE2E2;
  padding: 2px 6px;
  border-radius: 6px;
  margin-left: 4px;
}

/* ===================================================================
   Footer — подвал формы с кнопкой отправки, fixed
   =================================================================== */
.footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  padding: 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom, 0));
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  z-index: 10;
}

/* ===================================================================
   Search Bar — строка поиска с иконкой лупы
   =================================================================== */
.search-bar {
  padding: 12px 16px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.search-bar__input {
  width: 100%;
  height: 48px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  padding: 0 12px 0 40px;
  font-size: 16px;
  background: var(--surface) url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="%236F7380" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><line x1="21" y1="21" x2="16.65" y2="16.65"/></svg>') no-repeat 12px center;
  outline: none;
  transition: border-color 0.2s;
}

.search-bar__input:focus {
  border-color: var(--primary);
}

/* ===================================================================
   Filter Chips — горизонтальный список фильтров
   =================================================================== */
.filter-chips {
  display: flex;
  gap: 8px;
  padding: 0 16px 12px;
  overflow-x: auto;
  scrollbar-width: none;
}

/* Скрываем скроллбар в WebKit */
.filter-chips::-webkit-scrollbar {
  display: none;
}

.chip {
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.chip--active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===================================================================
   Role Selector — выбор роли через чипы
   =================================================================== */
.role-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.role-chip {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: all 0.2s;
}

.role-chip--active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ===================================================================
   User Header — шапка главной с инфой пользователя
   =================================================================== */
.user-header {
  padding: 16px;
}

.user-header__name {
  font-size: 16px;
  font-weight: 600;
}

.user-header__role {
  font-size: 14px;
  color: var(--muted);
}

.user-header__point {
  font-size: 14px;
  color: var(--muted);
  margin-top: 4px;
}

/* ===================================================================
   Category Toggle — переключатель сводки (по людям / по блюдам)
   =================================================================== */
.category-toggle {
  display: flex;
  background: var(--bg);
  border-radius: 8px;
  padding: 4px;
  margin: 16px;
}

.category-toggle__btn {
  flex: 1;
  height: 40px;
  border-radius: 6px;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition: all 0.2s;
  color: var(--muted);
}

.category-toggle__btn--active {
  background: var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  color: var(--fg);
}

/* ===================================================================
   More Menu — экран «Ещё» (настройки, выход)
   =================================================================== */
/* ===================================================================
   Kitchen Status — карточка статуса кухни
   =================================================================== */
.kitchen-status {
  background: var(--surface);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.kitchen-status__row {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
}

/* ===================================================================
   Screen Content — отступы под tab bar
   =================================================================== */
.screen-content {
  padding-bottom: calc(66px + env(safe-area-inset-bottom, 0));
}

/* Экран без tab bar — без отступа */
.screen-content--no-tabs {
  padding-bottom: 0;
}

/* ===================================================================
   Success Screen — экран «Заказ отправлен»
   =================================================================== */
.success-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 40px 16px;
}

.success-screen__icon {
  font-size: 80px;
  color: var(--success);
}

.success-screen__text {
  font-size: 24px;
  font-weight: 700;
  margin-top: 16px;
}

/* ===================================================================
   No Access Screen — экран «Нет доступа»
   =================================================================== */
.no-access {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}

/* ===================================================================
   Utility-классы
   =================================================================== */
.hidden {
  display: none !important;
}

.text-center {
  text-align: center;
}

.mt-8 {
  margin-top: 8px;
}

.mt-16 {
  margin-top: 16px;
}

.gap-8 {
  gap: 8px;
}

.gap-12 {
  gap: 12px;
}

.gap-16 {
  gap: 16px;
}

/* === Глобальная кнопка закрытия Mini App ===
   Видна на всех экранах. Цель ≥ 44×44 px (для пожилых пользователей).
   Расположена поверх контента: правый верхний угол. */
/* Кнопка закрытия приложения переехала в шапку — см. .brand-header__close.
   Прежний глобальный fixed-крестик удалён. */
