/**
 * Кабинет бизнеса /biz — claim + правка NAP.
 * Визуальный язык как hub/admin: Fraunces brand, зелёный акцент.
 */

/* RU: Ф6.7 (14.09.2026): цвета этого файла — только токены --k-* из kartivi.css. Тему переключает theme.js (кабинеты) или public.js
       (витрина), и ночная тема меняет токены; зашитый светлый литерал оставался бы белой плашкой на тёмном фоне. Полупрозрачные подложки —
       color-mix от поверхности темы, а не rgba(255,255,255,…). Литералы, если остались, — только печать и нейтральные тени.
   EN: Ф6.7 (2026-09-14): this file's colours are only --k-* tokens from kartivi.css. The theme is switched by theme.js (cabinets) or public.js
       (storefront), and the night theme changes the tokens; a hardcoded light literal would stay a white plate on a dark ground. Translucent backings are color-mix
       from the theme surface rather than rgba(255,255,255,…). Remaining literals, if any, are print-only and neutral shadows. */
:root {
  /* RU: Ниже — алиасы на общий слой токенов public/css/kartivi.css.
     Имена сохранены: на них завязаны существующие правила этого файла.
     EN: Below are aliases onto the shared token layer public/css/kartivi.css.
     The names are kept: this file's existing rules depend on them. */
  --ink: var(--k-text);
  --ink-soft: var(--k-text-muted);
  --paper: var(--k-bg);
  --card: var(--k-surface);
  --line: var(--k-border);
  --accent: var(--k-brand);
  --danger: var(--k-danger);
  --font: var(--k-font-ui);
  --brand: var(--k-font-brand);
}

* {
  box-sizing: border-box;
}

body.biz {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(ellipse 80% 50% at 0% 0%, var(--k-atmo-glow) 0%, transparent 55%),
    linear-gradient(165deg, var(--k-atmo-1) 0%, var(--k-atmo-2) 100%);
}

.biz-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--k-surface) 72%, transparent);
}

.biz-brand {
  font-family: var(--brand);
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--accent);
  text-decoration: none;
}

.biz-tag {
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.biz-nav {
  margin-left: auto;
  display: flex;
  gap: 1rem;
}

.biz-nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.biz-nav a:hover {
  color: var(--accent);
}

.biz-main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.75rem 1.25rem 3rem;
}

.biz-hero h1 {
  font-family: var(--brand);
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.biz-lead {
  margin: 0 0 1.5rem;
  color: var(--ink-soft);
  line-height: 1.5;
}

.biz-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.25rem 1.35rem;
  margin-bottom: 1rem;
}

.biz-card h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.biz-row {
  display: flex;
  gap: 0.5rem;
}

.biz-row input {
  flex: 1;
}

.biz-stack {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
  font-weight: 600;
}

input,
textarea {
  font: inherit;
  font-weight: 400;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.7rem;
}

button {
  font: inherit;
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 0.55rem 0.95rem;
  background: var(--accent);
  color: var(--k-text-on-accent);
  font-weight: 600;
}

.biz-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  margin-top: 0.75rem;
}

.biz-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.biz-actions .biz-ghost {
  margin-top: 0;
}

.biz-check {
  flex-direction: row;
  align-items: center;
  font-weight: 400;
}

.biz-check input {
  width: auto;
}

.biz-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.biz-firm {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  text-align: left;
  background: var(--k-surface-3);
  color: var(--ink);
  border: 1px solid var(--line);
  width: 100%;
}

.biz-firm span {
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 400;
}

.biz-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--accent);
  background: var(--k-brand-soft);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.biz-firm-label {
  font-weight: 600;
  margin: 0 0 0.75rem;
}

.biz-hint {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
  font-weight: 400;
  line-height: 1.4;
}

.biz-msg {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--accent);
}

.biz-msg.is-error {
  color: var(--danger);
}

.biz-msg.is-warn {
  color: var(--k-warn);
  background: var(--k-warn-soft);
  border: 1px solid color-mix(in srgb, var(--k-warn) 35%, transparent);
  border-radius: 8px;
  padding: 0.65rem 0.85rem;
  margin: 0 0 1rem;
}

