/* Редизайн: form (страница объекта). Загружается после styles.css и переопределяет его.
   Все правила привязаны к странице объекта (#formSections, .page-shell--form, .form-*, .obj-*, .copy-*).
   Эталон дизайна — главная: list.css и .page-head из shell.css. */

/* ============================================
   Тёмная металлическая таблица (как .objects-table на главной)
   ============================================ */

#formSections .inventory-table,
#formSections .list-table {
  overflow: visible; /* выпадающие списки combo не должны обрезаться */
  border: 1px solid rgba(166, 184, 204, 0.18);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-dark-strong) 0%, var(--surface-dark) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 34px rgba(15, 20, 28, 0.18);
}

#formSections .table-head {
  padding: 14px 18px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 247, 251, 0.6);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: none;
  backdrop-filter: none;
}

#formSections .table-row {
  padding: 14px 18px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  transition: background 180ms ease;
}

#formSections .table-head + .table-row {
  border-top: 0;
}

#formSections .table-row:nth-child(odd) {
  background: transparent;
}

#formSections .table-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

#formSections .table-row:focus-within {
  background: rgba(255, 255, 255, 0.06);
}

/* Поля внутри тёмных строк: «тёмное стекло» */
#formSections .table-row .inline-input,
#formSections .table-row .inline-textarea,
#formSections .table-row .combo-field__input,
#formSections .table-row select.inline-input {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-inverse);
  box-shadow: none;
  color-scheme: dark;
}

#formSections .table-row .inline-textarea {
  padding-top: 12px;
  padding-bottom: 12px;
}

#formSections .table-row .inline-input::placeholder,
#formSections .table-row .inline-textarea::placeholder,
#formSections .table-row .combo-field__input::placeholder {
  color: rgba(244, 247, 251, 0.45);
}

#formSections .table-row .inline-input:focus,
#formSections .table-row .inline-textarea:focus,
#formSections .table-row .combo-field__input:focus,
#formSections .table-row select.inline-input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 0 3px rgba(20, 90, 214, 0.35);
}

#formSections .table-row .combo-field__toggle {
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(244, 247, 251, 0.85);
  box-shadow: none;
}

#formSections .table-row .combo-field__toggle:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.14);
  color: var(--text-inverse);
}

/* Бейдж «только чтение» */
#formSections .table-row .readonly-chip {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

/* Кнопка «Удалить» строки: компактная ghost на тёмном */
#formSections .table-row .tiny-button--danger {
  min-height: 36px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-inverse);
  box-shadow: none;
}

#formSections .table-row .tiny-button--danger svg {
  color: var(--danger);
}

#formSections .table-row .tiny-button--danger:hover {
  background: rgba(199, 68, 49, 0.22);
  border-color: rgba(199, 68, 49, 0.4);
}

#formSections .tiny-button svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
}

/* ============================================
   Заголовки секций и кнопки «Добавить» / «Выбрать файл» (как на главной)
   ============================================ */

#formSections .section-card,
.page-shell--form .form-sidebar .sidebar-card {
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(233, 240, 247, 0.78) 0%, rgba(198, 210, 223, 0.56) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58), var(--glass-shadow-md);
}

#formSections .section-card {
  padding: clamp(20px, 3vw, 28px);
}

#formSections .section-card__top {
  align-items: center;
  margin-bottom: 18px;
}

#formSections .section-card__top .section-tag,
.page-shell--form .form-sidebar .section-tag {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-transform: none;
  line-height: 1.15;
}

#formSections .section-card__top .tiny-button,
#formSections [data-upload-button] {
  min-height: 40px;
  height: 40px;
  padding: 0 14px;
  gap: 8px;
  border: 1px solid rgba(93, 106, 122, 0.28);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(230, 237, 245, 0.62) 100%);
  color: #223243;
  font-size: 15px;
  font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 10px 20px rgba(31, 39, 51, 0.08);
}

