/* Блок ig-fd. Добавлен при переносе (очередь 6, SPEC §30): «Папка объекта» - в выгрузках экрана
   нет (решение Никиты 28.09.2026: холста нет, вёрстка по действующей дизайн-системе). Слева папки
   деревом, справа файлы выбранной папки строками ig-os__trow. Гибкий столбец имени задаётся через
   родителя: .ig-os__trow > span { flex-shrink: 0 } перебивает правило по одному классу */

.ig-fd {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
}

.ig-fd__side {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-200);
  background: var(--surface-50);
  overflow: auto;
}

.ig-fd__sidehead {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 10px var(--space-3);
  border-bottom: 1px solid var(--border-200);
}

.ig-fd__sidetitle {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
}

.ig-fd__sidehead .ig-btn {
  margin-left: auto;
}

.ig-fd__tree {
  margin: 0;
  padding: var(--space-2);
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ig-fd__folder {
  display: flex;
  align-items: center;
  gap: 4px;
  min-height: 34px;
  padding: 0 4px 0 8px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
}

.ig-fd__folder:hover {
  background: var(--surface-100);
}

.ig-fd__folder--current,
.ig-fd__folder--current:hover {
  background: var(--brand-50);
  color: var(--brand-700);
  font-weight: 600;
}

/* Отступ вложенных папок - по глубине, вложенность не больше пяти уровней (folder.MAX_DEPTH) */

.ig-fd__folder--depth-1 {
  padding-left: 26px;
}

.ig-fd__folder--depth-2 {
  padding-left: 44px;
}

.ig-fd__folder--depth-3 {
  padding-left: 62px;
}

.ig-fd__folder--depth-4 {
  padding-left: 80px;
}

.ig-fd__link {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: inherit;
  text-decoration: none;
}

.ig-fd__link .ig-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--brand-600);
}

.ig-fd__fname {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-fd__count {
  flex-shrink: 0;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  box-sizing: border-box;
  border-radius: var(--radius-pill);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-200);
  color: var(--ink-600);
  font-size: 11px;
  font-weight: 600;
}

/* Действия папки видны у выбранной папки, под мышью и при фокусе с клавиатуры */

.ig-fd__tools {
  flex-shrink: 0;
  display: flex;
  gap: 2px;
  visibility: hidden;
}

.ig-fd__folder:hover .ig-fd__tools,
.ig-fd__folder:focus-within .ig-fd__tools,
.ig-fd__folder--current .ig-fd__tools {
  visibility: visible;
}

.ig-fd__main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.ig-fd__title {
  margin: 0;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ig-fd__upload {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ig-fd__limit {
  font-size: 12px;
  color: var(--ink-600);
}

.ig-fd__files {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* Столбцы файлов */

.ig-os__thead > .ig-fd__name,
.ig-os__trow > .ig-fd__name {
  flex: 1 1 0;
  min-width: 140px;
}

.ig-fd__file {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.ig-fd__file .ig-icon {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.ig-fd__size {
  width: 80px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-600);
}

.ig-fd__pages {
  width: 44px;
  font-variant-numeric: tabular-nums;
  color: var(--ink-600);
}

.ig-fd__state {
  width: 300px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  padding: 6px 0;
}

.ig-fd__state .ig-badge {
  max-width: 100%;
  height: auto;
  min-height: 22px;
  padding-top: 3px;
  padding-bottom: 3px;
  border-radius: 11px;
  white-space: normal;
}

.ig-fd__state .ig-btn {
  height: 26px;
  font-size: 12.5px;
}

.ig-fd__note {
  font-size: 12px;
  color: var(--ink-600);
}

.ig-fd__error {
  flex-basis: 100%;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 12px;
  line-height: 16px;
  color: var(--danger-600);
}

.ig-fd__error .ig-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* «Распознаются страницы …» - пока идёт запрос первой части (hx-indicator на ячейке) */

.ig-fd__wait {
  display: none;
  font-size: 12px;
  color: var(--ink-600);
}

.ig-fd__state.htmx-request .ig-fd__wait {
  display: inline;
}

.ig-fd__who {
  width: 185px;
  font-size: 12.5px;
  color: var(--ink-600);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ig-fd__act {
  width: 76px;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.ig-fd__act form {
  display: flex;
}
