/* barkstock — продуктовый слой поверх bark-brand-system.
   Здесь только то, чего нет в brand.css: раскладка оболочки, режим сенсорных
   экранов и карточка входа. Цвета, типографика и компоненты — из brand.css,
   ни один токен здесь не переопределяется. */

/* ── Оболочка ─────────────────────────────────────────────────────────── */

.bs-shell {
  display: flex;
  min-height: 100dvh;
}

.bs-shell > .bark-main {
  flex: 1;
  min-width: 0;
}

/* ── Переключатель меню (сенсорные экраны и узкие окна) ───────────────── */

.bs-navtoggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 810;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

.bs-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 799;
  background: rgb(0 0 0 / 35%);
}

.bs-backdrop[data-open] { display: block; }

/* Сайдбар превращается в выдвижную панель там, где ширины мало.
   Порог 1280px выбран так, чтобы сенсорные 1024×768 попадали сюда:
   244px сайдбара на таком экране забирают четверть рабочей области. */
@media (max-width: 1279px) {
  .bs-navtoggle { display: flex; }

  .bark-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 800;
    transform: translateX(-100%);
    transition: transform var(--motion-base) var(--ease-out);
    box-shadow: var(--shadow-pop);
  }

  .bark-sidebar[data-open] { transform: translateX(0); }

  .bs-shell > .bark-main { padding-top: 68px; }
}

@media (prefers-reduced-motion: reduce) {
  .bark-sidebar { transition: none; }
}

/* ── Режим сенсорного экрана (АРМ упаковщика, 1024×768) ───────────────── */
/* Плотность бренда рассчитана на мышь. Здесь пальцем, стоя, у стола упаковки —
   цели касания увеличены, всё остальное бренд-системы без изменений. */

[data-density="touch"] .bark-btn {
  min-height: 64px;
  padding: 0 28px;
  font-size: 17px;
  font-weight: 600;
}

[data-density="touch"] .bark-btn--lg {
  min-height: 76px;
  font-size: 19px;
}

[data-density="touch"] .bark-table th,
[data-density="touch"] .bark-table td {
  height: 56px;
  font-size: 16px;
}

[data-density="touch"] .bark-field__control { min-height: 56px; font-size: 17px; }
[data-density="touch"] .bark-sidebar__item { padding: 14px 12px; font-size: 16px; }
[data-density="touch"] .bark-h1 { font-size: 24px; }

/* ── Экран упаковки ───────────────────────────────────────────────────── */

.bs-order {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
}

@media (max-width: 1100px) {
  .bs-order { grid-template-columns: minmax(0, 1fr); }
}

.bs-order__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.bs-order__brand { height: 56px; width: auto; }

/* Количество и остаток — это данные, значит IBM Plex Mono. */
.bs-qty,
.bs-stock {
  font-family: var(--mono);
  font-feature-settings: "tnum" 1;
  white-space: nowrap;
}

.bs-qty--many { font-size: 19px; font-weight: 600; }

.bs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.bs-actions .bark-btn { flex: 1 1 220px; }

/* Крупный статус для пустой очереди и недоступного CRM — читается издалека. */
.bs-state {
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 64px 24px;
  text-align: center;
}

.bs-state__icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--chip);
  color: var(--ink-2);
}

.bs-state__title { font-size: 26px; font-weight: 700; color: var(--ink); }
.bs-state__hint { color: var(--muted); max-width: 420px; }

/* ── Карточка входа ───────────────────────────────────────────────────── */

.bs-auth {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding: 24px;
  background: var(--bg);
}

.bs-auth__card {
  width: 100%;
  max-width: 380px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.bs-auth__title { margin: 20px 0 4px; }
.bs-auth__hint { margin-bottom: 20px; }

.bs-auth__form { display: grid; gap: 14px; }

.bs-auth .bark-alert { margin-bottom: 16px; }

/* ── Таблицы отчётов ──────────────────────────────────────────────────── */

.bs-tablewrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: var(--surface);
}

.bs-tablewrap .bark-table { margin: 0; }

/* ── Карточки портала ─────────────────────────────────────────────────── */

.bs-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 20px;
  color: inherit;
  text-decoration: none;
  transition: border-color var(--motion-fast) var(--ease-out),
              box-shadow var(--motion-fast) var(--ease-out);
}

.bs-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-pop);
}

.bs-card__icon {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
}

.bs-card__body { display: grid; gap: 4px; }

.bs-grid--cards { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