#formSections .section-card__top .tiny-button:hover,
#formSections [data-upload-button]:hover {
  border-color: var(--primary);
  color: var(--primary);
}

#formSections .section-card__top .tiny-button:focus-visible,
#formSections [data-upload-button]:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: none;
}

/* ============================================
   Шапка объекта: как .page-head на главной
   ============================================ */

.page-shell--form .obj-head {
  align-items: center;
  gap: 16px;
}

.page-shell--form .obj-head__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  min-width: 0;
}

.page-shell--form .obj-head h1 {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--text);
}

.page-shell--form .obj-head .data-freshness {
  min-width: 0;
}

.page-shell--form .obj-delete {
  color: var(--danger);
  border-color: rgba(199, 68, 49, 0.28);
}

.page-shell--form .obj-delete:hover {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(199, 68, 49, 0.4);
}

.page-shell--form .obj-delete:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: none;
}

/* ============================================
   Форма без «карточки в карточке»: .form-card прозрачный
   ============================================ */

.page-shell--form .form-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  overflow: visible;
}

.page-shell--form .form-card::before {
  content: none;
}

.page-shell--form .form-sections {
  gap: 20px;
}

/* ============================================
   Поля карточки: как поля тулбара фильтров на главной
   ============================================ */

#formSections .field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  min-width: 0;
}

#formSections .field > span {
  grid-column: 1 / -1;
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#formSections .field > input,
#formSections .field > select,
#formSections .field > .combo-field .combo-field__input {
  min-width: 0;
  width: 100%;
  height: 44px;
  min-height: 44px;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 16px;
  padding: 0 14px;
  box-shadow: none;
}

#formSections .field > textarea {
  width: 100%;
  min-width: 0;
  min-height: 120px;
  box-sizing: border-box;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-strong);
  color: var(--text);
  font-size: 16px;
  padding: 12px 14px;
  box-shadow: none;
}

#formSections .field > input:focus,
#formSections .field > select:focus,
#formSections .field > textarea:focus,
#formSections .field > .combo-field .combo-field__input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(20, 90, 214, 0.2);
}

#formSections .field > input:focus-visible,
#formSections .field > select:focus-visible,
#formSections .field > textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

#formSections .field > input::placeholder,
#formSections .field > textarea::placeholder {
  color: var(--text-muted);
}

#formSections .field > .combo-field {
  min-width: 0;
  width: 100%;
}

#formSections .field:has(> textarea) > .copy-btn {
  align-self: start;
}

#formSections .field > .combo-field .combo-field__input {
  padding-right: 3.2rem;
}

/* ============================================
   Ячейки таблиц-редакторов
   ============================================ */

#formSections .table-cell:not(.table-cell--action) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 8px;
  align-items: center;
  min-width: 0;
}

#formSections .table-cell:not(.table-cell--action) > input,
#formSections .table-cell:not(.table-cell--action) > select,
#formSections .table-cell:not(.table-cell--action) > textarea,
#formSections .table-cell:not(.table-cell--action) > .combo-field,
#formSections .table-cell:not(.table-cell--action) > .readonly-chip {
  min-width: 0;
  width: 100%;
}

#formSections .table-cell:not(.table-cell--action) > .copy-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
}

#formSections .table-cell::before {
  grid-column: 1 / -1;
}

/* ============================================
   Кнопка копирования
   ============================================ */

#formSections .copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  padding: 0;
  flex: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--text-soft);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

#formSections .copy-btn svg {
  display: block;
  width: 18px;
  height: 18px;
}

#formSections .copy-btn .icon-check {
  display: none;
}

#formSections .copy-btn:hover {
  background: var(--primary-soft);
  color: var(--primary);
}

#formSections .copy-btn:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

#formSections .copy-btn.is-copied {
  color: var(--success);
  border-color: var(--success);
}

#formSections .copy-btn.is-copied .icon-copy {
  display: none;
}

#formSections .copy-btn.is-copied .icon-check {
  display: block;
}

