/* ============================================================
   Compound controls — segmented (.seg), filter pills, progress bar
   ============================================================ */

/* Segmented control */
.seg {
  display: inline-flex; padding: 3px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
}
.seg button {
  height: 30px; padding: 0 10px;
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  border-radius: 6px;
  display: inline-flex; align-items: center; gap: 6px;
  background: transparent;
}
.seg button:hover { color: var(--text-primary); }
.seg button.is-active {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.dark .seg button.is-active {
  box-shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 1px 2px rgba(0,0,0,0.25);
}

/* Full-width grid variant for dropdowns / cards (equal-width 3- or 2-column). */
.seg.is-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.seg.is-grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); width: 100%; }
.seg.is-grid-3 button,
.seg.is-grid-2 button { justify-content: center; }

/* Filter pill — multi-toggle chip */
.filter-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 12px;
  border-radius: 7px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 12.5px; font-weight: 500;
  transition: background 100ms ease, color 100ms ease, border-color 100ms ease;
}
.filter-pill:hover { background: var(--bg-hover); color: var(--text-primary); }
.filter-pill.is-active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}

/* Compact select inside a filter pill row */
.filter-select {
  height: 32px;
  padding: 0 28px 0 12px;
  border-radius: 7px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-default);
  color: var(--text-secondary);
  font-size: 12.5px; font-weight: 500;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-size: 14px;
  cursor: pointer;
}
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-ring);
}
.dark .filter-select {
  background-color: var(--bg-elevated);
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A6A7AE' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}
:where([dir="rtl"]) .filter-select {
  background-position: left 8px center;
  padding: 0 12px 0 28px;
}

/* Vertical separator between pill groups */
.filter-sep {
  display: block;
  width: 1px;
  height: 20px;
  background: var(--border-default);
  margin: 0 2px;
  align-self: center;
  flex-shrink: 0;
}

/* Filter bar — pills row rendered below dt-toolbar */
.dt-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-default);
}

/* Progress bar — thin horizontal */
.progress {
  width: 100%;
  height: 6px;
  background: var(--bg-elevated);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.progress > .progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 220ms cubic-bezier(.4,0,.2,1);
}
.progress.is-positive > .progress-fill { background: var(--positive); }
.progress.is-warning  > .progress-fill { background: var(--warning); }
.progress.is-danger   > .progress-fill { background: var(--danger); }
