/* Вкладки скоринга (scoring-extra.js): аналитика, правила проверок, журнал решений.
   Белые панели на #F2F6FC, таблицы на волосках, крупные числа только в аналитике (28/500). */
.sx { flex: 1; min-width: 0; min-height: 0; }
.sx .sp { flex: 1; }
.sx-empty { padding: 40px 12px; text-align: center; color: var(--ink-3); font-size: 14px; }
.sx-clip { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-strong { font-weight: 500; }

/* таблицы на волосках */
.sx-t { font-size: 13.5px; table-layout: fixed; }
.sx-t th { font-size: 12.5px; }
.sx-t td { padding: 10px 12px; }
.sx-t .r { text-align: right; }
.sx-t .st { font-size: 13px; }
.sx-t .st svg { width: 15px; height: 15px; }
.sx-t .chip svg { width: 12px; height: 12px; }

/* ——— аналитика ——— */
.sx-analytics { overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding: 0 2px 16px; }
.sx-analytics::-webkit-scrollbar { width: 10px; }
.sx-analytics::-webkit-scrollbar-thumb { background: #D6DDE7; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
.sx-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; padding: 20px 24px; flex: none; }
.sx-kpi { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sx-kpi + .sx-kpi { border-left: 1px solid var(--hair); padding-left: 20px; }
.sx-kpi .label { font-size: 13px; }
.sx-sub { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; flex: none; }
.sx-card { padding: 20px 24px 18px; min-width: 0; }
.sx-h { display: flex; align-items: center; gap: 12px; min-height: 24px; margin-bottom: 14px; }
.sx-h h3 { flex: 1; min-width: 0; font-size: 15px; }
.sx-legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); flex-wrap: wrap; margin-top: 8px; }
.sx-2 { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.sx-legend span { display: inline-flex; align-items: center; gap: 6px; }
.sx-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sx-chart .chart { display: block; overflow: visible; }
.sx .chart .ax { font-size: 11px; fill: var(--ink-3); font-family: var(--font); }
.sx .hbars { display: flex; flex-direction: column; gap: 12px; }
.sx .hb { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 12px; align-items: end; }
.sx .hb-l { font-size: 13px; min-width: 0; display: flex; gap: 8px; align-items: baseline; }
.sx .hb-l em { font-style: normal; font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); flex: none; }
.sx .hb-t { grid-column: 1 / -1; order: 3; height: 6px; border-radius: 3px; background: var(--fill-2); overflow: hidden; }
.sx .hb-t i { display: block; height: 100%; border-radius: 3px; }
.sx .hb-v { font-size: 13px; color: var(--ink); font-variant-numeric: tabular-nums; }
.sx-at col.c-name { width: 44%; }
.sx-at col.c-num { width: 110px; }
.sx-at col.c-pct { width: 72px; }
.sx-at td .faint { font-size: 12.5px; }