/* Копирование в тёмных строках */
#formSections .table-row .copy-btn {
  color: rgba(244, 247, 251, 0.7);
  background: transparent;
  border-color: transparent;
}

#formSections .table-row .copy-btn:hover {
  color: var(--text-inverse);
  background: rgba(255, 255, 255, 0.1);
  border-color: transparent;
}

@media (hover: hover) {
  #formSections .table-row .copy-btn {
    opacity: 0.8;
  }

  #formSections .table-row:hover .copy-btn,
  #formSections .table-row:focus-within .copy-btn,
  #formSections .copy-btn:focus-visible,
  #formSections .copy-btn.is-copied {
    opacity: 1;
  }
}

/* Сенсорные экраны: зона нажатия кнопки копирования не меньше 44×44px.
   Для ячеек таблиц видимый размер остаётся прежним, зона расширяется через ::after. */
@media (pointer: coarse) {
  #formSections .copy-btn {
    position: relative;
    min-width: 44px;
    min-height: 44px;
  }

  #formSections .copy-btn::after {
    content: "";
    position: absolute;
    inset: -8px;
  }
}

/* ============================================
   Тост «Скопировано»
   ============================================ */

.copy-toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  z-index: 200;
  transform: translate(-50%, 12px);
  opacity: 0;
  max-width: calc(100vw - 32px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--surface-dark-strong);
  color: var(--text-inverse);
  font-size: 14px;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: var(--glass-shadow-md);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.copy-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ============================================
   Десктоп (>1100px): кнопка копирования внутри поля, справа
   ============================================ */

@media (min-width: 1101px) {
  #formSections .table-cell:not(.table-cell--action) {
    display: block;
    position: relative;
  }

  #formSections .table-cell:not(.table-cell--action) > input,
  #formSections .table-cell:not(.table-cell--action) > textarea,
  #formSections .table-cell:not(.table-cell--action) > .readonly-chip {
    padding-right: 36px;
  }

  /* Стрелка select и комбо-поля справа: текст не лезет под кнопку копирования */
  #formSections .table-cell.has-arrow > select {
    padding-right: 68px;
  }

  #formSections .table-cell.has-arrow > .combo-field .combo-field__input {
    padding-right: 84px;
  }

  #formSections .table-cell:not(.table-cell--action) > .copy-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-color: transparent;
    background: transparent;
    opacity: 0.8;
  }

  /* Левее стрелки select / комбо-поля */
  #formSections .table-cell.has-arrow > .copy-btn {
    right: 44px;
  }

  #formSections .table-row:hover .table-cell > .copy-btn,
  #formSections .table-row:focus-within .table-cell > .copy-btn,
  #formSections .table-cell > .copy-btn:focus-visible,
  #formSections .table-cell > .copy-btn.is-copied {
    opacity: 1;
  }
}

/* ============================================
   Адаптивность: таблицы-редакторы
   ≤1100px: каждая строка — тёмная карточка, как на главной
   ============================================ */

@media (max-width: 1100px) {
  #formSections .inventory-table,
  #formSections .list-table {
    padding: 10px;
  }

  #formSections .inventory-table .table-head,
  #formSections .list-table .table-head {
    display: none;
  }

  #formSections .inventory-table .table-row,
  #formSections .list-table .table-row {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px 16px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.05);
  }

  #formSections .inventory-table .table-row + .table-row,
  #formSections .list-table .table-row + .table-row {
    margin-top: 10px;
  }

  #formSections .table-cell::before {
    content: attr(data-label);
    display: block;
    color: rgba(244, 247, 251, 0.78);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  #formSections .table-cell--action::before {
    content: none;
  }

  #formSections .table-cell--action {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
  }

  #formSections .table-cell:not(.table-cell--action) > .copy-btn {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.06);
  }
}

