/* «Уточнёнки 091» (refile.js; ТЗ Жоогазын 26.10.2026): страница проекта — шапка со сроками, график, воронка статусов, KPI и флаги,
   таблица клиентов с действиями пачкой; «Настройки → Уточнёнки 091»; этапы проекта в «Календаре» (calendar.js, тип project);
   периоды ставок в «Настройки → Ставки» (app.js → renderRatesEditor). Карточки и свёртка — общие с «Аудитом» (adt-card, adt-fold).
   Префиксы: rfp- (страница), rfs- (настройки), rate-hist / rate-per (периоды ставок). */

/* ═══ Страница ═══ */
/* ширина страницы — от меню: на 1366 со свёрнутым меню ~1250 px, с открытым ~1090 px; плитки KPI и график подстраиваются (@container rfp) */
.rfp-page { display: flex; flex-direction: column; gap: 12px; min-width: 0; container-type: inline-size; container-name: rfp; }
.rfp-page.is-loading .adt-card, .rfp-page.is-loading .rfp-kpis { opacity: .62; transition: opacity .15s; }
.rfp-head { margin-bottom: 2px; gap: 10px 12px; }
.rfp-head .page-title { flex: 1 1 300px; min-width: 0; }
.rfp-head > .btn { flex: 0 0 auto; }
.rfp-facts { display: flex; gap: 8px; flex-wrap: wrap; }
.rfp-fact { display: inline-flex; flex-direction: column; gap: 1px; min-width: 116px; padding: 6px 12px 7px; border-radius: 12px; background: var(--panel); border: 1px solid var(--border);
    box-shadow: var(--shadow-1); cursor: default; }
