/* «Данные рейтинга» (src/ratingdata.js, 29.09.2026): окно поверх
   «Сотрудников» — таблицы задач отделов, месяцы цикла, смены ведущих.
   Широкое: образец таблицы в разметке столбцов читают по строкам, и в
   узком окне он превращался в лапшу. */
.rt-card {
  width: min(1040px, 96vw); max-height: 90vh;
  display: flex; flex-direction: column;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow-float);
  overflow: hidden;
}
.rt-head {
  display: flex; align-items: baseline; gap: 9px;
  padding: 14.5px 18px 10px;
}
.rt-head h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.rt-head .grow, .rt-bar .grow { flex: 1; }
.rt-x {
  align-self: center; width: 29px; height: 29px; padding: 0;
  border: 0; border-radius: 8px; background: none; cursor: pointer;
  color: var(--ink3); font-size: 19px; line-height: 1;
}
.rt-x:hover { background: var(--box-bg-h); color: var(--ink); }

.rt-tabs {
  display: flex; gap: 2px; padding: 0 18px;
  border-bottom: 1px solid var(--line2);
  overflow-x: auto;
}
.rt-tabs button {
  flex: none; height: 33px; padding: 0 11px;
  border: 0; border-bottom: 2px solid transparent; background: none; cursor: pointer;
  color: var(--ink2); font: 500 11.5px var(--sans);
}
.rt-tabs button:hover { color: var(--ink); }
.rt-tabs button.on { color: var(--brand-deep); border-bottom-color: var(--brand); }
.rt-tabs button i { font-style: normal; font-size: 10px; color: var(--ink3); margin-left: 3px; }

.rt-body { flex: 1; min-height: 0; overflow-y: auto; padding: 12.5px 18px 18px; }

.rt-sub { display: block; font-size: 10px; color: var(--ink3); line-height: 1.35; }
.rt-head .rt-sub, .rt-bar .rt-sub, .pf-modal-foot .rt-sub { display: inline; }
.rt-hint { font-size: 10.5px; line-height: 1.5; color: var(--ink3); }
.rt-pad { margin-bottom: 11px; }
.rt-empty { padding: 22px 0; color: var(--ink3); font-size: 11.5px; text-align: center; line-height: 1.5; }

