/* Кабинет доставки, мобайл. Общая оболочка экранов и повторяющиеся блоки макета. */

:root {
  --cab-ink: #17211b;
  --cab-bg: #f5f6f2;
  --cab-surface: #fff;
  --cab-surface-2: #f1f4ee;
  --cab-line: #e8ece6;
  --cab-line-2: #e1e7df;
  --cab-line-3: #dce3dc;
  --cab-muted: #98a49b;
  --cab-muted-2: #6d7a70;
  --cab-muted-3: #78857b;
  --cab-accent: #00a34a;
  --cab-accent-deep: #00813a;
  --cab-danger: #c03b2e;
  --cab-star: #ffb020;
}

* { box-sizing: border-box; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { appearance: none; border: 0; background: none; cursor: pointer; }
button:disabled { cursor: default; opacity: .45; }

/* Каркас экрана: шапка и низ фиксированы, середина скроллится. */
.screen {
  position: relative;
  display: flex;
  width: 100%;
  height: 100dvh;
  min-height: 640px;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 0 0;
  overflow: hidden;
  background: var(--cab-bg);
  color: var(--cab-ink);
}
.screen__body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.screen__pad { padding-left: 20px; padding-right: 20px; }

/* Шапки */
.top-brand { display: flex; flex: none; align-items: center; gap: 10px; padding: 0 20px; }
.top-brand img { width: 26px; height: 26px; flex: none; object-fit: contain; }
.top-brand h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.top-brand span { color: var(--cab-muted); font-size: 13px; font-variant-numeric: tabular-nums; line-height: 1; }

.back-row {
  display: flex;
  flex: none;
  align-items: center;
  gap: 8px;
  padding: 0 20px;
  color: var(--cab-muted-2);
  font-size: 13.5px;
  font-weight: 700;
}
.back-row svg { flex: none; }
.back-row__aside { margin-left: auto; color: var(--cab-muted-3); font-weight: 400; white-space: nowrap; }

.title { margin: 0; font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.title-row { display: flex; align-items: baseline; gap: 10px; padding: 14px 20px 0; }
.title-row .count { color: var(--cab-muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.subtitle { margin: 8px 20px 0; color: var(--cab-muted-2); font-size: 14.5px; line-height: 1.4; }

.kicker { color: var(--cab-muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }

/* Карточки */
.card {
  border: 1px solid var(--cab-line);
  border-radius: 18px;
  background: var(--cab-surface);
  overflow: hidden;
}
.card--panel { padding: 16px 18px; border-radius: 20px; }
.card__body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px; }

.hero { position: relative; height: 98px; overflow: hidden; border-radius: 18px; background: var(--cab-surface-2); }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* Кнопки */
.button {
  display: inline-flex;
  min-height: 56px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  white-space: nowrap;
}
.button svg { flex: none; }
.button--primary { background: var(--cab-accent); color: #fff; }
.button--secondary { border: 1px solid var(--cab-line-3); background: var(--cab-surface); color: var(--cab-muted-2); }
.button--danger { background: var(--cab-danger); color: #fff; }
.button--ghost { color: var(--cab-accent-deep); }
.button--sm { min-height: 44px; padding: 0 16px; font-size: 14.5px; }
.button.is-full { width: 100%; }

.actions { display: flex; flex: none; gap: 10px; padding: 14px 16px 0; }
.actions--stack { flex-direction: column; }
.actions .button { min-width: 0; flex: 1; }

/* Плавающая кнопка над таб-баром */
.fab {
  position: absolute;
  right: 18px;
  bottom: 106px;
  min-height: 56px;
  padding: 0 22px;
  border-radius: 999px;
  background: var(--cab-accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 14px 26px -16px rgba(0, 129, 58, .9);
}
.fab svg { flex: none; }

/* Сегментированный переключатель */
.segmented { display: inline-flex; align-items: center; gap: 3px; padding: 3px; border: 1px solid #e4e9e2; border-radius: 999px; background: var(--cab-surface-2); }
.segmented button {
  min-height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  color: var(--cab-muted-2);
  font-size: 12.5px;
  font-weight: 600;
}
.segmented button.is-active { background: var(--cab-surface); color: var(--cab-ink); font-weight: 700; box-shadow: 0 1px 3px rgba(23, 33, 27, .12); }
.segmented--wide { display: flex; border: 0; padding: 3px; }
.segmented--wide button { flex: 1; min-height: 40px; font-size: 14.5px; }
.segmented--wide button.is-active { box-shadow: 0 1px 2px rgba(23, 33, 27, .08); }

/* Поля формы */
.field { display: flex; flex-direction: column; gap: 8px; }
.field__label { color: var(--cab-muted); font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.field__hint { color: var(--cab-muted); font-size: 13px; line-height: 1.45; }
.input,
.textarea {
  min-height: 48px;
  padding: 13px 14px;
  border: 1px solid var(--cab-line-3);
  border-radius: 14px;
  background: #fbfcfa;
  font-size: 15.5px;
  font-weight: 600;
}
.textarea { min-height: 96px; resize: none; font-weight: 400; line-height: 1.45; }
.input::placeholder, .textarea::placeholder { color: var(--cab-muted); font-weight: 400; }

/* Строка списка внутри карточки */
.row { display: flex; min-height: 48px; align-items: center; gap: 10px; }
.row + .row { box-shadow: inset 0 1px 0 #eff2ed; }
.row__name { flex: none; font-size: 14.5px; font-weight: 600; }
.row__value { margin-left: auto; flex: none; color: var(--cab-muted-2); font-size: 14.5px; font-variant-numeric: tabular-nums; }
.row__value--empty { color: var(--cab-muted); }

/* Плашки */
.badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--cab-surface-2);
  color: #8b978c;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.badge--live { background: #e9f6ee; color: var(--cab-accent-deep); }
.badge--live i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--cab-accent); box-shadow: 0 0 0 3px rgba(0, 163, 74, .15); }

.rating { display: inline-flex; flex: none; align-items: center; gap: 4px; font-size: 14px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.rating svg { flex: none; display: block; }
.rating--empty { color: var(--cab-muted-2); font-size: 12.5px; font-weight: 600; }

/* Подсказка-полоска */
.note {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 16px;
  border-radius: 16px;
  background: #edf1ec;
  color: var(--cab-muted-2);
  font-size: 13.5px;
}
.note svg { flex: none; color: #8b978c; }
.note span { flex: 1; min-width: 0; }

/* Пустой экран. gap: 0 гасит .empty из theme.css, отступы здесь на маргинах. */
.empty {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  gap: 0;
  align-items: center;
  justify-content: center;
  padding: 26px 24px;
  border: 1.5px dashed #cfdacd;
  border-radius: 20px;
  background: var(--cab-surface);
  text-align: center;
}
.empty__icon {
  display: grid;
  width: 58px;
  height: 58px;
  flex: none;
  place-items: center;
  border-radius: 999px;
  background: #e5f4eb;
  color: var(--cab-accent-deep);
}
.empty h3 { margin: 16px 0 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.empty p { margin: 8px 0 0; max-width: 250px; color: var(--cab-muted-2); font-size: 15px; line-height: 1.45; }
.empty .button { margin-top: 20px; }

/* Шаги мастера */
.steps { display: flex; gap: 6px; margin: 14px 20px 0; }
.steps i { flex: 1; height: 4px; border-radius: 999px; background: #dfe5dd; }
.steps i.is-done { background: var(--cab-accent); }

/* Шторка снизу */
.sheet-scrim { position: absolute; inset: 0; z-index: 70; display: flex; align-items: flex-end; background: rgba(23, 33, 27, .42); }
.sheet {
  width: 100%;
  padding: 12px 20px max(30px, env(safe-area-inset-bottom));
  border-radius: 26px 26px 0 0;
  background: var(--cab-surface);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sheet__grip { align-self: center; width: 40px; height: 4px; margin-bottom: 12px; border-radius: 999px; background: var(--cab-line-3); }
.sheet h3 { margin: 0; font-size: 21px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; }
.sheet p { margin: 0; color: var(--cab-muted-2); font-size: 14.5px; line-height: 1.45; }
.sheet .actions { padding: 16px 0 0; }

/* Нижняя навигация */
.tab-bar {
  display: flex;
  flex: none;
  gap: 6px;
  padding: 12px 18px max(24px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--cab-line-2);
  background: var(--cab-surface);
  box-shadow: 0 -8px 20px -16px rgba(23, 33, 27, .4);
}
.tab-bar__item {
  display: flex;
  flex: 1;
  min-height: 52px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--cab-muted-3);
  font-size: 11.5px;
  font-weight: 500;
}
.tab-bar__item i { display: inline-flex; min-height: 26px; align-items: center; justify-content: center; padding: 0 16px; border-radius: 999px; }
.tab-bar__item.is-active { color: var(--cab-accent-deep); font-weight: 700; }
.tab-bar__item.is-active i { background: #e5f4eb; }

/* Хосты кабинета и роутовых экранов прозрачны, чтобы .screen был флекс-ребёнком .app. */
app-cabinet,
app-catalog, app-catalog-ai-import, app-catalog-category, app-catalog-item-create,
app-catalog-item-edit, app-catalog-item-history, app-menus, app-menu-published,
app-menu-report, app-menu-report-item, app-menu-create-items, app-menu-create-category,
app-menu-create-settings, app-menu-create-pay, app-scan, app-profile { display: contents; }
router-outlet { display: none; }

/* На широком экране кабинет — телефонная карточка по центру, с тенью и масштабом. */
@media (min-width: 600px) {
  .screen {
    width: 402px;
    height: 715px;
    min-height: 715px;
    flex: none;
    box-shadow: 0 24px 70px -32px rgba(23, 33, 27, .38);
    transform: scale(var(--vm-desktop-scale, 1));
    transform-origin: center;
  }
}
