/* Progress page filter bar — search / sort / class chips.
   Sits between the today-embed header and the three task panes. */

.progress-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  margin: 10px 0 14px;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 12px;
}

.pfb-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.pfb-search {
  flex: 1 1 240px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 10px;
  padding: 6px 10px;
  min-height: 32px;
}

.pfb-search:focus-within {
  border-color: rgba(79, 172, 254, 0.5);
}

.pfb-search input[type="search"] {
  flex: 1;
  border: 0;
  background: transparent;
  color: #e6edf3;
  font-size: 13px;
  outline: 0;
  font-family: inherit;
  min-width: 0;
}

.pfb-search input[type="search"]::placeholder {
  color: rgba(148, 163, 184, 0.65);
}

.pfb-icon {
  color: rgba(148, 163, 184, 0.75);
  font-size: 14px;
  line-height: 1;
}

.pfb-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: rgba(148, 163, 184, 0.85);
}

.pfb-sort select {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  color: #e6edf3;
  padding: 5px 8px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.pfb-chips {
  gap: 6px;
}

.pfb-chip {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(148, 163, 184, 0.18);
  color: rgba(226, 232, 240, 0.78);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  min-height: 0;
}

.pfb-chip:hover {
  background: rgba(79, 172, 254, 0.10);
  border-color: rgba(79, 172, 254, 0.30);
  color: #cfe6ff;
}

.pfb-chip.is-active {
  background: rgba(79, 172, 254, 0.18);
  border-color: rgba(79, 172, 254, 0.50);
  color: #93c5fd;
  font-weight: 600;
}

.pfb-chip.pfb-flag.is-active {
  background: rgba(248, 113, 113, 0.16);
  border-color: rgba(248, 113, 113, 0.45);
  color: #fca5a5;
}

.pfb-divider {
  width: 1px;
  height: 18px;
  background: rgba(148, 163, 184, 0.18);
  margin: 0 4px;
}

/* When a class filter is active, dashboard.js adds .pfb-hide-pane to
   the matching pane so it visually collapses. We don't use display:none
   so layout doesn't jump; instead, the pane fades + collapses. */
.today-pane.pfb-hide-pane {
  display: none;
}

/* Cozy mode polish */
[data-ux-mode="cozy"] .progress-filter-bar {
  background: rgba(255, 251, 242, 0.45);
  border-color: rgba(166, 130, 85, 0.22);
}

[data-ux-mode="cozy"] .pfb-search,
[data-ux-mode="cozy"] .pfb-sort select {
  background: rgba(255, 251, 242, 0.65);
  border-color: rgba(166, 130, 85, 0.25);
  color: #1A2438;
}

[data-ux-mode="cozy"] .pfb-chip {
  background: rgba(255, 251, 242, 0.55);
  border-color: rgba(166, 130, 85, 0.22);
  color: #5A5540;
}

[data-ux-mode="cozy"] .pfb-chip.is-active {
  background: rgba(182, 151, 99, 0.16);
  border-color: rgba(182, 151, 99, 0.50);
  color: #B69763;
}

@media (max-width: 600px) {
  .pfb-search { flex: 1 1 100%; }
  .pfb-sort { flex: 0 0 100%; justify-content: space-between; }
  /* Single-row chip strip with horizontal scroll on phones — the
     prior rule with `padding-bottom: 2px` left no room for the
     scroll affordance, so chips appeared clipped without an obvious
     way to reach the off-screen ones. */
  .pfb-chips {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .pfb-chips::-webkit-scrollbar { height: 4px; }
  .pfb-chips::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.3); border-radius: 2px; }
  .pfb-chip { flex: 0 0 auto; scroll-snap-align: start; }
}