.biz-foot {
  text-align: center;
  padding: 1rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.biz-extras {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.biz-extras h3 {
  margin: 1.25rem 0 0.6rem;
  font-size: 1rem;
  font-weight: 700;
}

.biz-extras h3:first-child {
  margin-top: 0;
}

.biz-mini-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.biz-mini-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.6rem;
  background: var(--k-surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.9rem;
}

.biz-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.biz-media-grid figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.biz-media-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--k-surface-2);
}

.biz-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}

.biz-stats > div {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.65rem 0.75rem;
  background: var(--k-surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.biz-stats strong {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.biz-stats span {
  font-size: 0.75rem;
  color: var(--ink-soft);
  line-height: 1.3;
}

.biz-stats .biz-delta {
  font-size: 0.7rem;
  color: var(--ink-soft);
}

.biz-stats .biz-delta.up {
  color: var(--k-ok);
}

.biz-stats .biz-delta.down {
  color: var(--k-danger);
}

#stats-days .biz-ghost.is-on {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--k-brand-soft);
}

.biz-series {
  margin-top: 0.85rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--k-surface-3);
}

.biz-series-label {
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}

.biz-bars {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 56px;
}

.biz-bars span {
  flex: 1;
  min-width: 4px;
  background: color-mix(in srgb, var(--k-brand) 45%, var(--k-surface));
  border-radius: 2px 2px 0 0;
}

.biz-bars span.is-peak {
  background: var(--accent);
}

.biz-complete {
  margin-top: 0.85rem;
  padding: 0.75rem;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.biz-complete-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.biz-complete ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.75rem;
  font-size: 0.8rem;
}

.biz-complete li.ok {
  color: var(--k-ok);
}

.biz-complete li.miss {
  color: var(--ink-soft);
}

.biz-demand {
  margin: 0.5rem 0 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
}
.biz-demand-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.75rem;
  align-items: baseline;
  margin-bottom: 0.55rem;
}
.biz-demand-head strong {
  font-size: 1.35rem;
  font-family: var(--brand);
  color: var(--accent);
}
.biz-demand-list,
.biz-demand-tips {
  margin: 0;
  padding-left: 1.1rem;
  font-size: 0.9rem;
}
.biz-demand-list li {
  margin: 0.25rem 0;
}
.biz-demand-list em {
  color: var(--ink-soft);
  font-style: normal;
  font-size: 0.78rem;
}
.biz-demand-tips {
  margin-top: 0.65rem;
  color: var(--ink-soft);
  list-style: none;
  padding-left: 0;
}
.biz-demand-tips li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  align-items: center;
  margin: 0.45rem 0;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: color-mix(in srgb, var(--k-brand) 6%, transparent);
}
.biz-demand-act {
  margin-left: auto;
  border: 0;
  border-radius: 8px;
  padding: 0.35rem 0.65rem;
  background: var(--accent, var(--k-brand));
  color: var(--k-text-on-accent);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}
.biz-demand-act:hover {
  filter: brightness(1.05);
}
.biz-focus-pulse {
  outline: 2px solid var(--accent, var(--k-brand));
  outline-offset: 2px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--k-brand) 18%, transparent);
  transition: box-shadow 0.3s ease;
}

@media (max-width: 520px) {
  .biz-row {
    flex-direction: column;
  }
  .biz-demand-act {
    margin-left: 0;
    width: 100%;
  }
}

/* ——— Заявки, акции, визитка (P99) ——— */
/* RU: Счётчик новых заявок у заголовка. Единственное место в кабинете, где число
       требует действия сегодня, поэтому оно и выделено.
   EN: A counter of new leads beside the heading. The only place in the cabinet where a number
       calls for action today, hence the emphasis. */
.biz-badge {
  display: inline-block;
  min-width: 1.4rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--k-brand);
  color: var(--k-text-on-accent);
  font-size: 0.78rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.biz-lead-item {
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--k-border-soft);
  border-radius: var(--k-r-2);
  margin-bottom: 0.35rem;
  list-style: none;
}