@media (max-width: 600px) {
  #formSections .inventory-table .table-row,
  #formSections .list-table .table-row {
    grid-template-columns: minmax(0, 1fr);
  }

  #formSections .table-cell .inline-input,
  #formSections .table-cell .inline-textarea,
  #formSections .table-cell .combo-field__input,
  #formSections .table-cell select.inline-input {
    min-height: 44px;
  }

  #formSections .field > input {
    min-height: 46px;
  }

  /* Адрес объекта (textarea): на узком экране переносится, высота под две строки */
  #formSections #general-address {
    height: auto;
    min-height: 68px;
    padding-top: 12px;
    padding-bottom: 12px;
    line-height: 22px;
  }
}

/* ============================================
   Адаптивность: десктоп (>1100px)
   ============================================ */

@media (min-width: 1101px) {
  .page-shell--form .list-table .table-row,
  .page-shell--form .inventory-table .table-row {
    min-width: 0;
    grid-template-columns: repeat(var(--columns, 4), minmax(0, 1fr));
  }

  .page-shell--form .list-table .table-cell,
  .page-shell--form .inventory-table .table-cell {
    min-width: 0;
  }
}

/* ============================================
   Панель действий: на всех ширинах фиксирована внизу окна,
   содержимое выровнено по ширине .page-shell
   ============================================ */

.page-shell--form {
  --qa-h: 76px;
  padding-bottom: calc(var(--qa-h) + 16px + env(safe-area-inset-bottom, 0px));
}

.page-shell--form .form-quick-actions {
  position: fixed;
  top: auto;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  height: calc(var(--qa-h) + env(safe-area-inset-bottom, 0px));
  padding-top: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: max(12px, calc((100% - min(1460px, 100% - clamp(22px, 3vw, 52px))) / 2));
  padding-right: max(12px, calc((100% - min(1460px, 100% - clamp(22px, 3vw, 52px))) / 2));
  border: 0;
  border-top: 1px solid var(--glass-border);
  border-radius: 0;
  background: var(--surface-dark-strong);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  box-shadow: none;
}

.page-shell--form .form-quick-actions .button {
  min-height: 44px;
  height: 44px;
}

.page-shell--form .form-quick-actions .button--ghost {
  color: var(--text-inverse);
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.08);
}

/* ============================================
   Сетка полей, боковая навигация
   ============================================ */

.page-shell--form .grid-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.page-shell--form .form-layout > * {
  min-width: 0;
}

.page-shell--form .section-card {
  max-width: 100%;
  min-width: 0;
}

/* Боковая навигация на десктопе: карточка как тулбар фильтров на главной */
.page-shell--form .form-sidebar .sidebar-card {
  padding: 12px;
  overflow: hidden;
}

.page-shell--form .form-sidebar .section-tag {
  margin: 0 0 12px;
  padding: 0 4px;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
}

.page-shell--form .sidebar-nav {
  gap: 4px;
}

.page-shell--form .sidebar-nav a {
  display: flex;
  align-items: center;
  height: 40px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-soft);
  font-size: 14px;
  font-weight: 600;
  box-shadow: none;
  transform: none;
}

.page-shell--form .sidebar-nav a:hover {
  background: rgba(23, 33, 45, 0.06);
  color: var(--text);
  transform: none;
}

.page-shell--form .sidebar-nav a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  box-shadow: none;
}

@media (min-width: 901px) {
  .page-shell--form .form-sidebar {
    position: sticky;
    top: 76px;
    align-self: start;
  }
}