.rt-bar {
  display: flex; align-items: center; gap: 11px; flex-wrap: wrap;
  margin-bottom: 11px;
}
.rt-bar .lnk { margin-left: -7px; }
.rt-bar select {
  height: 28px; padding: 0 8px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font: 400 11px var(--sans);
}
.rt-bar .rt-hint { flex: 1 1 320px; }
.rt-up { flex: none; gap: 6px; }
.rt-up svg {
  width: 13.5px; height: 13.5px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.rt-fname { font-size: 12px; }

.rt-scroll { overflow-x: auto; }
.rt-tbl { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.rt-tbl th {
  padding: 6px 9px; text-align: left; white-space: nowrap;
  font-size: 10px; font-weight: 500; color: var(--ink3);
  border-bottom: 1px solid var(--line);
}
.rt-tbl td { padding: 7px 9px; border-bottom: 1px solid var(--line2); vertical-align: top; }
.rt-tbl td b { font-weight: 600; }
.rt-tbl td.num, .rt-tbl .num { font-family: var(--mono); font-size: 11px; }
.rt-tbl td.num .rt-sub { font-family: var(--sans); }
.rt-tbl td.acts { white-space: nowrap; text-align: right; }
.rt-tbl td.acts .lnk { display: inline-block; }
.rt-tbl tr.rt-warn td {
  padding-top: 0; font-size: 10.5px; line-height: 1.45; color: var(--warn);
}
.rt-tbl tr:has(+ tr.rt-warn) td { border-bottom: 0; }
.rt-sub-td { font-size: 10.5px; color: var(--ink2); }

/* Оценка строки — тем же языком, что клетки матрицы. */
.rt-v {
  display: inline-block; padding: 1px 7px; border-radius: 999px;
  font-size: 10px; white-space: nowrap;
  background: var(--box-bg); color: var(--ink2);
}
.rt-v.ok { background: var(--ok-soft); color: var(--ok); }
.rt-v.late, .rt-v.wait { background: var(--warn-soft); color: var(--warn); }
.rt-v.over { background: var(--bad-soft); color: var(--bad); }

.rt-date {
  height: 27px; padding: 0 7px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--card); color: var(--ink); font: 400 11px var(--mono);
}
.rt-date.bad { border-color: var(--bad); }
.rt-date.saved { border-color: var(--ok); }

/* ── разметка столбцов ── */
.rt-wiz { display: flex; flex-direction: column; gap: 11px; }
.rt-wrow { display: flex; gap: 11px; flex-wrap: wrap; align-items: flex-end; }
.rt-wrow .fld { flex: 0 1 200px; }
.rt-wrow .rt-wname { flex: 1 1 300px; }
.rt-wrow .rt-whead { flex: 0 0 130px; }
.rt-mode { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--ink2); }
.rt-mode label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.rt-mode input { accent-color: var(--brand); }
.rt-map {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 9px 11px;
  padding: 11px; border-radius: 10px; background: var(--raise);
}
.rt-mapf label { font-weight: 500; }
.rt-mapf.req label { color: var(--ink); }
.rt-fh { display: block; margin-top: 3px; font-size: 9.5px; line-height: 1.35; color: var(--ink3); }
.rt-warn-line {
  padding: 7px 11px; border-radius: 9px; background: var(--warn-soft); color: var(--warn);
  font-size: 11px; line-height: 1.45;
}
.rt-sample-h { font-size: 10.5px; font-weight: 500; color: var(--ink2); }
.rt-sample { border: 1px solid var(--line2); border-radius: 10px; }
.rt-sample .rt-tbl { font-size: 10.5px; }
.rt-sample .rt-tbl td, .rt-sample .rt-tbl th {
  max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.rt-sample .rt-tbl tr:last-child td { border-bottom: 0; }
.rt-sample .rt-tbl td.on { background: color-mix(in srgb, var(--brand) 6%, transparent); }
.rt-sample .rt-tbl th.on { background: var(--brand-tint); color: var(--ink); }
.rt-chip {
  display: block; width: max-content; margin-bottom: 3px; padding: 0 6px;
  border-radius: 999px; background: var(--brand); color: var(--on-brand);
  font-size: 9px; font-weight: 600; line-height: 15px;
}
.rt-wiz .pf-modal-foot { align-items: center; margin-top: 3px; }

.rt-done { display: flex; flex-direction: column; gap: 9px; }
.rt-done-big { font-size: 17px; font-weight: 600; letter-spacing: -.015em; }
.rt-done ul { margin: 0; padding-left: 18px; font-size: 11.5px; line-height: 1.6; color: var(--ink2); }
.rt-done .rt-bad { color: var(--warn); }

/* Кнопка «Данные» в шапке «Мастеров» — рядом с выбором вида. */
.rt-open {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  height: 31px; padding: 0 10px;
  border: 1px solid var(--line2); border-radius: 10px; background: var(--raise);
  color: var(--ink2); font: 500 11px var(--sans); cursor: pointer;
}
.rt-open[hidden] { display: none; }
.rt-open:hover { color: var(--ink); background: var(--card); }
.rt-open svg {
  width: 14.5px; height: 14.5px; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

@media (max-width: 684px) {
  .rt-modal { padding: 0; }
  .rt-card { width: 100vw; max-height: none; height: 100%; border-radius: 0; }
  .rt-head { padding: 12.5px 12.5px 8px; }
  .rt-head .rt-sub { display: none; }
  .rt-tabs { padding: 0 8px; }
  .rt-body { padding: 11px 12.5px 16px; }
  .rt-open span { display: none; }
  .rt-open { width: 31px; padding: 0; justify-content: center; }
  .rt-wrow .fld, .rt-wrow .rt-wname, .rt-wrow .rt-whead { flex: 1 1 100%; }
  /* Наборы на телефоне — карточками: пять колонок в 350 пикселей
     превращали название в столбик по слову, а «Убрать» уезжало за край. */
  .rt-sets thead { display: none; }
  .rt-sets, .rt-sets tbody { display: block; }
  .rt-sets tr { display: flex; flex-wrap: wrap; gap: 3px 14px; padding: 10px 0;
    border-bottom: 1px solid var(--line2); }
  .rt-sets td { display: block; padding: 0; border: 0; }
  .rt-sets td:first-child, .rt-sets td.acts { flex: 1 1 100%; }
  .rt-sets td.acts { text-align: left; margin-left: -7px; }
  .rt-sets tr.rt-warn { padding-top: 0; }
  .rt-sets tr:has(+ tr.rt-warn) { border-bottom: 0; }
}

/* Вид таблицы: свод по сотрудникам (отчёт «Эффективность», его админ
   заказчика грузит раз в две недели) или список задач. Две карточки, а
   не выпадающий список: от выбора зависит вся разметка ниже. */
.rt-kind { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.rt-kind label {
  position: relative; display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px 10px 33px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); cursor: pointer;
}
.rt-kind label.on { border-color: var(--brand); background: var(--brand-tint); }
.rt-kind input { position: absolute; left: 12px; top: 12px; margin: 0; accent-color: var(--brand); }
.rt-kind b { font-size: 12px; font-weight: 600; color: var(--ink); }
.rt-kind span { font-size: 10.5px; line-height: 1.4; color: var(--ink3); }
.rt-wrow .rt-wmon { flex: 0 0 170px; }
@media (max-width: 684px) {
  .rt-kind { grid-template-columns: 1fr; }
  .rt-wrow .rt-wmon { flex: 1 1 100%; }
}