/* RU: Новая заявка отмечена полосой слева, а не заливкой: заливка спорила бы с
       карточками услуг и фото, а полоса читается как «сюда ещё не смотрели».
   EN: A new lead is marked with a rule on the left rather than a fill: a fill would compete with
       the service and photo cards, while a rule reads as "not looked at yet". */
.biz-lead-item.is-new {
  border-left: 3px solid var(--k-brand);
}

.biz-lead-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem;
  align-items: baseline;
}

.biz-lead-when {
  font-size: 0.76rem;
  color: var(--k-text-muted);
}

.biz-lead-contact {
  font-size: 0.88rem;
  margin-top: 0.15rem;
}

.biz-lead-msg {
  margin: 0.3rem 0 0.4rem;
  font-size: 0.85rem;
  color: var(--k-text-muted);
  line-height: 1.4;
}

/* RU: Ф6.5. Заявки лежат в настоящем списке внутри #leads-list, и у него не должно быть маркеров и отступов
       браузера: вид задают сами пункты.
   EN: Ф6.5. The leads sit in a real list inside #leads-list, which must carry no browser bullets or indentation:
       the items define the look. */
.biz-lead-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* RU: Пункт заявки подпадает под общее `.biz-mini-list li` — строку-флекс с зашитым светлым фоном `#f5faf6`. Для
       заявки это ломало и раскладку (имя, контакт, сообщение и кнопки вставали в одну строку), и ночную тему:
       светлая плашка со светлым текстом не читалась. Селектор сильнее общего правила и берёт цвета из токенов.
   EN: A lead item falls under the shared `.biz-mini-list li` — a flex row with a hard-coded light `#f5faf6`
       background. For a lead that broke both the layout (name, contact, message and buttons lined up in one row)
       and the night theme: a light plate with light text was unreadable. The selector outranks the shared rule and
       takes its colours from tokens. */
.biz-mini-list li.biz-lead-item {
  display: block;
  background: var(--k-surface);
  color: var(--k-text);
}

.biz-lead-contact a {
  color: var(--k-brand-ink);
}

/* RU: Отказ загрузки заявок — цветом ошибки, но словами тоже: цвет один ничего не объясняет.
   EN: A failed leads load uses the danger colour, with words as well: colour alone explains nothing. */
.biz-hint.is-error {
  color: var(--k-danger);
}

/* RU: Закончившаяся акция приглушена, но не скрыта: владелец видит своё расписание
       целиком и может повторить прошлую акцию, не вспоминая её текст.
   EN: An expired promotion is dimmed but not hidden: the owner sees their whole schedule and can
       repeat a past promotion without recalling its wording. */
.biz-promo-item.is-past {
  color: var(--k-text-muted);
}

.biz-share-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.45rem;
}

.biz-share-row > span {
  flex: 0 0 100%;
  font-size: 0.78rem;
  color: var(--k-text-muted);
}

.biz-share-row > input {
  flex: 1 1 14rem;
  /* RU: Моноширинный: в коде виджета важен каждый символ, и пропущенную кавычку в
         пропорциональном шрифте не видно.
     EN: Monospaced: every character matters in the widget code, and a missing quote is invisible
         in a proportional font. */
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
}

/* ——— Полнота карточки как онбординг (P99) ——— */
/* RU: Цель названа рядом с процентом: без неё число не говорит, много это или мало.
   EN: The goal is named next to the percentage: without it the number does not say whether it is
       a lot or a little. */
.biz-complete-goal {
  display: block;
  font-size: 0.78rem;
  color: var(--k-text-muted);
  margin: 0.15rem 0 0.4rem;
}

.biz-complete-goal.is-ok {
  color: var(--k-ok);
}

.biz-complete-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* RU: Строка пробела — три части: чего не хватает, зачем это нужно и кнопка к полю.
       На узком экране подсказка переносится под название, а кнопка остаётся справа:
       она и есть действие, ради которого строка показана.
   EN: A gap row has three parts: what is missing, why it matters, and a button to the field. On a
       narrow screen the hint wraps under the label while the button stays on the right: it is the
       action the row exists for. */