/* ——— правила проверок ——— */
.sx-rules { display: grid; grid-template-columns: 236px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 12px; }
.sx-types { padding: 10px 8px; align-self: start; display: flex; flex-direction: column; gap: 2px; }
.sx-type { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; font-size: 14px; color: var(--ink); text-align: left; transition: background .12s; }
.sx-type span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sx-type .n { font-size: 12.5px; color: var(--ink-3); }
.sx-type:hover { background: var(--fill-2); }
.sx-type.on { background: var(--fill-2); font-weight: 600; }
.sx-types-sep { height: 1px; background: var(--hair); margin: 8px 10px; }
.sx-qbtn { color: var(--ink-2); }
.sx-qbtn svg { width: 18px; height: 18px; flex: none; color: var(--icon-2); }
.sx-qbtn span:first-of-type { flex: 1; }
.sx-qs-h { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 2px; font-size: 13.5px; }
.sx-qs-h b { font-weight: 600; }
.sx-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: hidden; }
.sx-bar { display: flex; align-items: center; gap: 12px; padding: 14px 20px 12px; flex-wrap: wrap; flex: none; }
.sx-search { width: 240px; }
.sx-bar .seg .badge { font-size: 11.5px; color: var(--ink-3); }
.sx-bar .btn .badge { height: 18px; min-width: 18px; font-size: 11.5px; }
.sx-scroll { flex: 1; min-height: 0; overflow: auto; padding: 0 20px 12px; }
.sx-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.sx-scroll::-webkit-scrollbar-thumb { background: #D6DDE7; border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
.sx-rt .c-code { width: 112px; }
.sx-rt .c-lvl { width: 150px; }
.sx-rt .c-m { width: 124px; }
.sx-rt .c-on { width: 60px; }
.sx-rt tbody tr.is-off td { color: var(--ink-3); }
.sx-rt tbody tr.is-off td .st, .sx-rt tbody tr.is-off td .chip { opacity: .5; }
.sx-rt .toggle { display: inline-block; vertical-align: middle; }
.sx-qs { display: none; flex: none; margin: 0 20px 12px; padding: 4px 16px; border-radius: 12px; background: var(--bg); max-height: 240px; overflow-y: auto; }
.sx-qs.open { display: block; }
.sx-qs ol, .sx-qlist { margin: 0; padding: 0 0 0 20px; }
.sx-qs li, .sx-qlist li { padding: 8px 0; font-size: 13px; color: var(--ink-2); border-bottom: 1px solid var(--hair); }
.sx-qs li:last-child, .sx-qlist li:last-child { border-bottom: 0; }
.sx-qs li b, .sx-qlist li b { display: block; font-weight: 600; color: var(--ink); font-size: 13.5px; }
.sx-qs li .mono, .sx-qlist li .mono { display: block; font-size: 11.5px; margin-top: 2px; }

/* карточка правила */
.sx-rule-m .modal-body { padding-top: 4px; }
.sx-kv { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.sx-kv th { width: 170px; text-align: left; vertical-align: top; font-weight: 400; color: var(--ink-2); padding: 9px 12px 9px 0; border-bottom: 1px solid var(--hair); }
.sx-kv td { padding: 9px 0; border-bottom: 1px solid var(--hair); overflow-wrap: anywhere; }
.sx-kv tr:last-child th, .sx-kv tr:last-child td { border-bottom: 0; }
.sx-kv .chip svg { width: 12px; height: 12px; }
.sx-lbl { display: block; margin: 16px 0 6px; font-size: 12px; font-weight: 500; color: var(--ink-3); }
.sx-onoff { display: inline-flex; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink); }

/* перечень: метки строк, история изменений (правка — scoring-extra.js, «Правила проверок») */
.sx-pn { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sx-pn .sx-clip { flex: 0 1 auto; min-width: 0; }
.sx-pn .chip { flex: none; }
.sx-hh { display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 36px; }
.sx-hh b { font-size: 15px; font-weight: 600; white-space: nowrap; }
.sx-hh span { font-size: 13px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sx-bar > .btn { flex: none; }
.sx-rules .sx-bar { flex-wrap: nowrap; }
.sx-rules .sx-search { width: auto; flex: 0 1 240px; min-width: 150px; }
@media (max-width: 1200px) { .sx-rules .sx-bar { flex-wrap: wrap; } }
.sx-ut .c-code { width: 112px; }
.sx-ut .c-kind { width: 30%; }
.sx-rt tbody tr.sx-flash td { animation: sxFlash 2.6s ease-out; }
@keyframes sxFlash { 0%, 45% { background: var(--accent-soft); } 100% { background: transparent; } }
.sx-ht .c-when { width: 132px; }
.sx-ht .c-par { width: 27%; }
.sx-ht .c-basis { width: 23%; }
.sx-ht td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; }
.sx-chg { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.sx-chg + .sx-chg { margin-top: 6px; }
.sx-chg-f { display: block; font-size: 12px; color: var(--ink-3); }
.sx-chg .chip { margin-right: 8px; vertical-align: 1px; }
.sx-was { color: var(--ink-2); }
.sx-now { font-weight: 500; }
.sx-from { display: block; margin-top: 2px; font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* карточка правила: последнее изменение, форма полей заказчика, основание */
.sx-last { display: flex; gap: 8px; align-items: flex-start; margin-top: 14px; font-size: 12.5px; color: var(--ink-3); }
.sx-last svg { width: 14px; height: 14px; flex: none; margin-top: 2px; color: var(--icon-2); }
.sx-form { display: flex; flex-direction: column; gap: 12px; }
.sx-2c { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.sx-f { display: flex; flex-direction: column; min-width: 0; }
.sx-f > .label { margin-bottom: 6px; }
.sx-f.chg > .label { color: var(--accent); }
.sx-f.chg > .label::after { content: " · изменено"; }
.sx-form .input { font-size: 14px; }
.sx-form textarea.input { min-height: 0; padding: 8px 12px; font-size: 13.5px; line-height: 1.45; resize: none; }
.sx-form select.input { padding-right: 8px; }
.sx-blk { align-self: flex-start; }
.sx-blk button { height: 32px; }
.sx-ferr { display: none; margin-top: 5px; font-size: 12px; color: var(--bad-ink); }
.sx-f.is-err .input { border-color: var(--bad); }
.sx-f.is-err .sx-ferr { display: block; }
.sx-basis { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; align-items: start; padding-top: 14px; border-top: 1px solid var(--hair); }
.sx-tog-m .sx-basis { padding-top: 4px; border-top: 0; }
.sx-hint { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-3); }
.sx-hint svg { width: 14px; height: 14px; flex: none; color: var(--icon-2); }
.sx-cap { align-self: end; padding-bottom: 11px; font-size: 12.5px; color: var(--ink-3); }
.sx-cap.full { color: var(--bad-ink); }
.sx-form .sx-onoff { align-self: flex-start; }
.sx-onoff.chg [data-onl]::after { content: " · изменено"; color: var(--accent); font-size: 12px; font-weight: 500; }
.sx-tog-m .mh-t .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ——— журнал решений ——— */
.sx-journal { display: flex; flex-direction: column; }
.sx-journal .sx-main { flex: 1; }
.sx-jt .c-when { width: 136px; }
.sx-jt .c-doc { width: 28%; }
.sx-jt .c-ag { width: 194px; }
.sx-jt .c-dec { width: 196px; }
.sx-jt td { padding-top: 9px; padding-bottom: 9px; }
.sx-cmt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 13px; line-height: 1.4; }
.sx-dec { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.sx-dis { font-size: 12px; color: var(--warn-ink); background: var(--warn-soft); border-radius: 999px; padding: 1px 8px; }

@media (max-width: 1280px) {
  .sx-rules { grid-template-columns: 208px minmax(0, 1fr); }
  .sx-search { width: 200px; }
  .sx-jt .c-ag { width: 180px; }
}
