/* KM Status — правила отдельных страниц. */

/* Коды → Товары */
table.products td.num a { font-weight: 700; text-decoration: none; }
table.products td.num a:hover { text-decoration: underline; }
table.products td.lead a { color: inherit; text-decoration: none; }
table.products td.lead a:hover { color: var(--accent); }
table.products .sub { display: block; color: var(--fg-muted); font-size: var(--fs-xs); font-weight: 400; }
table.products .burn { display: block; color: var(--bad); font-size: var(--fs-xs); font-weight: 600; }
table.products .burn.far { color: var(--fg-muted); font-weight: 400; }
table.products td.row-actions { min-width: 200px; white-space: normal; }
table.products td.row-actions form { display: block; margin: 0 0 var(--sp-1); }
table.products td.row-actions .button, table.products td.row-actions button { width: 100%; }
table.products .full-count { display: block; margin-top: 2px; font-size: var(--fs-xs); }

/* Коды → Все коды */
table.reg td { vertical-align: middle; }
table.reg td.code .tag { margin-left: 4px; vertical-align: 1px; }
table.reg .status-ext { display: block; color: var(--fg-muted); font-size: var(--fs-xs); }
.reg-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-3); color: var(--fg-muted); font-size: var(--fs-sm); }
#reg-progress { display: flex; align-items: center; gap: var(--sp-3); margin: 0 0 var(--sp-4); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--info-line); border-radius: var(--r-md); background: var(--info-soft); color: var(--info); font-size: var(--fs-sm); font-weight: 600; }
#reg-progress::before { content: ""; width: 18px; height: 18px; flex: 0 0 auto; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: km-spin .8s linear infinite; }

/* Карточка кода */
.code-title { font-family: var(--mono); font-size: var(--fs-sm); overflow-wrap: anywhere; }
.code-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }

/* Декларации */
.decl-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); }
.decl-head .num-dt { font-family: var(--mono); font-size: var(--fs-lg); font-weight: 700; }
.decl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.decl-actions form { margin: 0; }
.buckets { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-4); }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--sp-2) var(--sp-4); }
.fields label { margin-top: var(--sp-2); }
table.decl-lines select, table.decl-lines input { width: 100%; min-height: 40px; }

/* Проверка файла: таблица результатов */
table.items td { font-size: var(--fs-xs); }
table.items td.code { max-width: 24ch; }
table.items td .lines { color: var(--fg-muted); }
table.items details.more > summary { white-space: nowrap; }

/* Документы и заказы */
.export .options { margin-top: 0; }

/* Настройки */
a.tile .tile-state { font-size: var(--fs-sm); font-weight: 600; }

@media (max-width: 767px) {
  .decl-head { flex-direction: column; }
  .decl-actions { width: 100%; }
  .decl-actions > *, .decl-actions form, .decl-actions button { width: 100%; }
  table.items td.code { max-width: none; }
}
