/* К-247 — возвраты, отказ от товара и претензии (поток RET-F, public/app/returns-ui.js). Современный вид и классическое
   семейство (classic, folder, minimal, crm). Всё кликабельное — не меньше 44 × 44 px, промежутки 8 px; без инлайн-стилей,
   без цветных полос слева у карточек (просрочка — рамка целиком); подписи без висячих слов (text-wrap: balance). */

/* блок в раскрытом заказе */
.rt-block {
  display: grid; gap: 8px; margin: 8px 0 12px; padding: 12px; min-width: 0;
  border-radius: 8px; background: var(--surface, #fff); box-shadow: inset 0 0 0 1px var(--line-strong, rgba(35, 34, 31, 0.28));
  text-align: left; white-space: normal;
}
/* раскрытый заказ в широкой таблице: блок прилипает к левому краю прокрутки и не шире видимой области (как .lg-sellers, 400 px) */
.kwrap:has(td .rt-block), .tablewrap:has(td .rt-block) { container-type: inline-size; }
td .rt-block { position: sticky; left: 0; width: min(960px, calc(100cqi - 40px)); max-width: calc(100vw - 40px); box-sizing: border-box; }
.rt-block__h { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; text-wrap: balance; }
.rt-row { margin: 0; line-height: 1.45; max-width: 90ch; text-wrap: pretty; overflow-wrap: anywhere; }
.rt-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.rt-acts--links { gap: 8px 16px; }
.rt-btn { min-height: 44px; min-width: 44px; max-width: 100%; text-wrap: balance; white-space: normal; line-height: 1.2; }
.btn.rt-btn { height: auto; padding-top: 6px; padding-bottom: 6px; text-align: center; }
.kbtn.rt-btn { display: inline-flex; align-items: center; justify-content: center; text-align: center; padding: 6px 12px; }
.rt-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 2px; max-width: 100%;
  color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; overflow-wrap: anywhere; text-wrap: balance;
}
.rt-link:hover { text-decoration-thickness: 2px; }
.rt-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.rt-link--classic { font-size: 13px; }
.rt-left { display: block; margin-top: 4px; white-space: nowrap; }

/* карточки заявок */
.rt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; min-width: 0; }
.rt-card {
  display: grid; gap: 8px; padding: 10px 12px; min-width: 0; border-radius: 8px;
  background: var(--surface, #fff); box-shadow: inset 0 0 0 1px var(--line-strong, rgba(35, 34, 31, 0.28));
}
.rt-card--late { box-shadow: inset 0 0 0 2px #B3261E; }
.rt-card__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.rt-card__t { margin: 0; font-size: 14px; font-weight: 600; line-height: 1.3; text-wrap: balance; min-width: 0; overflow-wrap: anywhere; }
.rt-card__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.rt-card__line { margin: 0; line-height: 1.4; overflow-wrap: anywhere; }
.rt-chip { white-space: normal; text-wrap: balance; }
.chip.rt-chip--late, .kstat.rt-chip--late { background: #FBE0DD; color: #8A1C1C; }
.rt-meta { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 0; font-size: 13px; line-height: 1.4; min-width: 0; }
.rt-meta > div { display: flex; flex-wrap: wrap; gap: 4px; min-width: 0; }
.rt-meta dt { opacity: 0.62; }
.rt-meta dd { margin: 0; overflow-wrap: anywhere; }
.rt-quote { margin: 0; line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere; }
.rt-answer {
  margin: 0; padding: 8px 10px; border-radius: 6px; background: rgba(35, 34, 31, 0.05);
  line-height: 1.45; white-space: pre-line; overflow-wrap: anywhere;
}

/* раздел «Возвраты» */
.rt-queue { min-width: 0; }
.rt-qhead { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-bottom: 8px; }
.rt-qf { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; max-width: 100%; }
.rt-qf select { min-height: 44px; max-width: 100%; }
.rt-qsum { margin-bottom: 8px; }
.rt-empty { margin: 8px 0 0; }

/* окна */
.rt-dlg { display: grid; gap: 12px; min-width: 0; }
.rt-dlg__item { margin: 0; line-height: 1.4; overflow-wrap: anywhere; }
.rt-terms { margin: 0; line-height: 1.45; text-wrap: pretty; overflow-wrap: anywhere; }
.rt-warn { color: #8A1C1C; }
.rt-note { display: block; margin: 0; font-size: 12px; line-height: 1.4; opacity: 0.72; text-wrap: pretty; }
/* подсказка «Расходы на демонтаж… не возмещаются» в окне претензии показана только при требовании «возместить расходы» */
.rt-note[hidden] { display: none; }
.rt-f { display: grid; gap: 4px; min-width: 0; }
.rt-f__l { margin: 0; padding: 0; font-size: 13px; font-weight: 500; line-height: 1.3; }
.rt-f :is(input, select, textarea) { width: 100%; max-width: 100%; box-sizing: border-box; min-height: 44px; font: inherit; }
.rt-f textarea { resize: vertical; }
.rt-group { display: grid; gap: 4px; min-width: 0; margin: 0; padding: 0; border: 0; }
.rt-opts { display: grid; gap: 8px; min-width: 0; }
.rt-opt { display: flex; align-items: center; gap: 8px; min-height: 44px; cursor: pointer; line-height: 1.3; }
.modal .modal__body .rt-opt :is(input[type="radio"], input[type="checkbox"]) {
  width: 18px; height: 18px; min-width: 18px; min-height: 18px; margin: 0; flex: 0 0 auto;
}
.rt-opt.is-off { opacity: 0.55; cursor: not-allowed; }
.rt-opt__n { display: block; font-size: 12px; opacity: 0.72; }
.rt-sub { display: grid; gap: 8px; min-width: 0; }
.rt-sub[hidden] { display: none; }
.rt-err { margin: 0; color: #8A1C1C; font-weight: 500; line-height: 1.4; }
.rt-err:empty { display: none; }
.rt-files { display: grid; gap: 8px; min-width: 0; }
.rt-files__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.rt-files__list:empty { display: none; }
.rt-file { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.rt-file__n { min-width: 0; overflow-wrap: anywhere; }
.rt-attach { position: relative; justify-self: start; cursor: pointer; }
.rt-attach:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }
.modal .modal__body .rt-attach .rt-attach__in {
  position: absolute; inset: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; margin: 0; padding: 0; opacity: 0; cursor: pointer; z-index: 3;
}

@media (max-width: 600px) {
  .rt-block { padding: 10px; }
  .rt-acts > .rt-btn { flex: 1 1 100%; }
  .rt-card__chips { width: 100%; }
}