@media (max-width: 1100px) {
  .page-shell--form .stats-charts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .page-shell--form .obj-head h1 {
    font-size: 22px;
  }

  .page-shell--form .grid-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Навигация по секциям: горизонтальная строка чипов под шапкой */
  .page-shell--form .form-sidebar {
    position: sticky;
    top: 56px;
    z-index: 30;
    background: rgba(215, 221, 229, 0.72);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }

  .page-shell--form .form-sidebar::-webkit-scrollbar {
    display: none;
  }

  .page-shell--form .form-sidebar .sidebar-card {
    padding: 8px 12px;
    border: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
  }

  .page-shell--form .form-sidebar .sidebar-card .section-tag {
    display: none;
  }

  .page-shell--form .sidebar-nav {
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .page-shell--form .sidebar-nav::-webkit-scrollbar {
    display: none;
  }

  .page-shell--form .sidebar-nav > li {
    flex: none;
    scroll-snap-align: start;
  }

  /* Чипы навигации: стиль кнопки «Обновить» на главной */
  .page-shell--form .sidebar-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    height: auto;
    padding: 0 14px;
    border: 1px solid rgba(93, 106, 122, 0.28);
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.78) 0%, rgba(230, 237, 245, 0.62) 100%);
    color: #223243;
    font-size: 15px;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.76), 0 10px 20px rgba(31, 39, 51, 0.08);
  }

  /* Панель действий на ≤900: только иконки, основная кнопка растягивается */
  .page-shell--form .form-quick-actions .button--ghost {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
    color: var(--text-inverse);
  }

  .page-shell--form .form-quick-actions .button__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }

  .page-shell--form .form-quick-actions .button--primary {
    flex: 1 1 auto;
    min-width: 0;
  }

  .page-shell--form .form-quick-actions .button--primary .button__label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
  }
}

@media (max-width: 600px) {
  .page-shell--form .stats-charts {
    grid-template-columns: minmax(0, 1fr);
  }

  .page-shell--form .obj-delete {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    justify-content: center;
  }

  .page-shell--form .obj-delete .button__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
}

/* ============================================
   Статистика очереди: тёмная таблица месяцев, светлая зона загрузки
   ============================================ */

.page-shell--form .stats-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin-bottom: 18px;
  border: 1px solid rgba(166, 184, 204, 0.18);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-dark-strong) 0%, var(--surface-dark) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 34px rgba(15, 20, 28, 0.18);
}

#formSections .stats-table {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
}

#formSections .stats-table th,
#formSections .stats-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(244, 247, 251, 0.9);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 14px;
}

#formSections .stats-table th {
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 247, 251, 0.6);
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#formSections .stats-table .muted,
#formSections .stats-empty {
  color: rgba(244, 247, 251, 0.7);
}

#formSections .stats-table tbody tr:last-child td {
  border-bottom: 0;
}

#formSections .stats-charts {
  gap: 16px;
}

#formSections .chart-card {
  padding: 16px 16px 12px;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(246, 250, 253, 0.72) 0%, rgba(229, 236, 244, 0.52) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6), var(--glass-shadow-sm);
}

#formSections .chart-card h4 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

#formSections .dump-upload .drop-zone {
  padding: 22px 20px;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.4);
  color: var(--text-soft);
}

#formSections .drop-zone.is-dragging {
  border-color: var(--primary);
  background: var(--primary-soft);
}

#formSections .dumps-panel {
  border-top-color: var(--line);
}

#formSections .dumps-panel h4 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

#formSections .dumps-list {
  gap: 0;
  margin-bottom: 0;
  overflow: hidden;
  border: 1px solid rgba(166, 184, 204, 0.18);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-dark-strong) 0%, var(--surface-dark) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 18px 34px rgba(15, 20, 28, 0.18);
}

#formSections .dump-row {
  padding: 14px 18px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text-inverse);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

#formSections .dumps-list > .dump-row:first-child {
  border-top: 0;
}

#formSections .dump-row:hover {
  background: rgba(255, 255, 255, 0.06);
}

#formSections .dump-row__name {
  color: rgba(244, 247, 251, 0.9);
}

#formSections .dumps-list .muted {
  color: rgba(244, 247, 251, 0.7);
}

#formSections .dumps-list > p.muted {
  margin: 0;
  padding: 16px 18px;
}

/* ============================================
   Движение
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  #formSections .copy-btn,
  #formSections .table-row,
  .copy-toast {
    transition: none;
  }
}
