/* Конструктор фильтров товаров (filters.js): кнопка в строке инструментов, панель над списком, редактор условий,
   метки причин в строках. Цвета - переменные app.css, темная тема работает через них же. */

/* ---------- кнопка «Фильтры» ---------- */
.fx-btn { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 600; color: var(--muted); }
.fx-btn svg { width: 16px; height: 16px; }
.fx-btn:hover { border-color: var(--accent-line); color: var(--text); }
.fx-btn.on { border-color: var(--accent-line); background: var(--accent-soft); color: var(--accent); }
.fx-btn[aria-expanded="true"] { border-color: var(--accent); }
.fx-bn { min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px;
  line-height: 19px; text-align: center; font-variant-numeric: tabular-nums; }

/* ---------- панель ---------- */
.fx { position: relative; margin: 0 0 16px; padding: 14px 16px 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
.fx-top { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; margin-bottom: 12px; }
.fx-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin-right: auto; min-width: 0; }
.fx-title svg { width: 18px; height: 18px; color: var(--accent); align-self: center; }
.fx-title b { font-size: 16px; letter-spacing: -.01em; }
.fx-title small { font-size: 12.5px; color: var(--dim); }
.fx-sets { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.fx-sets .ui-select { max-width: 280px; }
.fx-dim { font-size: 12.5px; color: var(--dim); }
.fx-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line); }
.fx-ql { font-size: 12.5px; color: var(--dim); margin-right: 2px; }
.fx-qb .n { margin-left: var(--s-2); font-variant-numeric: tabular-nums; font-weight: 500; }
/* причина недоступности быстрой проверки и кнопки «Сохранить» - в подсказке: наведение у них остается */
.fx-quick .ui-btn[disabled], .fx-sets .ui-btn[disabled] { pointer-events: auto; }
.fx-quick .ui-btn[disabled]:hover, .fx-sets .ui-btn[disabled]:hover { background: var(--surface); border-color: var(--line-2); }
.fx-quick .ui-btn[disabled]:active, .fx-sets .ui-btn[disabled]:active { transform: none; }
/* кнопка «выключить условие» нажата у выключенного условия: подсветка нажатой кнопки читалась бы как «включено» */
.fx-off[aria-pressed="true"] { background: none; border-color: transparent; color: var(--text-2); }
.fx-foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.fx-res { margin-right: auto; font-size: 13.5px; color: var(--muted); }
.fx-res b { color: var(--text); font-variant-numeric: tabular-nums; }

/* ---------- редактор набора ---------- */
.fx-g { display: flex; flex-direction: column; gap: 8px; }
.fx-g:not(.root) { padding: 10px; border: 1px dashed var(--line-2); border-radius: 12px; background: var(--surface-2); }
.fx-g.neg:not(.root) { border-color: var(--up); }
.fx-gh { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 13px; color: var(--muted); }
.fx-gh .fx-cnt { margin-left: auto; }
.fx-op { font-weight: 600; }
.fx-items { display: flex; flex-direction: column; gap: 6px; }
.fx-empty { margin: 0; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); font-size: 13px; color: var(--dim); }
.fx-adds { display: flex; flex-wrap: wrap; gap: 6px; }
.fx-c { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto auto; align-items: start; gap: 8px; padding: 8px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.fx-c.neg { border-color: var(--up-soft); box-shadow: inset 3px 0 0 var(--up); }
.fx-c.off > .fx-body, .fx-c.off > .fx-cnt, .fx-c.off > .fx-not { opacity: .45; }
.fx-c.bad { border-style: dashed; }
.fx-c.na > .fx-cnt { display: none; }
.fx-not { padding: 0 var(--s-4); font-size: var(--fs-2xs); letter-spacing: .05em; color: var(--text-3); }
.fx-not:hover { color: var(--st-bad); border-color: var(--st-bad); }
.fx-not.on { background: var(--st-bad-fill); border-color: var(--st-bad-fill); color: var(--on-bad); }
.fx-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fx-l { display: flex; align-items: center; gap: 6px; min-height: 28px; font-size: 13.5px; }
.fx-hint { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line-2);
  font-size: 10.5px; font-weight: 700; color: var(--dim); cursor: help; flex: none; }
