/* ── Filter bar ──────────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: oklch(15% 0.025 270 / 46%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  box-shadow: 0 1px 0 oklch(100% 0 0 / 4%) inset;
  position: relative;
  z-index: 30;
  overflow: visible;
}

.filter-bar:has(.select-control.open) {
  z-index: 260;
}

:root.light .filter-bar {
  background: oklch(100% 0 0 / 72%);
  box-shadow: 0 1px 0 oklch(100% 0 0 / 70%) inset;
}

.search-input {
  flex: 1;
  min-width: 240px;
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: oklch(11% 0.02 270 / 45%);
  color: var(--fg);
  font-size: 14px;
  outline: none;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

:root.light .search-input {
  background: oklch(98% 0.005 270 / 80%);
}

.search-input:focus {
  border-color: oklch(74% 0.2 45 / 40%);
  box-shadow: 0 0 0 3px oklch(74% 0.2 45 / 8%);
  background: var(--surface);
}

.search-input::placeholder {
  color: var(--muted);
}

.filter-group {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.filter-group-label {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-inline-end: 4px;
}

.filter-btn {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  transition: all var(--transition);
}

.filter-btn:hover {
  border-color: oklch(74% 0.2 45 / 25%);
  color: var(--fg);
}

.filter-btn.active {
  background: oklch(74% 0.2 45 / 10%);
  border-color: oklch(74% 0.2 45 / 30%);
  color: var(--accent);
  box-shadow: 0 0 12px oklch(74% 0.2 45 / 8%);
}

.select-control {
  position: relative;
  min-width: 132px;
  z-index: 1;
}

.select-control.open {
  z-index: 280;
}

.select-trigger {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: oklch(11% 0.02 270 / 45%);
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  transition:
    border-color var(--transition),
    box-shadow var(--transition),
    background var(--transition);
}

:root.light .select-trigger {
  background: oklch(98% 0.005 270 / 80%);
}

.select-trigger:hover,
.select-control.open .select-trigger {
  border-color: oklch(74% 0.2 45 / 25%);
  background: oklch(74% 0.2 45 / 6%);
}

.select-trigger:focus-visible,
.select-control.open .select-trigger {
  border-color: oklch(74% 0.2 45 / 40%);
  box-shadow: 0 0 0 3px oklch(74% 0.2 45 / 8%);
}

.select-chevron {
  width: 7px;
  height: 7px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-2px) rotate(45deg);
  transition:
    border-color var(--transition),
    transform var(--transition);
  flex-shrink: 0;
}

.select-trigger:hover .select-chevron,
.select-trigger:focus-visible .select-chevron,
.select-control.open .select-chevron {
  border-color: var(--accent);
}

.select-control.open .select-chevron {
  transform: translateY(2px) rotate(225deg);
}

.select-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 300;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: oklch(13% 0.018 270 / 98%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: min(320px, calc(100vh - 220px));
  box-shadow:
    0 14px 36px oklch(0% 0 0 / 32%),
    0 0 0 1px oklch(100% 0 0 / 3%) inset;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  animation: selectMenuIn 120ms var(--ease-out-expo);
}

:root.light .select-menu {
  background: oklch(100% 0 0 / 98%);
  box-shadow:
    0 16px 36px oklch(13% 0.02 270 / 12%),
    0 0 0 1px oklch(100% 0 0 / 80%) inset;
}

.select-search {
  width: 100%;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid oklch(74% 0.2 45 / 18%);
  border-radius: 6px;
  background: oklch(11% 0.02 270 / 55%);
  color: var(--fg);
  font-size: 12px;
  outline: none;
}

:root.light .select-search {
  background: oklch(98% 0.005 270 / 90%);
}

.select-search:focus {
  border-color: oklch(74% 0.2 45 / 42%);
  box-shadow: 0 0 0 2px oklch(74% 0.2 45 / 8%);
}

.select-options {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
}

.select-options::-webkit-scrollbar {
  width: 6px;
}

.select-options::-webkit-scrollbar-thumb {
  background: oklch(74% 0.2 45 / 28%);
  border-radius: 999px;
}

.select-option {
  width: 100%;
  min-height: 34px;
  padding: 7px 9px 7px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--fg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  text-align: left;
  transition:
    color var(--transition-fast),
    background var(--transition-fast);
}

.select-option:hover {
  background: oklch(74% 0.2 45 / 8%);
}

.select-option.active {
  background: oklch(74% 0.2 45 / 13%);
  color: var(--accent);
}

:root.light .select-option:hover {
  background: oklch(58% 0.22 45 / 8%);
}

:root.light .select-option.active {
  background: oklch(58% 0.22 45 / 12%);
}

.select-check {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
}

.select-empty {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}
