/* ===========================================================================
   Оболочка панели: слева навигация, сверху контекст, внутри раздел.

   Направление оформления — деловая панель, а не витрина: спокойный фон,
   белые поверхности, тонкие рамки в один пиксель, лёгкие тени, плотная
   типографика. Крупные скругления, стеклянные размытия и цветные заливки
   на пол-экрана здесь не нужны — они мешают читать числа.
   =========================================================================== */

:root {
  --side-width: 256px;
  --side-narrow: 68px;
  --context-height: 60px;
  --ease-ui: cubic-bezier(0.2, 0, 0, 1);
  --speed: 180ms;
}

.shell {
  display: grid;
  grid-template-columns: var(--side-width) minmax(0, 1fr);
  min-height: 100vh;
  background: var(--bg);
}

/* --- левая колонка ---------------------------------------------------------- */

.shell__side {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: 14px 12px;
  border-right: 1px solid var(--line);
  background: var(--bg-elevated);
}

.shell__brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 16px;
}
.shell__name { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }

.nav { display: flex; flex-direction: column; gap: 18px; overflow-y: auto; flex: 1; }
.nav__group { display: flex; flex-direction: column; gap: 1px; }
.nav__group--bottom { margin-top: auto; }

.nav__title {
  padding: 0 10px 6px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.nav__item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 13.5px;
  text-decoration: none;
  transition: background var(--speed) var(--ease-ui), color var(--speed) var(--ease-ui);
}
.nav__item:hover { background: var(--surface-hover); color: var(--text); }

/* Активный пункт заметен, но без заливки во всю ширину цветом площадки. */
.nav__item.is-active {
  background: var(--surface-hover);
  color: var(--text);
  font-weight: 550;
  box-shadow: inset 2px 0 0 var(--accent);
}

.nav__icon {
  width: 17px; height: 17px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  opacity: 0.75;
}
.nav__item.is-active .nav__icon { opacity: 1; }

/* Цвет площадки — маленькая точка, и только она. */
.nav__dot { width: 8px; height: 8px; margin: 0 5px; border-radius: 50%; flex: 0 0 auto; }

.nav__label { margin-right: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav__count {
  padding: 1px 7px;
  border-radius: 980px;
  background: var(--bg);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-tertiary);
}
.nav__count.is-urgent { background: var(--negative); color: #fff; }

.shell__side-foot { display: flex; gap: 6px; padding-top: 12px; }

/* --- верхняя полоса контекста ------------------------------------------------ */

.shell__main { display: flex; flex-direction: column; min-width: 0; }

.shell__context {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--context-height);
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
}

.context { display: flex; align-items: center; gap: 16px; flex: 1 1 auto; min-width: 0; }
.context__left { display: flex; align-items: center; gap: 16px; min-width: 0; }
.context__where { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.context__title { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.context__note {
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.context__scope { display: flex; align-items: center; gap: 8px; }
.context__right { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.freshness {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 30px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-tertiary);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all var(--speed) var(--ease-ui);
}
.freshness:hover { border-color: var(--line); color: var(--text); background: var(--surface-hover); }
.freshness__icon {
  width: 14px; height: 14px;
  fill: none; stroke: currentColor; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}

.searchbtn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 30px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-solid);
  color: var(--text-tertiary);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all var(--speed) var(--ease-ui);
}
.searchbtn:hover { border-color: var(--line-strong); color: var(--text); }
.searchbtn__key {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  font-family: inherit;
  font-size: 11px;
}

/* --- место раздела ---------------------------------------------------------- */

.shell__outlet { flex: 1; min-width: 0; }
.section { display: block; padding: 22px 24px 48px; max-width: 1440px; }
.section--dashboard { padding: 0; max-width: none; }

/* Доска приносит свои фильтры и вкладки. Раньше они жили в шапке страницы,
   теперь — в самом разделе, поэтому липкость и рамку задаём здесь. */
.section--dashboard .filters {
  position: sticky;
  top: var(--context-height);
  z-index: 20;
  margin: 0;
  padding: 12px 28px;
  max-width: none;
  border-bottom: 1px solid var(--line);
  background: var(--bg-elevated);
}
.section--dashboard .tabs { flex: 0 1 auto; }
.section--dashboard .filters__edit { margin-left: auto; }
.section--dashboard .board { padding: 22px 28px 48px; max-width: none; }
.section--dashboard .editbar { top: var(--context-height); }

@media (max-width: 1024px) {
  .section--dashboard .filters { padding: 10px 14px; }
  .section--dashboard .board { padding: 16px 14px 40px; }
}

.missing { padding: 60px 0; display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.missing__text { margin: 0; color: var(--text-secondary); }

/* --- быстрый переход (Cmd/Ctrl + K) ------------------------------------------ */

.palette { position: fixed; inset: 0; z-index: 90; }
.palette__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.28); }
.palette__window {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  margin: 12vh auto 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: palette-in var(--speed) var(--ease-ui);
}
@keyframes palette-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.palette__input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.palette__input:focus { outline: none; }
.palette__list { max-height: 46vh; overflow-y: auto; padding: 6px; }
.palette__item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.palette__item:hover, .palette__item.is-active { background: var(--surface-hover); }
.palette__title { margin-right: auto; }
.palette__hint { font-size: 11.5px; color: var(--text-tertiary); }
.palette__empty { padding: 16px 10px; margin: 0; color: var(--text-tertiary); font-size: 13px; }

/* --- узкий экран: навигация становится выдвижным ящиком ---------------------- */

.shell__menu { display: none; }
.shell__backdrop { display: none; }

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

  .shell__side {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 70;
    width: var(--side-width);
    transform: translateX(-100%);
    transition: transform var(--speed) var(--ease-ui);
    box-shadow: var(--shadow-lg);
  }
  .shell.is-drawer-open .shell__side { transform: none; }

  .shell__backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 60;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--speed) var(--ease-ui);
  }
  .shell.is-drawer-open .shell__backdrop { opacity: 1; pointer-events: auto; }

  .shell__menu { display: inline-flex; }
  .shell__context { padding: 10px 14px; }
  .section { padding: 16px 14px 40px; }
}

@media (max-width: 640px) {
  .context__note { display: none; }
  .searchbtn__key { display: none; }
}

/* Кому анимация мешает — тому её не показываем. */
@media (prefers-reduced-motion: reduce) {
  .shell__side, .shell__backdrop, .palette__window,
  .nav__item, .freshness, .searchbtn { transition: none; animation: none; }
}

/* --- дорожка контекста: «Каталог › Знания», «Все площадки › Wildberries» --- */

.context__path { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.context__crumb {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-tertiary);
  text-decoration: none;
  white-space: nowrap;
}
.context__crumb:hover { color: var(--text-secondary); text-decoration: underline; }
.context__crumbsep { font-size: 12px; color: var(--text-tertiary); }