.rfp-fact i { font-style: normal; font-size: 10.5px; font-weight: 750; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
.rfp-fact b { font-size: 14px; font-weight: 800; color: var(--text); white-space: nowrap; letter-spacing: -.1px; }
.rfp-fact small { font-size: 11px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.rfp-fact.warn { border-color: #f6d9a6; background: #fffaf0; }
.rfp-fact.warn small { color: var(--warn-deep); }
.rfp-fact.bad { border-color: #f5c9c9; background: #fff7f7; }
.rfp-fact.bad small { color: var(--err-deep); }
.rfp-sync:empty { display: none; }
.rfp-sync > span { display: inline-flex; align-items: center; gap: 6px; }
.rfp-sync-err { color: var(--err-deep); }
.rfp-card .adt-card-h .btn { flex: 0 0 auto; }

/* общая полоска прогресса */
.rfp-bar { display: block; height: 5px; border-radius: 5px; background: #edf0f5; overflow: hidden; }
.rfp-bar i { display: block; height: 100%; border-radius: 5px; background: var(--accent); }
.rfp-bar.sm { height: 4px; }
.rfp-bar.ok i { background: var(--ok); }

/* ═══ График проекта ═══ */
.rfp-stages { display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0, 1fr)); }
.rfp-st { position: relative; display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 11px 12px 12px; border-left: 1px solid var(--border-soft); background: #fff; cursor: default; }
.rfp-st:first-child { border-left: none; }
/* этапов больше восьми — вторая строка полосы */
.rfp-stages.wrap .rfp-st:nth-child(8n + 1) { border-left: none; }
.rfp-stages.wrap .rfp-st:nth-child(n + 9) { border-top: 1px solid var(--border-soft); }
.rfp-st-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.rfp-st-n { flex: 0 0 22px; width: 22px; height: 22px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: #eef1f6; color: var(--text-2);
    font-size: 11.5px; font-weight: 800; }
.rfp-st-d { min-width: 0; font-size: 12px; font-weight: 750; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.rfp-st-b { align-self: flex-start; max-width: 100%; padding: 1px 7px; border-radius: 6px; font-size: 10.5px; font-weight: 750; background: #f1f3f7; color: var(--muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfp-st-b.now { background: var(--accent); color: #fff; }
.rfp-st-b.due { background: var(--accent-soft); color: var(--accent-2); }
.rfp-st-b.warn { background: var(--warn-soft); color: var(--warn-deep); }
.rfp-st-b.ok { background: var(--ok-soft); color: var(--ok-deep); }
.rfp-st-b.bad { background: var(--err-soft); color: var(--err-deep); }
.rfp-st-t { font-size: 12.5px; font-weight: 650; color: var(--text); line-height: 1.34; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rfp-st-r { font-size: 11.5px; color: var(--muted); font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfp-st-r:empty { display: none; }
.rfp-st-p { margin-top: auto; padding-top: 3px; display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.rfp-st-p b { color: var(--text); font-weight: 800; }
.rfp-st-p.none { color: var(--faint); font-weight: 600; }
.rfp-st.now { background: linear-gradient(180deg, #edf2ff 0%, #fff 100%); box-shadow: inset 0 3px 0 var(--accent); }
.rfp-st.now .rfp-st-n { background: var(--accent); color: #fff; }
.rfp-st.due { background: linear-gradient(180deg, #f5f7ff 0%, #fff 70%); box-shadow: inset 0 3px 0 #b8c7fb; }
.rfp-st.due .rfp-st-n { background: var(--accent-soft); color: var(--accent-2); }
.rfp-st.past { background: #fafbfc; }
.rfp-st.past > * { opacity: .55; }
.rfp-st.all .rfp-st-n { background: var(--ok); color: #fff; }
.rfp-st.all .rfp-bar i, .rfp-st.past .rfp-bar i { background: var(--ok); }

/* ═══ Статусы клиентов: дошли / стоят ═══ */
.rfp-fun { display: grid; grid-template-columns: repeat(10, minmax(0, 1fr)); }
.rfp-fc { position: relative; display: flex; flex-direction: column; gap: 5px; min-width: 0; padding: 10px 12px 11px; border: none; border-left: 1px solid var(--border-soft); background: #fff;
    font: inherit; text-align: left; cursor: pointer; transition: background .12s, box-shadow .12s; }
.rfp-fc:first-child { border-left: none; }
.rfp-fc:hover { background: #f5f8ff; }
.rfp-fc.on { background: #eef3ff; box-shadow: inset 0 0 0 2px var(--accent); }
.rfp-fc-l { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 11.5px; font-weight: 750; color: var(--text-2); }
.rfp-fc-l > span { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfp-fc-l i { flex: 0 0 18px; height: 18px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 10.5px; font-weight: 800;
    color: #fff; background: var(--fc); }
.rfp-fc-n { display: flex; align-items: baseline; gap: 5px; line-height: 1.05; white-space: nowrap; }
.rfp-fc-n b { font-size: 20px; font-weight: 850; color: var(--text); letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.rfp-fc-n small { font-size: 11px; color: var(--muted); font-weight: 650; }
.rfp-fc.zero .rfp-fc-n b { color: #c3cad5; }
.rfp-fc-bar { display: block; height: 4px; border-radius: 4px; background: #edf0f5; overflow: hidden; }
.rfp-fc-bar i { display: block; height: 100%; border-radius: 4px; background: var(--fc); }
.rfp-fc-r { font-size: 11px; color: var(--muted); font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 0 — не начат, 1–8 — индиго всё насыщеннее, 9 — годовые зафиксированы */
.rfp-fc.s0 { --fc: #9aa5b8; } .rfp-fc.s1 { --fc: #93a8f8; } .rfp-fc.s2 { --fc: #8299f7; } .rfp-fc.s3 { --fc: #718bf6; } .rfp-fc.s4 { --fc: #5f7bf5; }
.rfp-fc.s5 { --fc: #4d6bf4; } .rfp-fc.s6 { --fc: #3b5bea; } .rfp-fc.s7 { --fc: #2f4cd2; } .rfp-fc.s8 { --fc: #263fb4; } .rfp-fc.s9 { --fc: var(--ok); }

/* ═══ KPI ═══ */
.rfp-kpis { display: grid; grid-template-columns: minmax(340px, 1.75fr) repeat(4, minmax(150px, 1fr)); gap: 12px; }
.rfp-kpi { display: flex; align-items: center; gap: 12px; min-width: 0; padding: 12px 14px; background: var(--panel); border: 1.5px solid var(--border); border-radius: 16px;
    box-shadow: var(--shadow-1); font: inherit; text-align: left; cursor: pointer; transition: border-color .14s, box-shadow .14s, transform .14s; }
.rfp-kpi:hover { border-color: #c6d2f5; transform: translateY(-1px); }
.rfp-kpi.on { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(59, 100, 244, .12); }
.rfp-kpi.is-skel, .rfp-kpi.is-skel:hover { cursor: default; transform: none; border-color: var(--border); }
.rfp-kpi-ico { flex: 0 0 38px; width: 38px; height: 38px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-2); }
.rfp-kpi-ico.k-filed { background: #e5f6f4; color: #0f766e; }
.rfp-kpi-ico.k-up { background: #fdecec; color: #b42318; }
.rfp-kpi-ico.k-down { background: var(--ok-soft); color: var(--ok-deep); }
.rfp-kpi-ico.k-ua { background: #fff1e0; color: #b45309; }
.rfp-kpi-b { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.rfp-kpi-l { font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfp-kpi-n { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; line-height: 1.15; min-width: 0; }
.rfp-kpi-n b { font-size: 20px; font-weight: 850; color: var(--text); letter-spacing: -.4px; font-variant-numeric: tabular-nums; }
.rfp-kpi-n em { font-style: normal; font-size: 12.5px; font-weight: 650; color: var(--muted); }
.rfp-kpi-s { display: flex; flex-direction: column; gap: 4px; min-width: 0; font-size: 11px; color: var(--muted); font-weight: 600; }
.rfp-kpi-s > span:not(.rfp-bar) { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfp-kpi-s .rfp-bar { margin-top: 2px; }
/* метод учёта: четыре состояния */
.ms-confirmed { --mc: var(--ok); } .ms-default { --mc: var(--accent); } .ms-requested { --mc: var(--warn); } .ms-none { --mc: #b8c0cc; }
.rfp-kpi-m4 { flex-direction: column; align-items: stretch; gap: 8px; cursor: default; padding: 10px 12px 12px; }
.rfp-kpi-m4:hover { transform: none; }
.rfp-kpi-m4:not(.on):hover { border-color: var(--border); }
.rfp-m4-h { display: flex; align-items: center; gap: 9px; font-size: 13px; font-weight: 800; color: var(--text); min-width: 0; }
.rfp-m4-h .rfp-kpi-ico { flex-basis: 28px; width: 28px; height: 28px; border-radius: 9px; }
.rfp-m4-h small { margin-left: auto; font-size: 11px; font-weight: 650; color: var(--muted); white-space: nowrap; }
.rfp-m4 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.rfp-ms { display: flex; align-items: baseline; gap: 7px; min-width: 0; padding: 5px 10px 5px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; font: inherit;
    text-align: left; cursor: pointer; transition: all .12s; box-shadow: inset 3px 0 0 var(--mc); }
.rfp-ms b { font-size: 16px; font-weight: 850; color: var(--text); font-variant-numeric: tabular-nums; line-height: 1.2; }
.rfp-ms span { min-width: 0; font-size: 11.5px; font-weight: 700; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfp-ms:hover { border-color: #c6d2f5; background: #fafbff; }
.rfp-ms.on { border-color: var(--mc); background: color-mix(in srgb, var(--mc) 9%, #fff); box-shadow: inset 3px 0 0 var(--mc), 0 0 0 2px color-mix(in srgb, var(--mc) 22%, transparent); }
.rfp-ms.zero b { color: #c3cad5; }
.rfp-mbar { display: flex; height: 5px; border-radius: 5px; overflow: hidden; background: #edf0f5; }
.rfp-mbar i { display: block; height: 100%; background: var(--mc); }
@container rfp (max-width: 1180px) {
    .rfp-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .rfp-kpi-m4 { grid-column: 1 / -1; }
    .rfp-m4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@container rfp (max-width: 900px) {
    .rfp-stages { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .rfp-stages .rfp-st:nth-child(4n + 1) { border-left: none; }
    .rfp-stages .rfp-st:nth-child(n + 5) { border-top: 1px solid var(--border-soft); }
    .rfp-fun { grid-template-columns: repeat(5, minmax(0, 1fr)); }
    .rfp-fun .rfp-fc:nth-child(n + 6) { border-top: 1px solid var(--border-soft); }
    .rfp-fun .rfp-fc:nth-child(5n + 1) { border-left: none; }
}

/* ═══ Красные флаги ═══ */
.rfp-flags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 0 2px; }
.rfp-flags:empty { display: none; }
.rfp-flags-l { display: inline-flex; align-items: center; gap: 6px; margin-right: 4px; font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); cursor: default; }
.rfp-flags-l svg { color: var(--err); }
.rfp-flags-l b { padding: 0 7px; border-radius: 999px; background: var(--err); color: #fff; font-size: 11px; letter-spacing: 0; }
.rfp-fchip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; border: 1px solid var(--border); background: #fff; font: inherit; font-size: 12.3px;
    font-weight: 650; color: var(--text-2); cursor: pointer; transition: all .12s; white-space: nowrap; }
.rfp-fchip b { font-weight: 800; font-variant-numeric: tabular-nums; }
.rfp-fchip.has { color: var(--err-deep); border-color: #f3c9c9; background: #fff8f8; }
.rfp-fchip.has svg { color: var(--err); }
.rfp-fchip.has:hover { border-color: #eaa6a6; }
.rfp-fchip.zero { color: var(--faint); background: #fafbfc; cursor: default; }
.rfp-fchip.zero b { font-weight: 700; }
.rfp-fchip.on { background: var(--err-soft); border-color: var(--err); box-shadow: 0 0 0 2px rgba(239, 68, 68, .15); }

/* ═══ Клиенты: фильтры и таблица ═══ */
.rfp-list .adt-card-h .btn { flex: 0 0 auto; }
.rfp-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 16px; border-bottom: 1px solid var(--border-soft); background: #fbfcfe; }
.rfp-filters:empty { display: none; }
.rfp-search input { width: 220px; height: 36px; padding-top: 6px; padding-bottom: 6px; }
.rfp-filters .csel-btn { min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 12.8px; }
.rfp-pseg button { padding: 7px 11px; font-size: 12.5px; }
.rfp-chk { display: inline-flex; align-items: center; gap: 7px; padding: 0 4px; font-size: 12.5px; font-weight: 650; color: var(--text-2); cursor: pointer; white-space: nowrap; }
.rfp-chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.rfp-actf { display: inline-flex; align-items: center; gap: 4px; height: 30px; padding: 0 4px 0 11px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-size: 12.3px;
    font-weight: 700; white-space: nowrap; }
.rfp-actf button { width: 22px; height: 22px; border: none; border-radius: 999px; background: none; color: inherit; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.rfp-actf button:hover { background: #d9e2ff; }
.rfp-reset-box:empty { display: none; }
.rfp-reset { color: var(--accent-2); }
.rfp-link { border: none; background: none; padding: 0; font: inherit; color: var(--accent-2); font-weight: 700; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(39, 73, 209, .3); }

.rfp-tscroll { overflow: auto; max-height: calc(100vh - 140px); min-height: 220px; overscroll-behavior: contain; }
.rfp-t { width: 100%; min-width: 1180px; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: 12.8px; }
/* клиент — остаток ширины: на ноутбуке 1366 ему остаётся ~270 px */
.rfp-t col.c-ck { width: 42px; } .rfp-t col.c-p { width: 48px; } .rfp-t col.c-cat { width: 100px; } .rfp-t col.c-m { width: 136px; } .rfp-t col.c-st { width: 240px; }
.rfp-t col.c-fl { width: 76px; } .rfp-t col.c-ua { width: 106px; } .rfp-t col.c-rf { width: 92px; } .rfp-t col.c-d { width: 146px; }
.rfp-t thead th { position: sticky; top: 0; z-index: 3; padding: 10px 10px; background: #f6f8fc; border-bottom: 1px solid var(--border); color: var(--muted); font-size: 10.8px; font-weight: 750;
    text-transform: uppercase; letter-spacing: .04em; text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfp-t thead th.num { text-align: right; }
.rfp-t td { padding: 9px 10px; border-bottom: 1px solid var(--border-soft); vertical-align: middle; background: #fff; min-width: 0; }
.rfp-t td.num { text-align: right; }
.rfp-t tbody tr { cursor: pointer; }
.rfp-t tbody tr:hover td { background: #f7f9ff; }
.rfp-t tbody tr.is-sel td { background: #eef3ff; }
.rfp-t tbody tr:last-child td { border-bottom: none; }
.rfp-t .rfp-ck { text-align: center; padding-left: 12px; padding-right: 4px; }
.rfp-ck input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; vertical-align: middle; }
.rfp-sortable { cursor: pointer; user-select: none; transition: color .12s; }
.rfp-sortable:hover { color: var(--text-2); }
.rfp-sort { display: inline-flex; margin-left: 4px; vertical-align: -2px; opacity: 0; transition: opacity .12s; }
.rfp-sortable:hover .rfp-sort { opacity: .45; }
.rfp-t thead th.rfp-sortable.on { color: var(--accent-2); }
.rfp-sortable.on .rfp-sort { opacity: 1; }
.rfp-sub { margin-top: 2px; font-size: 11.5px; color: var(--muted); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfp-name { display: block; font-size: 13.2px; font-weight: 750; color: var(--text); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfp-name:hover { color: var(--accent-2); }
/* приоритет очереди */
.rfp-pr { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: 7px; font-size: 11.5px; font-weight: 850; }
.rfp-pr.p1 { background: #fde3e3; color: #a61b1b; }
.rfp-pr.p2 { background: #ffeccc; color: #8a4d06; }
.rfp-pr.p3 { background: #e3ebff; color: #2546b8; }
.rfp-pr.p4 { background: #eef1f6; color: #5d6879; }
/* категория */
.rfp-cat { font-size: 12.8px; font-weight: 700; color: var(--text); white-space: nowrap; }
.rfp-cat.c-medium { color: #2546b8; }
.rfp-cat.c-large { color: #6d28d9; }
/* метод */
.rfp-m { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rfp-ml { flex: 0 0 26px; height: 26px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 850; color: var(--mc);
    background: color-mix(in srgb, var(--mc) 13%, #fff); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--mc) 32%, #fff); }
.rfp-ml.ms-none { color: #6b7686; background: #f1f3f7; box-shadow: inset 0 0 0 1px #dfe3ea; }
.rfp-ml.ms-requested { color: var(--warn-deep); }
.rfp-m-t { min-width: 0; }
.rfp-m-l { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.rfp-sug { display: inline-flex; color: #7c3aed; }
.rfp-over { padding: 0 5px; border-radius: 5px; background: #fff0d4; color: #8a4d06; font-size: 9.5px; font-weight: 800; }
.rfp-legal { padding: 1px 7px; border-radius: 6px; background: var(--ok-soft); color: var(--ok-deep); font-size: 11px; font-weight: 800; }
/* статус: цепочка 1–9 */
.rfp-stc { min-width: 0; }
.rfp-chain { display: flex; align-items: center; gap: 8px; min-width: 0; }
.rfp-dots { display: inline-flex; gap: 3px; flex: 0 0 auto; }
.rfp-dots i { width: 8px; height: 8px; border-radius: 50%; background: #e3e7ee; }
.rfp-dots i.on { background: var(--accent); }
.rfp-dots i.on.fin { background: var(--ok); }
.rfp-dots i.next { background: #fff; box-shadow: inset 0 0 0 1.5px var(--accent); }
.rfp-stc-l { min-width: 0; font-size: 12.3px; font-weight: 650; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfp-stc-l b { font-weight: 850; color: var(--accent-2); margin-right: 2px; }
.rfp-stc .rfp-sub { margin-top: 1px; font-size: 11.3px; }
.rfp-stc .rfp-next { color: var(--text-2); }
.rfp-stc .rfp-next.done { color: var(--ok-deep); }
/* флаги */
.rfp-fl { display: flex; flex-wrap: wrap; gap: 4px; }
.rfp-fi { width: 24px; height: 24px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: var(--err-soft); color: var(--err-deep); }
/* нераспределено, уточнённые, разница */
.rfp-ua { font-size: 13.5px; font-weight: 800; color: #b45309; }
.rfp-unit { margin-left: 4px; font-size: 11px; color: var(--muted); font-weight: 650; }
.rfp-rf b { font-size: 13.5px; font-weight: 800; }
.rfp-rf em { font-style: normal; color: var(--muted); font-weight: 650; }
.rfp-rf .rfp-bar { margin-top: 5px; width: 72px; }
.rfp-mis { margin-left: 6px; padding: 0 6px; border-radius: 6px; background: var(--err-soft); color: var(--err-deep); font-size: 10.5px; font-weight: 800; }
.rfp-d { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: baseline; column-gap: 6px; }
.rfp-dl { font-size: 10.8px; font-weight: 750; color: var(--muted); white-space: nowrap; }
.rfp-dl.up { color: #b42318; }
.rfp-dl.down { color: var(--ok-deep); }
.rfp-dv { font-size: 13.5px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rfp-dv.up { color: #b42318; }
.rfp-dv.down { color: var(--ok-deep); }
.rfp-pre { margin-top: 2px; font-size: 10.5px; color: var(--faint); font-weight: 600; line-height: 1.25; white-space: normal; }
@media (min-width: 1700px) {
    .rfp-t col.c-cat { width: 120px; } .rfp-t col.c-m { width: 160px; } .rfp-t col.c-st { width: 300px; } .rfp-t col.c-fl { width: 96px; }
    .rfp-t col.c-ua { width: 116px; } .rfp-t col.c-rf { width: 112px; } .rfp-t col.c-d { width: 222px; }
}

/* ═══ Выбор и действия пачкой ═══ */
.rfp-bulk { position: sticky; bottom: 14px; z-index: 30; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 9px 12px 9px 16px; border-radius: 14px;
    background: #101726; color: #e8ecf5; box-shadow: var(--shadow-2); animation: rise .2s ease-out; }
.rfp-bulk[hidden] { display: none; }
.rfp-bulk-n { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; font-size: 13px; font-weight: 650; }
.rfp-bulk-n svg { color: #7ea2ff; }
.rfp-bulk-n small { color: #9aa6bf; font-weight: 600; font-size: 12px; }
.rfp-bulk .btn { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .16); color: #eef2fb; }
.rfp-bulk .btn:hover { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .28); }
.rfp-bulk .btn svg { color: #9fb6ff; }
.rfp-bulk .rfp-bulk-x { background: transparent; color: #b6bfd1; }
.rfp-bulk .rfp-bulk-x svg { color: inherit; }

/* окно «Анкета и запрос метода» */
.rfp-rq { display: flex; flex-direction: column; gap: 12px; }
.rfp-rq-opts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 10px 16px; align-items: center; }
.rfp-rq-o { display: contents; }
.rfp-rq-o > span { font-size: 12px; font-weight: 700; color: var(--muted); }
.rfp-rq-o > b { font-size: 13.5px; font-weight: 750; }
.rfp-rq-o .seg { justify-self: start; }
.rfp-rq-o .seg button { padding: 7px 13px; }
.rfp-rq-o .rep-pick svg { color: var(--accent); }
.rfp-note { display: flex; gap: 9px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; background: #f3f6ff; color: #33437a; font-size: 12.5px; line-height: 1.5; }
.rfp-note svg { flex: 0 0 auto; color: var(--accent); margin-top: 1px; }
.rfp-rq-prev { display: flex; flex-direction: column; gap: 10px; min-height: 90px; }
.rfp-rq-load { display: flex; align-items: center; gap: 9px; padding: 14px 4px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.rfp-rq-empty { display: flex; align-items: center; gap: 8px; padding: 14px; border-radius: 12px; background: #f6f8fc; color: var(--muted); font-size: 12.8px; }
.rfp-rq-sum { display: flex; gap: 8px 18px; flex-wrap: wrap; font-size: 13px; font-weight: 650; }
.rfp-rq-sum span { display: inline-flex; align-items: center; gap: 6px; }
.rfp-rq-sum .ok { color: var(--ok-deep); }
.rfp-rq-sum .bad { color: var(--err-deep); }
.rfp-rq-sum em { font-style: normal; color: var(--muted); font-weight: 600; }
.rfp-rq-ex { border: 1px solid var(--border); border-radius: 13px; overflow: hidden; }
.rfp-rq-exh { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: #fafbfd; border-bottom: 1px solid var(--border-soft); font-size: 12px; font-weight: 700; color: var(--muted); }
.rfp-rq-exh > span { margin-right: auto; }
.rfp-rq-exh .csel-btn { min-height: 32px; padding-top: 4px; padding-bottom: 4px; font-size: 12.5px; }
.rfp-rq-skip { border: 1px solid #f5d0d0; border-radius: 12px; background: #fffafa; }
.rfp-rq-skip summary { list-style: none; display: flex; align-items: center; gap: 6px; padding: 9px 12px; font-size: 12.5px; font-weight: 700; color: var(--err-deep); cursor: pointer; }
.rfp-rq-skip summary::-webkit-details-marker { display: none; }
.rfp-rq-skip summary svg { transition: transform .15s; }
.rfp-rq-skip[open] summary svg { transform: rotate(180deg); }
.rfp-rq-skip .adt-res-list { padding: 0 12px 10px; max-height: 24vh; }
/* сообщение клиенту — пузырём WhatsApp (окно запроса и предпросмотр шаблона) */
.rfp-wa { display: flex; flex-direction: column; gap: 10px; padding: 14px; max-height: 44vh; overflow-y: auto; background: #efeae2; }
/* в окне запроса кнопка «Поставить в „Рассылку“» должна быть видна без прокрутки и на экране 768 px */
.rfp-rq-ex .rfp-wa { max-height: max(170px, calc(86vh - 440px)); }
.rfp-wa-m { align-self: flex-end; max-width: 94%; min-width: 0; }
.rfp-wa-k { display: flex; align-items: center; justify-content: flex-end; gap: 5px; margin-bottom: 3px; font-size: 10.5px; font-weight: 750; color: #6b6253; }
.rfp-wa-b { padding: 9px 11px; border-radius: 10px 2px 10px 10px; background: #d9fdd3; color: #111b21; font-size: 12.8px; line-height: 1.5; white-space: pre-wrap; word-break: break-word;
    box-shadow: 0 1px 1px rgba(11, 20, 26, .1); }

/* ═══ Настройки → «Уточнёнки 091» ═══ */
.rfs { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.rfs-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.rfs-col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 1180px) { .rfs-grid { grid-template-columns: minmax(0, 1fr); } }
.rfs-card { padding: 16px 18px 18px; min-width: 0; }
.rfs-h { align-items: flex-start; }
.rfs-h > div { flex: 1; }
.rfs-h > .btn, .rfs-h > .rfs-lock { flex: 0 0 auto; margin-left: auto; }
.rfs-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; margin-top: 12px; }
.rfs-fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 12px; font-weight: 650; color: var(--text-2); }
.rfs-fld small { font-size: 11.3px; font-weight: 500; color: var(--muted); line-height: 1.4; }
.rfs-fld-inline { flex-direction: row; align-items: center; gap: 10px; margin: 2px 0 0; }
.rfs-fld-inline > span { flex: 0 0 auto; }
.rfs-fld-inline .dp { width: 172px; }
.rfs-fld-inline.off { opacity: .55; }
.rfs-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
.rfs-opt { display: flex; align-items: flex-start; gap: 9px; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; transition: all .12s; }
.rfs-opt:hover { border-color: #c6d2f5; }
.rfs-opt.on { border-color: var(--accent); background: #f5f8ff; }
.rfs-opt.ro { cursor: default; }
.rfs-opt.ro:hover { border-color: var(--border); }
.rfs-opt.ro.on:hover { border-color: var(--accent); }
.rfs-opt.ro:not(.on) { opacity: .6; }
.rfs-opt input { flex: 0 0 auto; margin: 2px 0 0; accent-color: var(--accent); }
.rfs-opt > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rfs-opt b { font-size: 12.8px; font-weight: 750; color: var(--text); }
.rfs-opt small { font-size: 11.3px; color: var(--muted); line-height: 1.4; }
.rfs-rows { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; }
.rfs-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.rfs-row > span:first-child { flex: 1 1 210px; min-width: 0; }
.rfs-row input { width: 88px; height: 34px; padding: 4px 8px; text-align: right; font-variant-numeric: tabular-nums; }
.rfs-row em { min-width: 76px; font-style: normal; font-size: 11.5px; color: var(--muted); }
.rfs-row em.rfs-unit-s { min-width: 0; }
.rfs-or { font-size: 11.5px; color: var(--muted); }
.rfs-sub-h { margin-top: 14px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.rfs-law { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: #f6f8fc; font-size: 11.8px; color: var(--text-2); line-height: 1.5; }
.rfs-law svg { flex: 0 0 auto; color: var(--accent); margin-top: 1px; }
.rfs-lock { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: #f1f3f7; color: var(--muted); font-size: 11px; font-weight: 750; white-space: nowrap; }
.rfs-card .adts-row { margin-top: 12px; }
.rfs-card .adts-note { margin-top: 10px; }
/* график */
.rfs-sch-wrap { overflow-x: auto; margin: 10px -4px 0; }
.rfs-sch { width: 100%; min-width: 920px; border-collapse: separate; border-spacing: 0 6px; table-layout: fixed; }
.rfs-sch th { padding: 0 4px 2px; text-align: left; font-size: 10.8px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.rfs-sch td { padding: 0 4px; vertical-align: middle; }
.rfs-sch td > input { width: 100%; height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 12.8px; }
.rfs-sch .dp-text { height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 12.8px; }
.rfs-sch .csel-btn { min-height: 36px; padding-top: 6px; padding-bottom: 6px; font-size: 12.8px; }
.rfs-sch-n { text-align: center; font-size: 12px; font-weight: 800; color: var(--muted); }
.rfs-sch td.rfs-sch-empty { padding: 18px; text-align: center; color: var(--muted); font-size: 12.5px; background: #fafbfd; border-radius: 10px; }
.rfs-sch-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 12px; }
/* тексты клиенту */
.rfs-tpls { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.rfs-tpl { border: 1px solid var(--border-soft); border-radius: 12px; background: #fff; transition: border-color .12s, box-shadow .12s; }
.rfs-tpl:hover { border-color: #dbe2f0; }
.rfs-tpl.open { border-color: #c6d2f5; box-shadow: 0 8px 22px -14px rgba(20, 40, 90, .4); }
.rfs-tpl-h { display: grid; grid-template-columns: minmax(230px, 330px) minmax(0, 1fr) 22px; gap: 14px; align-items: center; width: 100%; padding: 10px 12px; border: none; border-radius: 12px;
    background: none; font: inherit; text-align: left; cursor: pointer; }
.rfs-tpl-h:hover { background: #fafbff; }
.rfs-tpl-t { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.rfs-tpl-t b { font-size: 12.8px; font-weight: 750; color: var(--text); }
.rfs-tpl-t i { font-style: normal; font-size: 10px; font-weight: 800; padding: 1px 6px; border-radius: 6px; }
.rfs-tpl-tags { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rfs-tz { background: #eef1f6; color: #5d6879; }
.rfs-tpl-x { min-width: 0; font-size: 12.3px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rfs-tpl.open .rfs-tpl-x { visibility: hidden; }
.rfs-tpl-go { display: inline-flex; color: var(--faint); }
.rfs-tpl-h:hover .rfs-tpl-go, .rfs-tpl.open .rfs-tpl-go { color: var(--accent); }
.rfs-tpl-ed { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 2px 12px 14px; }
.rfs-tpl-l { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.rfs-tpl-l textarea { width: 100%; min-height: 180px; font-size: 13px; line-height: 1.5; resize: vertical; }
.rfs-tpl-l .adts-vars { margin-top: 0; }
.rfs-var-note { font-size: 11px; font-weight: 500; color: var(--muted); }
.rfs-tpl-acts { display: flex; align-items: center; gap: 10px; }
.rfs-tpl-acts .muted { margin-left: auto; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.rfs-tpl-r { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rfs-prev-h { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 750; color: var(--text-2); }
.rfs-prev-h small { font-weight: 550; color: var(--muted); }
.rfs-tpl-r .rfp-wa { border-radius: 12px; max-height: 470px; }
@media (max-width: 1180px) { .rfs-tpl-ed { grid-template-columns: minmax(0, 1fr); } .rfs-tpl-h { grid-template-columns: minmax(0, 1fr) 22px; } .rfs-tpl-x { display: none; } }

/* ═══ «Календарь»: этапы графика «Уточнёнок 091» (calendar.js, тип project) ═══ */
.cal-root, .cal-wk-strip { --c-project: #c026d3; --c-project-bg: #fbeefd; --c-project-fg: #a21caf; }
/* без веса: тон события (сдано, горит, просрочено) перекрывает цвет типа, как у сроков отчётов */
:where(.t-project) { --cc: var(--c-project); --cb: var(--c-project-bg); --cf: var(--c-project-fg); }
/* подпись плашки: в узкой сетке (ноутбук 1366, клетка ~130 px) — короткая, чтобы встала в строку с иконкой */
.cal-pill .cal-pl-s { display: none; }
@container (max-width: 1100px) { .cal-pill .cal-pl-l { display: none; } .cal-pill .cal-pl-s { display: inline; } }

/* ═══ «Настройки → Ставки»: периоды ставки (app.js → renderRatesEditor) ═══ */
.rates-table tr.rate-row.has-hist td { border-bottom: none; padding-bottom: 3px; }
.rates-table tr.rate-hist-row td { padding: 0 10px 12px 20px; border-bottom: 1px solid var(--border-soft); }
/* «периоды» и «убрать» — столбиком: таблица и так впритык к ширине карточки */
.rates-table td.rate-acts { padding-left: 2px; padding-right: 8px; }
.rates-table td.rate-acts .btn { display: flex; padding: 6px; }
.rates-table td.rate-acts .btn + .btn { margin-top: 4px; }
.rate-hist { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 12px; color: var(--muted); }
.rate-hist > svg { color: var(--accent); }
.rate-hist-l { margin-right: 2px; font-weight: 700; color: var(--text-2); }
.rate-per { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 999px; background: #f3f5f9; color: var(--text-2); font-weight: 650; white-space: nowrap;
    font-variant-numeric: tabular-nums; cursor: default; }
.rate-per.past { color: var(--muted); }
.rate-per.cur { background: var(--accent-soft); color: var(--accent-2); box-shadow: inset 0 0 0 1px #c9d6fb; font-weight: 750; }
.rate-per i { padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-style: normal; font-size: 10px; font-weight: 800; }
.rate-hist-sep { margin-left: -4px; color: var(--faint); }
.rate-hist-ed { display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 2px 8px; border: none; border-radius: 7px; background: none; color: var(--accent-2); font: inherit;
    font-size: 12px; font-weight: 700; cursor: pointer; }
.rate-hist-ed:hover { background: var(--accent-soft); }
/* окно «Периоды ставки» */
.rate-hist-intro { display: flex; gap: 9px; align-items: flex-start; margin-bottom: 10px; padding: 10px 12px; border-radius: 11px; background: #f3f6ff; color: #33437a; font-size: 12.5px; line-height: 1.5; }
.rate-hist-intro svg { flex: 0 0 auto; color: var(--accent); margin-top: 1px; }
.rate-hist-t { width: 100%; border-collapse: separate; border-spacing: 0 6px; table-layout: fixed; }
.rate-hist-t th { padding: 0 5px; text-align: left; font-size: 10.8px; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.rate-hist-t th.num { text-align: right; }
.rate-hist-t th:nth-child(1) { width: 190px; }
.rate-hist-t th:nth-child(2), .rate-hist-t th:nth-child(3) { width: 98px; }
.rate-hist-t th:nth-child(5) { width: 46px; }
.rate-hist-t td { padding: 0 5px; vertical-align: middle; }
.rate-hist-t td > input { width: 100%; height: 36px; padding: 6px 10px; font-size: 13px; }
.rate-hist-t td.num > input { text-align: right; font-variant-numeric: tabular-nums; }
.rate-hist-t .dp-text { height: 36px; font-size: 13px; }
.rate-hist-start { display: flex; align-items: center; height: 36px; padding: 0 12px; border: 1.5px solid transparent; border-radius: 10px; background: #f3f5f9; color: var(--text-2);
    font-size: 12.8px; font-weight: 650; white-space: nowrap; }
.rate-hist-start b { color: var(--accent-2); font-weight: 800; margin-left: 4px; }
.rate-hist-t tr.cur td > input, .rate-hist-t tr.cur .dp-text, .rate-hist-t tr.cur .rate-hist-start { border-color: #b9c8f6; background: #f5f8ff; }
.rate-hist-t tr.cur td:first-child { box-shadow: inset 3px 0 0 var(--accent); border-radius: 3px; padding-left: 9px; }