.fx-ps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.fx-p { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; }
.fx-p > small { font-size: 12px; color: var(--dim); }
.fx-n { width: 74px; }
.fx-tx { width: 220px; max-width: 100%; }
.fx-u { font-size: 12.5px; color: var(--muted); }
.fx-ks { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.fx-k.staff.on { background: var(--staff-soft); border-color: transparent; color: var(--staff); }      /* вид цен только для сотрудников */
.fx-fold { max-width: 100%; font-weight: 500; }
.fx-fold span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-na { font-size: 12.5px; color: var(--warn); }
.fx-cnt { min-width: 46px; padding: 5px 8px; border-radius: 8px; background: var(--surface-2); font-size: 12.5px; font-weight: 650;
  text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.fx-cnt:empty { visibility: hidden; }

/* ---------- всплывающие панели (UI.pop): добавить условие, разделы; меню наборов - UI.menu ---------- */
.fx-pg h5 { margin: 6px 8px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--dim); }
.fx-pi { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; width: 100%; padding: 7px 10px; border-radius: 9px; text-align: left; }
.fx-pi:hover:not([disabled]), .fx-pi:focus-visible { background: var(--hover); }
.fx-pi b { font-size: 13.5px; font-weight: 600; }
.fx-pi small { font-size: 12px; line-height: 1.35; color: var(--dim); }
.fx-pi[disabled] { opacity: .55; cursor: default; }
.fx-fi { display: flex; padding: 0 var(--s-4) 0 calc(var(--s-4) + var(--d, 0) * 16px); border-radius: var(--r-sm); font-size: var(--fs-sm); }      /* раздел со сдвигом по вложенности */
.fx-fi:hover { background: var(--hover); }
.fx-fi small { margin-left: auto; padding-left: var(--s-4); color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- строки каталога ---------- */
.row.fx-hit { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.fx-tags { display: inline-flex; flex-wrap: wrap; gap: 3px 4px; margin-left: 8px; vertical-align: 1px; }
.fx-tags i { padding: 0 7px; border-radius: 6px; background: var(--staff-soft); color: var(--staff); font-size: 11.5px; font-style: normal;
  font-weight: 600; line-height: 19px; white-space: nowrap; }

@media (hover: none) { .fx .ui-input, .fx .ui-select, .ui-input.fx-q { font-size: 16px; } }
@media screen and (max-width: 760px) {
  .fx { padding: 12px 12px 10px; }
  .fx-title small { display: none; }
  .fx-top > [data-x="close"] { order: 1; }
  .fx-sets { order: 2; width: 100%; flex-wrap: nowrap; }
  .fx-sets .ui-select { flex: 1 1 0; min-width: 0; max-width: none; }
  .fx-sets .ui-btn { flex: none; }
  .fx-quick { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 12px; padding: 0 12px 12px; scrollbar-width: none; }
  .fx-quick::-webkit-scrollbar { display: none; }
  .fx-quick > * { flex: none; }
  .fx-g:not(.root) { padding: 8px; }
  .fx-c { grid-template-columns: auto minmax(0, 1fr) auto; grid-auto-rows: auto; gap: 4px 6px; }
  .fx-c > .fx-not { grid-column: 1; grid-row: 1; }
  .fx-c > .fx-body { grid-column: 2; grid-row: 1 / span 3; }
  .fx-c > .fx-cnt { grid-column: 3; grid-row: 1; }
  .fx-c > .fx-off { grid-column: 3; grid-row: 2; justify-self: end; }
  .fx-c > .fx-del { grid-column: 3; grid-row: 3; justify-self: end; }
  .fx-tx { width: 100%; }
  .fx-res { width: 100%; }
  .fx-tags { display: flex; margin: 3px 0 0; }
}
@media print {
  .fx, .fx-btn { display: none !important; }
  .row.fx-hit { background: none; box-shadow: none; }
  .fx-tags i { border: 1px solid #999; background: none; color: #000; }
}
