/* ================================================================
   aggrid-custom-filter.css — MACustomFilter (shared companion)
   ----------------------------------------------------------------
   Стили двухрежимного фильтра колонок «Условие» + «Выбор».
   ВЫНЕСЕНЫ из src/analytics/styles.css (Группа 2 №22, WAVE 4a) —
   единый источник для всех AG Grid-страниц портала.
   Цвета/радиусы/шрифты — ТОЛЬКО токены theme.css (var(--*)).
   Подключать после aggrid-theme.css, до page-specific styles.css.
   ================================================================ */

/* ================================================================
   MACustomFilter — кастомный двухрежимный фильтр колонок
   «Условие» (condition) + «Выбор» (Excel checkbox list)
   ================================================================ */
.macf-wrap {
  display: flex;
  flex-direction: column;
  width: 240px;
  max-height: 400px;
  font-size: 13px;
  font-family: var(--font, system-ui, sans-serif);
  color: var(--text);
  background: var(--surface);
}

/* Переключатель режимов */
.macf-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.macf-tab {
  flex: 1;
  padding: 7px 0;
  font-size: 12px;
  font-family: inherit;
  font-weight: 500;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text2);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.macf-tab:hover { color: var(--text); }
.macf-tab.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }

/* Панели (скрыты/показаны через .active) */
.macf-panel {
  display: none;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  overflow-y: auto;
}
.macf-panel.active { display: flex; }

/* ---- «Условие» panel ---- */
.macf-op-select {
  width: 100%;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  cursor: pointer;
}
.macf-op-select:focus { border-color: var(--accent); outline: none; }

.macf-cond-input {
  width: 100%;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  box-sizing: border-box;
}
.macf-cond-input:focus { border-color: var(--accent); outline: none; }

/* ---- «Выбор» panel ---- */
.macf-choice-search-wrap {
  position: sticky;
  top: 0;
  background: var(--surface);
  padding-bottom: 4px;
  z-index: 1;
  flex-shrink: 0;
}
.macf-choice-search {
  width: 100%;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  background: var(--surface2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 4px);
  box-sizing: border-box;
}
.macf-choice-search:focus { border-color: var(--accent); outline: none; }

.macf-choice-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.macf-choice-ctrl-btn {
  font-size: 11px;
  font-family: inherit;
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 2px 0;
  opacity: 0.8;
}
.macf-choice-ctrl-btn:hover { opacity: 1; text-decoration: underline; }

.macf-choice-list {
  overflow-y: auto;
  max-height: 200px;
  flex: 1;
}

.macf-choice-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  font-size: 12px;
  cursor: pointer;
  border-radius: 3px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.macf-choice-row:hover { background: var(--surface2); }
.macf-choice-row span {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Нижняя кнопка «Сбросить» ---- */
.macf-footer {
  border-top: 1px solid var(--border);
  padding: 6px 8px;
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}
.macf-reset-btn {
  border: none;
  background: none;
  font-size: 12px;
  font-family: inherit;
  color: var(--text2);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: var(--radius-sm, 4px);
  transition: color .15s;
}
.macf-reset-btn:hover { color: var(--accent); }
