/* Вендорено из vtb-filters/ermo-snapshot/compact-filters.css. Палитра переведена на токены стенда. */
:root {
  --ermo-blue: var(--val, #0d69f2);
  --ermo-blue-hover: var(--accent, #0b5ed7);
  --ermo-text: var(--ink, #252629);
  --ermo-muted: var(--muted, #74767b);
  --ermo-border: var(--line, #d5d7da);
  --ermo-bg: var(--sunk, #f4f5f7);
  --ermo-ok: var(--ok, #1f8a4c);
  --ermo-ok-bg: var(--ok-soft, #e6f6ec);
  --ermo-err: var(--bad, #d92020);
  --ermo-err-bg: var(--bad-soft, #fdeaea);
}

.cf {
  font-family: var(--sans, "Segoe UI", system-ui, sans-serif);
  color: var(--ermo-text);
  background: #fff;
  border: 1px solid var(--ermo-border);
  border-radius: 8px;
  margin: 0;
  padding: 12px 16px 10px;
  border-radius: 0;
  border-width: 0 0 1px;
}

.cf-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 20px;
}

.cf-field {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cf-label {
  font-size: 13px;
  line-height: 16px;
  color: var(--ermo-text);
}

.cf-control {
  position: relative;
  display: flex;
  align-items: stretch;
  height: 40px;
  border: 1px solid var(--ermo-border);
  border-radius: 8px;
  background: #fff;
}

.cf-control:focus-within {
  border-color: var(--ermo-blue);
  box-shadow: 0 0 0 3px rgba(13, 105, 242, 0.12);
}

.cf-op {
  flex: 0 0 40px;
  width: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f4f5f7;
  border-right: 1px solid var(--ermo-border);
  border-radius: 7px 0 0 7px;
  color: var(--ermo-muted);
  cursor: pointer;
}

.cf-op:hover { background: #eceef1; color: var(--ermo-text); }

.cf-op svg { width: 18px; height: 18px; display: block; }
.cf-op-sym { font-size: 16px; font-weight: 600; line-height: 1; }

.cf-value {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px 10px;
  overflow: hidden;
}

.cf-value input {
  flex: 1 1 80px;
  min-width: 80px;
  border: 0;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  color: var(--ermo-text);
  height: 32px;
}

.cf-value input::placeholder { color: #b2b5b8; }

.cf-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 2px 8px;
  border: 1px solid var(--ermo-blue);
  border-radius: 4px;
  background: #f3f8ff;
  color: var(--ermo-text);
  font-size: 13px;
  line-height: 18px;
  white-space: nowrap;
}

.cf-suggest {
  position: absolute;
  z-index: 40;
  top: calc(100% + 4px);
  left: 40px;
  right: 0;
  max-height: 240px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--ermo-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.12);
  padding: 4px 0;
}

.cf-suggest button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: none;
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  color: var(--ermo-text);
}

.cf-suggest button:hover,
.cf-suggest button.active { background: #eef6fc; }

.cf-menu {
  position: absolute;
  z-index: 50;
  top: calc(100% + 4px);
  left: 0;
  width: 280px;
  background: #fff;
  border: 1px solid var(--ermo-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.14);
  padding: 8px 0 6px;
}

.cf-menu-title {
  padding: 4px 14px 8px;
  font-size: 13px;
  font-weight: 600;
}

.cf-menu button {
  display: flex;
  width: 100%;
  align-items: flex-start;
  gap: 10px;
  border: 0;
  background: none;
  text-align: left;
  padding: 8px 14px;
  font: inherit;
  cursor: pointer;
  color: var(--ermo-text);
}

.cf-menu button:hover,
.cf-menu button.active { background: #eef6fc; }

.cf-menu-ico {
  width: 20px;
  flex: 0 0 20px;
  color: var(--ermo-muted);
  display: flex;
  justify-content: center;
  padding-top: 2px;
}

.cf-menu-name { display: block; font-size: 13px; }
.cf-menu-sql { display: block; font-size: 11px; color: var(--ermo-muted); margin-top: 2px; }

.cf-add {
  margin-top: 12px;
  border: 0;
  background: none;
  color: var(--ermo-blue);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.cf-add:hover { text-decoration: underline; }

.cf-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 16px;
}

.cf-actions-left,
.cf-actions-right { display: flex; align-items: center; gap: 8px; position: relative; }

.cf-btn {
  height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.cf-btn-ghost {
  background: #fff;
  border: 1px solid var(--ermo-blue);
  color: var(--ermo-blue);
}

.cf-btn-ghost:hover { background: #f3f8ff; }

.cf-btn-primary {
  background: var(--ermo-blue);
  border: 1px solid var(--ermo-blue);
  color: #fff;
}

.cf-btn-primary:hover { background: var(--ermo-blue-hover); }

.cf-btn-primary:disabled {
  background: #c7c9cc;
  border-color: #c7c9cc;
  color: #fff;
  cursor: not-allowed;
}

.cf-icon-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--ermo-border);
  border-radius: 8px;
  background: #fff;
  color: var(--ermo-muted);
  cursor: pointer;
}

.cf-icon-btn:hover { background: #f4f5f7; color: var(--ermo-text); }
.cf-icon-btn svg { width: 18px; height: 18px; }

.cf-funnel-menu {
  position: absolute;
  z-index: 50;
  left: 0;
  bottom: calc(100% + 6px);
  width: 320px;
  background: #fff;
  border: 1px solid var(--ermo-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(17, 24, 39, 0.14);
  padding: 6px 0;
}

.cf-funnel-menu button {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  text-align: left;
  padding: 8px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  color: var(--ermo-text);
}

.cf-funnel-menu button:hover { background: #eef6fc; }
.cf-funnel-menu .muted { color: var(--ermo-muted); }
.cf-sep { height: 1px; background: #eceef1; margin: 4px 0; }

.cf-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cf-modal {
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(17, 24, 39, 0.2);
  padding: 20px 20px 16px;
}

.cf-modal h3 {
  margin: 0 32px 16px 0;
  font-size: 18px;
  font-weight: 600;
}

.cf-modal-close {
  position: absolute;
  top: 14px;
  right: 12px;
  border: 0;
  background: none;
  font-size: 20px;
  color: var(--ermo-muted);
  cursor: pointer;
  width: 32px;
  height: 32px;
}

.cf-modal { position: relative; }

.cf-input {
  width: 100%;
  height: 40px;
  box-sizing: border-box;
  border: 1px solid var(--ermo-border);
  border-radius: 8px;
  padding: 0 36px 0 12px;
  font: inherit;
  font-size: 14px;
}

.cf-input:focus {
  outline: none;
  border-color: var(--ermo-blue);
  box-shadow: 0 0 0 3px rgba(13, 105, 242, 0.12);
}

.cf-search-wrap { position: relative; margin-bottom: 12px; }
.cf-search-wrap svg {
  position: absolute;
  right: 12px;
  top: 11px;
  width: 16px;
  height: 16px;
  color: var(--ermo-muted);
  pointer-events: none;
}

.cf-clear {
  position: absolute;
  right: 10px;
  top: 10px;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--ermo-muted);
  font-size: 16px;
}

.cf-groups {
  max-height: 360px;
  overflow: auto;
  margin: 4px 0 16px;
}

.cf-group-title {
  font-size: 14px;
  font-weight: 600;
  margin: 12px 0 8px;
}

.cf-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  cursor: pointer;
}

.cf-check input {
  appearance: none;
  width: 18px;
  height: 18px;
  border: 1.5px solid #b2b5b8;
  border-radius: 4px;
  margin: 0;
  cursor: pointer;
  display: grid;
  place-content: center;
}

.cf-check input:checked {
  background: var(--ermo-blue);
  border-color: var(--ermo-blue);
}

.cf-check input:checked::after {
  content: "";
  width: 10px;
  height: 6px;
  border: 2px solid #fff;
  border-top: 0;
  border-right: 0;
  transform: rotate(-45deg) translate(1px, -1px);
}

.cf-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.cf-sets { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }

.cf-set-row {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 4px;
  border-radius: 8px;
  cursor: pointer;
}

.cf-set-row:hover,
.cf-set-row.selected { background: #f3f8ff; }

.cf-set-tools { display: flex; gap: 2px; }
.cf-set-tools button {
  width: 28px;
  height: 28px;
  border: 0;
  background: none;
  color: var(--ermo-muted);
  cursor: pointer;
  border-radius: 6px;
}
.cf-set-tools button:hover { background: #eceef1; color: var(--ermo-text); }
.cf-set-name { flex: 1; min-width: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cf-rename {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
}

.cf-rename input {
  flex: 1;
  height: 32px;
  border: 1px solid var(--ermo-blue);
  border-radius: 6px;
  padding: 0 8px;
  font: inherit;
  font-size: 14px;
}

.cf-toast {
  position: fixed;
  z-index: 120;
  left: 16px;
  bottom: 16px;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.cf-toast.ok { background: var(--ermo-ok-bg); color: #145c38; }
.cf-toast.err { background: var(--ermo-err-bg); color: #8a1616; }
.cf-toast button {
  margin-left: auto;
  border: 0;
  background: none;
  cursor: pointer;
  color: inherit;
  font-size: 16px;
}

@media (max-width: 1100px) {
  .cf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ===== Стенд ПИ: модификатор поиска — отдельная пилюля рядом с инпутом; плотность реестра ===== */
.cf { padding: 10px 16px 8px; }
.cf .cf-grid { gap: 10px 16px; }
.cf .cf-field { gap: 3px; }
.cf .cf-label { font-size: 11px; line-height: 14px; color: var(--muted, #74767b); }
.cf .cf-control {
  height: 28px;
  gap: 6px;
  align-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.cf .cf-control:focus-within { border-color: transparent; box-shadow: none; }
.cf .cf-op {
  flex: 0 0 auto;
  width: auto;
  min-width: 28px;
  height: 22px;
  padding: 0 7px;
  border: 1px solid var(--line, #d5d7da);
  border-radius: 11px;
  background: var(--sunk, #f4f5f7);
  color: var(--ink2, #3a4357);
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 600;
}
.cf .cf-op:hover { background: var(--val-soft, #eaf1ff); border-color: var(--val, #0d69f2); color: var(--val, #0d69f2); }
.cf .cf-op svg { width: 14px; height: 14px; }
.cf .cf-op-sym { font-size: 12px; }
.cf .cf-value {
  height: 28px;
  padding: 1px 8px;
  border: 1px solid var(--line, #d5d7da);
  border-radius: 6px;
  background: var(--paper, #fff);
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.cf .cf-value::-webkit-scrollbar { display: none; }
.cf .cf-control:focus-within .cf-value { border-color: var(--val, #0d69f2); box-shadow: 0 0 0 2px var(--val-soft, #eaf1ff); }
.cf .cf-value input { height: 24px; font-size: 12.5px; min-width: 60px; }
.cf .cf-chip { padding: 0 6px; font-size: 11.5px; line-height: 18px; border-radius: 4px; background: var(--val-soft, #f3f8ff); border-color: transparent; color: var(--val, #0d69f2); font-family: var(--mono, monospace); }
.cf .cf-suggest { left: 0; top: calc(100% + 3px); }
.cf .cf-menu { top: calc(100% + 3px); }
.cf .cf-add { font-size: 12.5px; margin-top: 8px; }
.cf .cf-actions { margin-top: 8px; padding-top: 8px; }
.cf .cf-btn { height: 28px; padding: 0 12px; font-size: 12.5px; border-radius: 6px; }
.cf .cf-icon-btn { width: 28px; height: 28px; border-radius: 6px; }