.biz-complete-list li.miss {
  display: grid;
  grid-template-columns: minmax(6rem, auto) 1fr auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--k-border-soft);
}

.biz-complete-list li.miss:last-child {
  border-bottom: 0;
}

.biz-complete-label {
  font-size: 0.88rem;
}

.biz-complete-hint {
  font-size: 0.76rem;
  color: var(--k-text-muted);
  line-height: 1.35;
}

.biz-complete-done {
  margin: 0.4rem 0 0;
  font-size: 0.78rem;
  color: var(--k-text-muted);
}

@media (max-width: 560px) {
  .biz-complete-list li.miss {
    grid-template-columns: 1fr auto;
  }
  .biz-complete-hint {
    grid-column: 1 / -1;
  }
}

/* RU: Блок «Что сделать» — фаза P103.
       Цвета берутся только из токенов `--k-*`: у кабинета есть тёмная тема, и
       литеральный `#f5faf6`, как у `.biz-mini-list` выше, в ней даёт белую плашку с
       белым текстом. Новый блок сознательно не повторяет этот приём.
   EN: The "What to do" block — phase P103.
       Colors come only from `--k-*` tokens: the cabinet has a dark theme, and a literal `#f5faf6`
       like `.biz-mini-list` above yields a white plate with white text in it. The new block
       deliberately does not repeat that trick. */
.biz-tasks {
  margin: 0 0 var(--k-s-5);
  padding: var(--k-s-4);
  background: var(--k-surface-2);
  border: 1px solid var(--k-border);
  border-radius: var(--k-r-3);
}

.biz-tasks h3 {
  margin: 0;
  font-size: var(--k-fs-5);
}

.biz-tasks-list {
  list-style: none;
  margin: var(--k-s-3) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--k-s-2);
}

.biz-task {
  display: flex;
  flex-direction: column;
  gap: var(--k-s-1);
  padding: var(--k-s-3);
  background: var(--k-surface);
  border: 1px solid var(--k-border-soft);
  border-radius: var(--k-r-2);
  /* RU: Полоса слева кодирует срочность цветом в дополнение к порядку: порядок
         виден только при сравнении соседей, а полоса — сразу.
     EN: The stripe on the left encodes urgency by colour in addition to order: order is visible only
         by comparing neighbours, whereas the stripe is visible at once. */
  border-left: 3px solid var(--k-border);
}

.biz-task[data-priority="3"] { border-left-color: var(--k-danger); }
.biz-task[data-priority="2"] { border-left-color: var(--k-warn); }

.biz-task-title {
  font-weight: 700;
  font-size: var(--k-fs-4);
  color: var(--k-text);
}

/* RU: Основание — не подпись мелким шрифтом «по требованию», а половина смысла дела:
       по нему владелец решает, делать ли. Поэтому обычный читаемый размер, а не 11px.
   EN: The rationale is not fine print added "as required" but half the point of the task: the owner
       decides whether to act by reading it. Hence an ordinary readable size, not 11px. */
.biz-task-basis {
  margin: 0;
  font-size: var(--k-fs-3);
  line-height: var(--k-lh-normal);
  color: var(--k-text-muted);
}

.biz-task-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--k-s-2);
  margin-top: var(--k-s-2);
}

.biz-task-actions button {
  min-height: var(--k-tap-min);
  padding: 0 var(--k-s-3);
  border: 1px solid var(--k-border);
  border-radius: var(--k-r-2);
  background: var(--k-surface-2);
  color: var(--k-text);
  font: inherit;
  font-size: var(--k-fs-3);
  cursor: pointer;
}

.biz-task-actions button:hover { border-color: var(--k-brand); }

.biz-task-actions button[data-action="done"] {
  background: var(--k-brand);
  color: var(--k-text-on-accent);
  border-color: var(--k-brand);
}

.biz-task-agent {
  font-size: var(--k-fs-1);
  color: var(--k-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
