/* Tab bar: segmented control for view switching. */

.tab-bar,
.wm-tab-bar {
  display: flex;
  gap: 0;
  border: 1px solid var(--wm-color-border);
  border-radius: var(--wm-radius-base, 8px);
  overflow: hidden;
  width: fit-content;
}

.tab-btn,
.wm-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.8rem;
  border: none;
  border-inline-end: 1px solid var(--wm-color-border);
  background: var(--wm-color-surface);
  color: var(--wm-color-text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.tab-btn:last-child,
.wm-tab-btn:last-child {
  border-inline-end: none;
}

.tab-btn:hover,
.wm-tab-btn:hover {
  background: var(--wm-color-surface-strong);
}

.tab-btn-active,
.wm-tab-btn-active {
  background: var(--wm-color-accent-soft);
  color: var(--wm-color-accent);
  border-inline-end-color: var(--wm-color-accent-border);
}

.tab-btn-active:hover,
.wm-tab-btn-active:hover {
  background: color-mix(in srgb, var(--wm-color-accent-soft) 75%, var(--wm-color-accent-border));
}

/* Badge count inside a tab */

.tab-count,
.wm-tab-count {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.05rem 0.35rem;
  border-radius: var(--wm-radius-base, 8px);
  background: rgb(0 0 0 / 7%);
}

.tab-btn-active .tab-count,
.wm-tab-btn-active .wm-tab-count {
  background: color-mix(in srgb, var(--wm-color-accent) 15%, transparent);
}

/* Section label above a tab group or filter set */

.wm-tabs .wm-tab-bar {
  max-width: 100%;
  overflow-x: auto;
}

.wm-tabs .wm-tab-btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.wm-tabs .wm-tab-btn:focus-visible {
  outline: 2px solid var(--wm-color-accent);
  outline-offset: -2px;
}

.wm-tab-panel { padding-block: var(--wm-space-4); }

.tab-section-label,
.wm-tab-section-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--wm-color-text-muted);
  margin-bottom: 0.35rem;
}

/* ── Status toggle: pill-shaped multi-state filter ─────────────────────── */

.status-toggle,
.wm-status-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.status-toggle-btn,
.wm-status-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: var(--wm-radius-pill, 999px);
  border: 2px solid transparent;
  background: var(--wm-color-surface-strong);
  color: var(--wm-color-text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

.status-toggle-btn:hover,
.wm-status-toggle-btn:hover {
  background: var(--wm-color-surface-strong);
}

/* Active tonal states */

.status-toggle-btn-active,
.wm-status-toggle-btn-active {
  background: var(--wm-color-accent-soft);
  border-color: var(--wm-color-accent-border);
  color: var(--wm-color-accent);
}

.status-toggle-btn-success.status-toggle-btn-active,
.wm-status-toggle-btn-success.wm-status-toggle-btn-active {
  background: var(--wm-color-success-soft);
  border-color: var(--wm-color-success-border);
  color: var(--wm-color-success);
}

.status-toggle-btn-warning.status-toggle-btn-active,
.wm-status-toggle-btn-warning.wm-status-toggle-btn-active {
  background: var(--wm-color-warning-soft);
  border-color: var(--wm-color-warning-border);
  color: var(--wm-color-warning);
}

.status-toggle-btn-muted.status-toggle-btn-active,
.wm-status-toggle-btn-muted.wm-status-toggle-btn-active {
  background: var(--wm-color-surface-strong);
  border-color: var(--wm-color-border-strong);
  color: var(--wm-color-text-muted);
}

/* Inactive semantic border hints (color-coded even when not active) */

.status-toggle-btn-success,
.wm-status-toggle-btn-success {
  border-color: var(--wm-color-success-border);
  color: var(--wm-color-success);
}

.status-toggle-btn-success:hover,
.wm-status-toggle-btn-success:hover {
  background: var(--wm-color-success-soft);
}

.status-toggle-btn-warning,
.wm-status-toggle-btn-warning {
  border-color: var(--wm-color-warning-border);
  color: var(--wm-color-warning);
}

.status-toggle-btn-warning:hover,
.wm-status-toggle-btn-warning:hover {
  background: var(--wm-color-warning-soft);
}

.status-toggle-btn-muted,
.wm-status-toggle-btn-muted {
  border-color: var(--wm-color-border-strong);
  color: var(--wm-color-text-muted);
}

.status-toggle-btn-muted:hover,
.wm-status-toggle-btn-muted:hover {
  background: var(--wm-color-surface-strong);
}

@media (forced-colors: active) {
  :is(.tab-btn-active, .wm-tab-btn-active, .status-toggle-btn-active, .wm-status-toggle-btn-active) {
    outline: 2px solid Highlight;
    outline-offset: -4px;
    font-weight: 700;
    text-decoration: underline;
  }

  :is(.tab-btn, .wm-tab-btn, .status-toggle-btn, .wm-status-toggle-btn):focus-visible {
    outline: 2px solid ButtonText;
    outline-offset: -2px;
  }

  .wm-tabs .wm-tab-btn:disabled {
    color: GrayText;
    opacity: 1;
  }
}
